Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
A new version of RuboCop was released, and broke our CI.

We generally want to proactively update RuboCop, and not have to react
to it breaking our CI. So I'd rather keep the version we run locked.

To keep it locked, we have to use the `updater/Gemfile`, since that's
the one that includes a lockfile.

To do that we configure `BUNDLE_GEMFILE` in CI to use that.

I decided to also add a rubocop binstub to make it easier to run rubocop
either outside (like CI does) or inside our development image.
  • Loading branch information
deivid-rodriguez committed Sep 28, 2023
1 parent a4e8046 commit f368cf1
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ jobs:
lint:
name: Lint
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: updater/Gemfile
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
Expand Down
2 changes: 1 addition & 1 deletion bin/lint
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ shellcheck \
./updater/bin/run \
"$@"

bundle exec rubocop
bin/rubocop
11 changes: 11 additions & 0 deletions bin/rubocop
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

updater_image_gemfile = File.expand_path("../dependabot-updater/Gemfile", __dir__)
updater_repo_gemfile = File.expand_path("../updater/Gemfile", __dir__)

ENV["BUNDLE_GEMFILE"] ||= File.exist?(updater_image_gemfile) ? updater_image_gemfile : updater_repo_gemfile

require "bundler/setup"

load Gem.bin_path("rubocop", "rubocop")
1 change: 1 addition & 0 deletions updater/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ group :test do
rspec
rubocop
rubocop-performance
rubocop-sorbet
vcr
webmock
)
Expand Down
3 changes: 3 additions & 0 deletions updater/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ GEM
rubocop-performance (1.19.0)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-sorbet (0.7.4)
rubocop (>= 0.90.0)
ruby-progressbar (1.13.0)
ruby-xxHash (0.4.0.2)
ruby2_keywords (0.0.5)
Expand Down Expand Up @@ -330,6 +332,7 @@ DEPENDENCIES
rspec (~> 3.12)
rubocop (~> 1.56.0)
rubocop-performance (~> 1.19.0)
rubocop-sorbet (~> 0.7.3)
sentry-raven (~> 3.1)
terminal-table (~> 3.0.2)
vcr (~> 6.1)
Expand Down

0 comments on commit f368cf1

Please sign in to comment.