diff --git a/.rubocop.yml b/.rubocop.yml index 8281ab3b6..b1c9d5061 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -33,6 +33,9 @@ RSpec: Layout/ClassStructure: Enabled: true +Layout/LineLength: + Max: 100 + Metrics: Enabled: true @@ -41,9 +44,6 @@ Metrics/BlockLength: - 'spec/**/*.rb' - 'Guardfile' -Metrics/LineLength: - Max: 100 - Performance/CaseWhenSplat: Enabled: true diff --git a/app/controllers/edit_controller.rb b/app/controllers/edit_controller.rb index c8f4d42db..32844d963 100644 --- a/app/controllers/edit_controller.rb +++ b/app/controllers/edit_controller.rb @@ -164,16 +164,15 @@ def update_branch(repo, name, sha) end def open_pr(head, base, title, description) - pr = github.create_pull_request( - original_repo_path, base, head, title, description, - labels: ["groupthink::proposal"] - ) + pr = github.create_pull_request(original_repo_path, base, head, title, description) Proposal.find_or_create_by!( number: pr.number, opened_at: Time.zone.now, title: title, proposer: @current_user ) + # Set PR label directly using admin as other users might not be able to + Octokit.add_issue_labels(original_repo_path, pr.number, [PROPOSAL_LABEL]) end def commit_file(repo, name, content, message, base_sha, branch_name) diff --git a/app/controllers/ideas_controller.rb b/app/controllers/ideas_controller.rb index 9bf3b0267..cf2b9658c 100644 --- a/app/controllers/ideas_controller.rb +++ b/app/controllers/ideas_controller.rb @@ -5,7 +5,7 @@ # class IdeasController < ApplicationController def index - @ideas = Octokit.issues(ENV.fetch("GITHUB_REPO"), labels: "groupthink::idea") + @ideas = Octokit.issues(ENV.fetch("GITHUB_REPO"), labels: IDEA_LABEL) end def show diff --git a/app/views/ideas/index.html.erb b/app/views/ideas/index.html.erb index 2dad7a776..3fdbb9485 100644 --- a/app/views/ideas/index.html.erb +++ b/app/views/ideas/index.html.erb @@ -1,5 +1,5 @@