diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index dccdfdef..7a10adc8 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -18,6 +18,16 @@ steps: echo "--- 🛠 Linting" make lint + - label: ☢️ Danger - PR Check + command: danger + key: danger + if: build.pull_request.id != null + retry: + manual: + permit_on_passed: true + agents: + queue: linter + ################# # Build and Test ################# diff --git a/.github/workflows/run-danger.yml b/.github/workflows/run-danger.yml new file mode 100644 index 00000000..f53a6982 --- /dev/null +++ b/.github/workflows/run-danger.yml @@ -0,0 +1,17 @@ +name: ☢️ Trigger Danger On Buildkite + +on: + pull_request: + types: [labeled, unlabeled, milestoned, demilestoned, ready_for_review] + +jobs: + dangermattic: + if: ${{ (github.event.pull_request.draft == false) }} + uses: Automattic/dangermattic/.github/workflows/reusable-retry-buildkite-step-on-events.yml@v1.1.2.1 + with: + org-slug: automattic + pipeline-slug: gravatar-sdk-ios + retry-step-key: danger + build-commit-sha: ${{ github.event.pull_request.head.sha }} + secrets: + buildkite-api-token: ${{ secrets.TRIGGER_BK_BUILD_TOKEN }} diff --git a/Dangerfile b/Dangerfile new file mode 100644 index 00000000..d8e1dd6a --- /dev/null +++ b/Dangerfile @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +github.dismiss_out_of_range_messages + +# `files: []` forces rubocop to scan all files, not just the ones modified in the PR +# `skip_bundle_exec` prevents 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, skip_bundle_exec: true) + +manifest_pr_checker.check_gemfile_lock_updated + +labels_checker.check( + do_not_merge_labels: ['do not merge'], +) diff --git a/Gemfile b/Gemfile index f8831430..20075773 100644 --- a/Gemfile +++ b/Gemfile @@ -3,6 +3,7 @@ source 'https://rubygems.org' gem 'cocoapods', '~> 1.14.3' +gem 'danger-dangermattic', '~> 1.1' gem 'fastlane', '~> 2.222' gem 'fastlane-plugin-appcenter', '~> 2.1' gem 'fastlane-plugin-wpmreleasetoolkit', '~> 12.0' diff --git a/Gemfile.lock b/Gemfile.lock index 03ecd0a1..f6a60e70 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -5,7 +5,7 @@ GEM base64 nkf rexml - activesupport (7.2.1) + activesupport (7.2.1.2) base64 bigdecimal concurrent-ruby (~> 1.0, >= 1.3.1) @@ -25,20 +25,20 @@ GEM ast (2.4.2) atomos (0.1.3) aws-eventstream (1.3.0) - aws-partitions (1.989.0) - aws-sdk-core (3.209.1) + aws-partitions (1.995.0) + aws-sdk-core (3.211.0) aws-eventstream (~> 1, >= 1.3.0) - aws-partitions (~> 1, >= 1.651.0) + aws-partitions (~> 1, >= 1.992.0) aws-sigv4 (~> 1.9) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.94.0) - aws-sdk-core (~> 3, >= 3.207.0) + aws-sdk-kms (1.95.0) + aws-sdk-core (~> 3, >= 3.210.0) aws-sigv4 (~> 1.5) - aws-sdk-s3 (1.167.0) - aws-sdk-core (~> 3, >= 3.207.0) + aws-sdk-s3 (1.169.0) + aws-sdk-core (~> 3, >= 3.210.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.5) - aws-sigv4 (1.10.0) + aws-sigv4 (1.10.1) aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.4) base64 (0.2.0) @@ -47,6 +47,10 @@ GEM sawyer (>= 0.6) chroma (0.2.0) claide (1.1.0) + claide-plugins (0.9.2) + cork + nap + open4 (~> 1.3) cocoapods (1.14.3) addressable (~> 2.8) claide (>= 1.0.2, < 2.0) @@ -90,8 +94,34 @@ GEM highline (~> 2.0.0) concurrent-ruby (1.3.4) connection_pool (2.4.1) + cork (0.3.0) + colored2 (~> 3.1) + danger (9.5.1) + base64 (~> 0.2) + claide (~> 1.0) + claide-plugins (>= 0.9.2) + colored2 (~> 3.1) + cork (~> 0.1) + faraday (>= 0.9.0, < 3.0) + faraday-http-cache (~> 2.0) + git (~> 1.13) + kramdown (~> 2.3) + kramdown-parser-gfm (~> 1.0) + octokit (>= 4.0) + pstore (~> 0.1) + terminal-table (>= 1, < 4) + danger-dangermattic (1.1.2) + danger (~> 9.4) + danger-plugin-api (~> 1.0) + danger-rubocop (~> 0.13) + rubocop (~> 1.63) + danger-plugin-api (1.0.0) + danger (> 2.0) + danger-rubocop (0.13.0) + danger + rubocop (~> 1.0) declarative (0.0.20) - diffy (3.4.2) + diffy (3.4.3) digest-crc (0.6.5) rake (>= 12.0.0, < 14.0.0) domain_name (0.6.20240107) @@ -120,6 +150,8 @@ GEM faraday-em_http (1.0.0) faraday-em_synchrony (1.0.0) faraday-excon (1.1.0) + faraday-http-cache (2.5.1) + faraday (>= 0.8) faraday-httpclient (1.0.1) faraday-multipart (1.0.4) multipart-post (~> 2) @@ -131,7 +163,7 @@ GEM faraday_middleware (1.2.1) faraday (~> 1.0) fastimage (2.3.1) - fastlane (2.224.0) + fastlane (2.225.0) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.8, < 3.0.0) artifactory (~> 3.0) @@ -147,6 +179,7 @@ GEM faraday-cookie_jar (~> 0.0.6) faraday_middleware (~> 1.0) fastimage (>= 2.1.0, < 3.0.0) + fastlane-sirp (>= 1.0.0) gh_inspector (>= 1.1.2, < 2.0.0) google-apis-androidpublisher_v3 (~> 0.3) google-apis-playcustomapp_v1 (~> 0.1) @@ -173,7 +206,7 @@ GEM xcpretty (~> 0.3.0) xcpretty-travis-formatter (>= 0.0.3, < 2.0.0) fastlane-plugin-appcenter (2.1.2) - fastlane-plugin-wpmreleasetoolkit (12.2.0) + fastlane-plugin-wpmreleasetoolkit (12.2.1) activesupport (>= 6.1.7.1) buildkit (~> 1.5) chroma (= 0.2.0) @@ -190,7 +223,10 @@ GEM rake (>= 12.3, < 14.0) rake-compiler (~> 1.0) xcodeproj (~> 1.22) - ffi (1.16.3) + fastlane-sirp (1.0.0) + sysrandom (~> 1.0) + ffi (1.17.0) + ffi (1.17.0-arm64-darwin) fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) @@ -241,9 +277,13 @@ GEM concurrent-ruby (~> 1.0) java-properties (0.3.0) jmespath (1.6.2) - json (2.7.2) + json (2.7.4) jwt (2.9.3) base64 + kramdown (2.4.0) + rexml + kramdown-parser-gfm (1.1.0) + kramdown (~> 2.0) language_server-protocol (3.17.0.3) logger (1.6.1) mini_magick (4.13.2) @@ -266,17 +306,19 @@ GEM octokit (6.1.1) faraday (>= 1, < 3) sawyer (~> 0.9) + open4 (1.3.4) options (2.3.2) optparse (0.5.0) os (1.1.4) parallel (1.26.3) - parser (3.3.4.0) + parser (3.3.5.0) ast (~> 2.4.1) racc plist (3.7.1) progress_bar (1.3.4) highline (>= 1.6) options (~> 2.3.0) + pstore (0.1.3) public_suffix (4.0.7) racc (1.8.1) rainbow (3.1.1) @@ -290,20 +332,19 @@ GEM trailblazer-option (>= 0.1.1, < 0.2.0) uber (< 0.2.0) retriable (3.1.2) - rexml (3.3.8) + rexml (3.3.9) rouge (2.0.7) - rubocop (1.65.0) + rubocop (1.67.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.4, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.31.1, < 2.0) + rubocop-ast (>= 1.32.2, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.31.3) + rubocop-ast (1.32.3) parser (>= 3.3.1.0) ruby-macho (2.5.1) ruby-progressbar (1.13.0) @@ -322,6 +363,7 @@ GEM simctl (1.6.10) CFPropertyList naturally + sysrandom (1.0.5) terminal-notifier (2.0.0) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) @@ -355,10 +397,11 @@ PLATFORMS DEPENDENCIES cocoapods (~> 1.14.3) + danger-dangermattic (~> 1.1) fastlane (~> 2.222) fastlane-plugin-appcenter (~> 2.1) fastlane-plugin-wpmreleasetoolkit (~> 12.0) rubocop (~> 1.65) BUNDLED WITH - 2.5.4 + 2.5.20