From 9577ac79d0740b2693f7a8dffcbb56f95015b657 Mon Sep 17 00:00:00 2001 From: Ian Maia Date: Mon, 13 May 2024 21:05:39 +0200 Subject: [PATCH 1/2] Update Dangermattic --- Gemfile.lock | 40 ++++++++++++---------------------------- 1 file changed, 12 insertions(+), 28 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 8d2a8b367b52..631493a457ee 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -69,29 +69,16 @@ GEM no_proxy_fix octokit (>= 4.0) terminal-table (>= 1, < 4) - danger-dangermattic (1.0.0) + danger-dangermattic (1.0.2) danger (~> 9.4) - danger-junit (~> 1.0) danger-plugin-api (~> 1.0) danger-rubocop (~> 0.12) - danger-swiftlint (~> 0.35) - danger-xcode_summary (~> 1.0) - rubocop (~> 1.60) - danger-junit (1.0.2) - danger (> 2.0) - ox (~> 2.0) + rubocop (~> 1.61) danger-plugin-api (1.0.0) danger (> 2.0) danger-rubocop (0.12.0) danger rubocop (~> 1.0) - danger-swiftlint (0.35.0) - danger - rake (> 10) - thor (~> 1.0.0) - danger-xcode_summary (1.3.0) - danger-plugin-api (~> 1.0) - xcresult (~> 0.2) declarative (0.0.20) diffy (3.4.2) digest-crc (0.6.5) @@ -241,7 +228,7 @@ GEM concurrent-ruby (~> 1.0) java-properties (0.3.0) jmespath (1.6.2) - json (2.7.1) + json (2.7.2) jwt (2.8.0) base64 kramdown (2.4.0) @@ -254,7 +241,7 @@ GEM mini_portile2 (2.8.5) minitest (5.22.2) multi_json (1.15.0) - multipart-post (2.4.0) + multipart-post (2.4.1) mutex_m (0.2.0) nanaimo (0.3.0) nap (1.1.0) @@ -271,23 +258,22 @@ GEM options (2.3.2) optparse (0.4.0) os (1.1.4) - ox (2.14.17) parallel (1.24.0) - parser (3.3.0.5) + parser (3.3.1.0) ast (~> 2.4.1) racc plist (3.7.1) progress_bar (1.3.3) highline (>= 1.6, < 3) options (~> 2.3.0) - public_suffix (5.0.4) + public_suffix (5.0.5) racc (1.7.3) rainbow (3.1.1) - rake (13.1.0) + rake (13.2.1) rake-compiler (1.2.7) rake rchardet (1.8.0) - regexp_parser (2.9.0) + regexp_parser (2.9.1) representable (3.2.0) declarative (< 0.1.0) trailblazer-option (>= 0.1.1, < 0.2.0) @@ -296,7 +282,7 @@ GEM rexml (3.2.6) rmagick (4.3.0) rouge (2.0.7) - rubocop (1.60.2) + rubocop (1.63.5) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -304,11 +290,11 @@ GEM rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.30.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.30.0) - parser (>= 3.2.1.0) + rubocop-ast (1.31.3) + parser (>= 3.3.1.0) ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) rubyzip (2.3.2) @@ -327,7 +313,6 @@ GEM terminal-notifier (2.0.0) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) - thor (1.0.1) trailblazer-option (0.1.2) tty-cursor (0.7.1) tty-screen (0.8.2) @@ -349,7 +334,6 @@ GEM rouge (~> 2.0.7) xcpretty-travis-formatter (1.0.1) xcpretty (~> 0.2, >= 0.0.7) - xcresult (0.2.1) PLATFORMS ruby From 568ab66584d74781f76a9d388a15dfdc2266d8fa Mon Sep 17 00:00:00 2001 From: Ian Maia Date: Mon, 13 May 2024 21:12:42 +0200 Subject: [PATCH 2/2] Configure Danger on Linter Agent --- .buildkite/pipeline.yml | 10 ++++++++++ .github/workflows/run-danger.yml | 16 ++++++++++------ Dangerfile | 3 ++- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 87d96c8032e3..c6c5356e0c4d 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -29,6 +29,16 @@ steps: ################# - group: "🕵️‍♂️ Linters" steps: + - label: "☢️ Danger - PR Check" + command: danger + key: danger + if: "build.pull_request.id != null" + retry: + manual: + permit_on_passed: true + agents: + queue: "linter" + - label: "🕵️ checkstyle" command: | cp gradle.properties-example gradle.properties diff --git a/.github/workflows/run-danger.yml b/.github/workflows/run-danger.yml index 856ab8cea46d..1031d64a7dd9 100644 --- a/.github/workflows/run-danger.yml +++ b/.github/workflows/run-danger.yml @@ -1,13 +1,17 @@ -name: ☢️ Danger +name: ☢️ Trigger Danger On Buildkite on: pull_request: - types: [opened, reopened, ready_for_review, synchronize, edited, labeled, unlabeled, milestoned, demilestoned] + types: [labeled, unlabeled, milestoned, demilestoned] jobs: dangermattic: - # runs on draft PRs only for opened / synchronize events - if: ${{ (github.event.pull_request.draft == false) || (github.event.pull_request.draft == true && contains(fromJSON('["opened", "synchronize"]'), github.event.action)) }} - uses: Automattic/dangermattic/.github/workflows/reusable-run-danger.yml@v1.0.0 + if: ${{ (github.event.pull_request.draft == false) }} + uses: Automattic/dangermattic/.github/workflows/reusable-retry-buildkite-step-on-events.yml@v1.1.0 + with: + org-slug: "automattic" + pipeline-slug: "wordpress-android" + retry-step-key: "danger" + build-commit-sha: "${{ github.event.pull_request.head.sha }}" secrets: - github-token: ${{ secrets.DANGERMATTIC_GITHUB_TOKEN }} + buildkite-api-token: ${{ secrets.TRIGGER_BK_BUILD_TOKEN }} diff --git a/Dangerfile b/Dangerfile index d439496653f9..ef55a1240632 100644 --- a/Dangerfile +++ b/Dangerfile @@ -3,7 +3,8 @@ github.dismiss_out_of_range_messages # `files: []` forces rubocop to scan all files, not just the ones modified in the PR -rubocop.lint(files: [], force_exclusion: true, inline_comment: true, fail_on_inline_comment: true, include_cop_names: true) +# Added a custom `rubocop_cmd` to prevent RuboCop from running using `bundle exec`, which we don't want on the linter agent +rubocop.lint(files: [], force_exclusion: true, inline_comment: true, fail_on_inline_comment: true, include_cop_names: true, rubocop_cmd: ': | rubocop') manifest_pr_checker.check_gemfile_lock_updated