Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
b64f59d1
Commit
b64f59d1
authored
Jan 11, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
0b2cd167
b682a6f8
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
4 additions
and
169 deletions
+4
-169
app/controllers/projects/releases_controller.rb
app/controllers/projects/releases_controller.rb
+0
-9
app/views/layouts/nav/sidebar/_project.html.haml
app/views/layouts/nav/sidebar/_project.html.haml
+1
-1
lib/api/release/links.rb
lib/api/release/links.rb
+0
-2
lib/api/releases.rb
lib/api/releases.rb
+0
-1
spec/controllers/projects/releases_controller_spec.rb
spec/controllers/projects/releases_controller_spec.rb
+0
-16
spec/requests/api/release/links_spec.rb
spec/requests/api/release/links_spec.rb
+0
-58
spec/requests/api/releases_spec.rb
spec/requests/api/releases_spec.rb
+0
-61
spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
+3
-21
No files found.
app/controllers/projects/releases_controller.rb
View file @
b64f59d1
...
...
@@ -4,16 +4,7 @@ class Projects::ReleasesController < Projects::ApplicationController
# Authorize
before_action
:require_non_empty_project
before_action
:authorize_read_release!
before_action
:check_releases_page_feature_flag
def
index
end
private
def
check_releases_page_feature_flag
return
render_404
unless
Feature
.
enabled?
(
:releases_page
,
@project
)
push_frontend_feature_flag
(
:releases_page
,
@project
)
end
end
app/views/layouts/nav/sidebar/_project.html.haml
View file @
b64f59d1
...
...
@@ -29,7 +29,7 @@
=
link_to
activity_project_path
(
@project
),
title:
_
(
'Activity'
),
class:
'shortcuts-project-activity'
do
%span
=
_
(
'Activity'
)
-
if
project_nav_tab?
(
:releases
)
&&
Feature
.
enabled?
(
:releases_page
,
@project
)
-
if
project_nav_tab?
(
:releases
)
=
nav_link
(
controller: :releases
)
do
=
link_to
project_releases_path
(
@project
),
title:
_
(
'Releases'
),
class:
'shortcuts-project-releases'
do
%span
=
_
(
'Releases'
)
...
...
lib/api/release/links.rb
View file @
b64f59d1
...
...
@@ -8,8 +8,6 @@ module API
RELEASE_ENDPOINT_REQUIREMETS
=
API
::
NAMESPACE_OR_PROJECT_REQUIREMENTS
.
merge
(
tag_name:
API
::
NO_SLASH_URL_PART_REGEX
)
before
{
error!
(
'404 Not Found'
,
404
)
unless
Feature
.
enabled?
(
:releases_page
,
user_project
)
}
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
...
...
lib/api/releases.rb
View file @
b64f59d1
...
...
@@ -7,7 +7,6 @@ module API
RELEASE_ENDPOINT_REQUIREMETS
=
API
::
NAMESPACE_OR_PROJECT_REQUIREMENTS
.
merge
(
tag_name:
API
::
NO_SLASH_URL_PART_REGEX
)
before
{
error!
(
'404 Not Found'
,
404
)
unless
Feature
.
enabled?
(
:releases_page
,
user_project
)
}
before
{
authorize_read_releases!
}
params
do
...
...
spec/controllers/projects/releases_controller_spec.rb
View file @
b64f59d1
...
...
@@ -6,10 +6,6 @@ describe Projects::ReleasesController do
let!
(
:project
)
{
create
(
:project
,
:repository
,
:public
)
}
let!
(
:user
)
{
create
(
:user
)
}
before
do
stub_feature_flags
(
releases_page:
true
)
end
describe
'GET #index'
do
it
'renders a 200'
do
get_index
...
...
@@ -43,18 +39,6 @@ describe Projects::ReleasesController do
expect
(
response
.
status
).
to
eq
(
404
)
end
end
context
'when releases_page feature flag is disabled'
do
before
do
stub_feature_flags
(
releases_page:
false
)
end
it
'renders a 404'
do
get_index
expect
(
response
.
status
).
to
eq
(
404
)
end
end
end
private
...
...
spec/requests/api/release/links_spec.rb
View file @
b64f59d1
...
...
@@ -74,16 +74,6 @@ describe API::Release::Links do
end
end
end
context
'when feature flag is disabled'
do
before
do
stub_feature_flags
(
releases_page:
false
)
end
it_behaves_like
'404 response'
do
let
(
:request
)
{
get
api
(
"/projects/
#{
project
.
id
}
/releases/v0.1/assets/links"
,
maintainer
)
}
end
end
end
describe
'GET /projects/:id/releases/:tag_name/assets/links/:link_id'
do
...
...
@@ -129,16 +119,6 @@ describe API::Release::Links do
end
end
end
context
'when feature flag is disabled'
do
before
do
stub_feature_flags
(
releases_page:
false
)
end
it_behaves_like
'404 response'
do
let
(
:request
)
{
get
api
(
"/projects/
#{
project
.
id
}
/releases/non_existing_tag/assets/links/
#{
release_link
.
id
}
"
,
maintainer
)
}
end
end
end
describe
'POST /projects/:id/releases/:tag_name/assets/links'
do
...
...
@@ -231,19 +211,6 @@ describe API::Release::Links do
end
end
end
context
'when feature flag is disabled'
do
before
do
stub_feature_flags
(
releases_page:
false
)
end
it_behaves_like
'404 response'
do
let
(
:request
)
do
post
api
(
"/projects/
#{
project
.
id
}
/releases/v0.1/assets/links"
,
maintainer
),
params:
params
end
end
end
end
describe
'PUT /projects/:id/releases/:tag_name/assets/links/:link_id'
do
...
...
@@ -328,19 +295,6 @@ describe API::Release::Links do
end
end
end
context
'when feature flag is disabled'
do
before
do
stub_feature_flags
(
releases_page:
false
)
end
it_behaves_like
'404 response'
do
let
(
:request
)
do
put
api
(
"/projects/
#{
project
.
id
}
/releases/v0.1/assets/links/
#{
release_link
.
id
}
"
,
maintainer
),
params:
params
end
end
end
end
describe
'DELETE /projects/:id/releases/:tag_name/assets/links/:link_id'
do
...
...
@@ -401,17 +355,5 @@ describe API::Release::Links do
end
end
end
context
'when feature flag is disabled'
do
before
do
stub_feature_flags
(
releases_page:
false
)
end
it_behaves_like
'404 response'
do
let
(
:request
)
do
delete
api
(
"/projects/
#{
project
.
id
}
/releases/v0.1/assets/links/
#{
release_link
.
id
}
"
,
maintainer
)
end
end
end
end
end
spec/requests/api/releases_spec.rb
View file @
b64f59d1
...
...
@@ -83,18 +83,6 @@ describe API::Releases do
end
end
end
context
'when feature flag is disabled'
do
before
do
stub_feature_flags
(
releases_page:
false
)
end
it
'cannot find the API'
do
get
api
(
"/projects/
#{
project
.
id
}
/releases"
,
maintainer
)
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
end
describe
'GET /projects/:id/releases/:tag_name'
do
...
...
@@ -205,18 +193,6 @@ describe API::Releases do
end
end
end
context
'when feature flag is disabled'
do
before
do
stub_feature_flags
(
releases_page:
false
)
end
it
'cannot find the API'
do
get
api
(
"/projects/
#{
project
.
id
}
/releases/v0.1"
,
maintainer
)
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
end
describe
'POST /projects/:id/releases'
do
...
...
@@ -458,18 +434,6 @@ describe API::Releases do
expect
(
response
).
to
have_gitlab_http_status
(
:conflict
)
end
end
context
'when feature flag is disabled'
do
before
do
stub_feature_flags
(
releases_page:
false
)
end
it
'cannot find the API'
do
post
api
(
"/projects/
#{
project
.
id
}
/releases"
,
maintainer
),
params:
params
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
end
describe
'PUT /projects/:id/releases/:tag_name'
do
...
...
@@ -565,19 +529,6 @@ describe API::Releases do
end
end
end
context
'when feature flag is disabled'
do
before
do
stub_feature_flags
(
releases_page:
false
)
end
it
'cannot find the API'
do
put
api
(
"/projects/
#{
project
.
id
}
/releases/v0.1"
,
non_project_member
),
params:
params
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
end
describe
'DELETE /projects/:id/releases/:tag_name'
do
...
...
@@ -648,17 +599,5 @@ describe API::Releases do
end
end
end
context
'when feature flag is disabled'
do
before
do
stub_feature_flags
(
releases_page:
false
)
end
it
'cannot find the API'
do
delete
api
(
"/projects/
#{
project
.
id
}
/releases/v0.1"
,
non_project_member
)
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
end
end
spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
View file @
b64f59d1
...
...
@@ -60,28 +60,10 @@ describe 'layouts/nav/sidebar/_project' do
end
describe
'releases entry'
do
describe
'when releases feature flag is disabled'
do
before
do
stub_feature_flags
(
releases_page:
false
)
end
it
'does not render releases link'
do
render
expect
(
rendered
).
not_to
have_link
(
'Releases'
,
href:
project_releases_path
(
project
))
end
end
describe
'when releases feature flags is enabled'
do
before
do
stub_feature_flags
(
releases_page:
true
)
end
it
'renders releases link'
do
render
it
'renders releases link'
do
render
expect
(
rendered
).
to
have_link
(
'Releases'
,
href:
project_releases_path
(
project
))
end
expect
(
rendered
).
to
have_link
(
'Releases'
,
href:
project_releases_path
(
project
))
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment