This instance will be upgraded to Heptapod 0.31.0 (final) on 2022-05-24 at 14:00 UTC+2 (a few minutes of down time)

Commit 9f4b8dba authored by James Edwards-Jones's avatar James Edwards-Jones
Browse files

Clean up non TODO rubocop errors

parent 7ca511020df0
......@@ -13,7 +13,7 @@ def show
def define_protected_refs
@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_tag = @project.protected_tags.new
load_gon_index
......
......@@ -18,8 +18,6 @@ def self.access_levels_for_ref(ref, action: :push)
self.matching(ref).map(&:"@#{action}_access_levels").flatten
end
private
def self.matching(ref_name, protected_refs: nil)
ProtectedRefMatcher.matching(self, ref_name, protected_refs: protected_refs)
end
......
#TODO: Refactor, checking EE
# module ProtectedRefAccess
# extend ActiveSupport::Concern
......
......@@ -71,15 +71,15 @@ def tag_checks
def protected_tag_checks
return unless tag_protected?
if forced_push?
return "You are not allowed to force push protected tags." #TODO: Wording, 'not allowed to update proteted tags'?
if forced_push? #TODO: Verify if this should prevent all updates, and mention in UI and documentation
return "Protected tags cannot be updated."
end
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
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."
end
end
......
......@@ -7,7 +7,7 @@ class RelationFactory
triggers: 'Ci::Trigger',
builds: 'Ci::Build',
hooks: 'ProjectHook',
merge_access_levels: 'ProtectedBranch::MergeAccessLevel',
merge_access_levels: 'ProtectedBranch::MergeAccessLevel', #TODO: Tags
push_access_levels: 'ProtectedBranch::PushAccessLevel',
labels: :project_labels,
priorities: :label_priorities,
......
require('spec_helper')
describe Projects::ProtectedTagsController do
# describe "GET #index" do
# let(:project) { create(:project_empty_repo, :public) }
# it "redirects empty repo to projects page" do
# get(:index, namespace_id: project.namespace.to_param, project_id: project)
# end
# end
describe "GET #index" do
let(:project) { create(:project_empty_repo, :public) }
it "redirects empty repo to projects page" do
get(:index, namespace_id: project.namespace.to_param, project_id: project)
end
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment