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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
9f4b8dba
Commit
9f4b8dba
authored
Apr 03, 2017
by
James Edwards-Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up non TODO rubocop errors
parent
35b719f6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
14 deletions
+13
-14
app/controllers/projects/settings/repository_controller.rb
app/controllers/projects/settings/repository_controller.rb
+1
-1
app/models/concerns/protected_ref.rb
app/models/concerns/protected_ref.rb
+0
-2
app/models/concerns/protected_ref_access.rb
app/models/concerns/protected_ref_access.rb
+1
-0
lib/gitlab/checks/change_access.rb
lib/gitlab/checks/change_access.rb
+4
-4
lib/gitlab/import_export/relation_factory.rb
lib/gitlab/import_export/relation_factory.rb
+1
-1
spec/controllers/projects/protected_tags_controller_spec.rb
spec/controllers/projects/protected_tags_controller_spec.rb
+6
-6
No files found.
app/controllers/projects/settings/repository_controller.rb
View file @
9f4b8dba
...
@@ -13,7 +13,7 @@ module Projects
...
@@ -13,7 +13,7 @@ module Projects
def
define_protected_refs
def
define_protected_refs
@protected_branches
=
@project
.
protected_branches
.
order
(
:name
).
page
(
params
[
:page
])
@protected_branches
=
@project
.
protected_branches
.
order
(
:name
).
page
(
params
[
:page
])
@protected_tags
=
@project
.
protected_tags
.
order
(
:name
).
page
(
params
[
:page
])
@protected_tags
=
@project
.
protected_tags
.
order
(
:name
).
page
(
params
[
:page
])
#TODO duplicated pagination param?
@protected_branch
=
@project
.
protected_branches
.
new
@protected_branch
=
@project
.
protected_branches
.
new
@protected_tag
=
@project
.
protected_tags
.
new
@protected_tag
=
@project
.
protected_tags
.
new
load_gon_index
load_gon_index
...
...
app/models/concerns/protected_ref.rb
View file @
9f4b8dba
...
@@ -18,8 +18,6 @@ module ProtectedRef
...
@@ -18,8 +18,6 @@ module ProtectedRef
self
.
matching
(
ref
).
map
(
&
:"@
#{
action
}
_access_levels"
).
flatten
self
.
matching
(
ref
).
map
(
&
:"@
#{
action
}
_access_levels"
).
flatten
end
end
private
def
self
.
matching
(
ref_name
,
protected_refs:
nil
)
def
self
.
matching
(
ref_name
,
protected_refs:
nil
)
ProtectedRefMatcher
.
matching
(
self
,
ref_name
,
protected_refs:
protected_refs
)
ProtectedRefMatcher
.
matching
(
self
,
ref_name
,
protected_refs:
protected_refs
)
end
end
...
...
app/models/concerns/protected_ref_access.rb
View file @
9f4b8dba
#TODO: Refactor, checking EE
# module ProtectedRefAccess
# module ProtectedRefAccess
# extend ActiveSupport::Concern
# extend ActiveSupport::Concern
...
...
lib/gitlab/checks/change_access.rb
View file @
9f4b8dba
...
@@ -71,15 +71,15 @@ module Gitlab
...
@@ -71,15 +71,15 @@ module Gitlab
def
protected_tag_checks
def
protected_tag_checks
return
unless
tag_protected?
return
unless
tag_protected?
if
forced_push?
if
forced_push?
#TODO: Verify if this should prevent all updates, and mention in UI and documentation
return
"
You are not allowed to force push protected tags."
#TODO: Wording, 'not allowed to update proteted tags'?
return
"
Protected tags cannot be updated."
end
end
if
Gitlab
::
Git
.
blank_ref?
(
@newrev
)
if
Gitlab
::
Git
.
blank_ref?
(
@newrev
)
return
"
You are not allowed to delete protected tags."
#TODO: Wording, do these need to mention 'you' if the rule applies to everyone
return
"
Protected tags cannot be deleted."
end
end
if
!
user_access
.
can_push_tag?
(
@tag_name
)
unless
user_access
.
can_push_tag?
(
@tag_name
)
return
"You are not allowed to create this tag as it is protected."
return
"You are not allowed to create this tag as it is protected."
end
end
end
end
...
...
lib/gitlab/import_export/relation_factory.rb
View file @
9f4b8dba
...
@@ -7,7 +7,7 @@ module Gitlab
...
@@ -7,7 +7,7 @@ module Gitlab
triggers:
'Ci::Trigger'
,
triggers:
'Ci::Trigger'
,
builds:
'Ci::Build'
,
builds:
'Ci::Build'
,
hooks:
'ProjectHook'
,
hooks:
'ProjectHook'
,
merge_access_levels:
'ProtectedBranch::MergeAccessLevel'
,
merge_access_levels:
'ProtectedBranch::MergeAccessLevel'
,
#TODO: Tags
push_access_levels:
'ProtectedBranch::PushAccessLevel'
,
push_access_levels:
'ProtectedBranch::PushAccessLevel'
,
labels: :project_labels
,
labels: :project_labels
,
priorities: :label_priorities
,
priorities: :label_priorities
,
...
...
spec/controllers/projects/protected_tags_controller_spec.rb
View file @
9f4b8dba
require
(
'spec_helper'
)
require
(
'spec_helper'
)
describe
Projects
::
ProtectedTagsController
do
describe
Projects
::
ProtectedTagsController
do
#
describe "GET #index" do
describe
"GET #index"
do
#
let(:project) { create(:project_empty_repo, :public) }
let
(
:project
)
{
create
(
:project_empty_repo
,
:public
)
}
#
it "redirects empty repo to projects page" do
it
"redirects empty repo to projects page"
do
#
get(:index, namespace_id: project.namespace.to_param, project_id: project)
get
(
:index
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
)
#
end
end
#
end
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