chore(deps): seed Gemfile.lock for reproducible builds - #408
Conversation
Removes Gemfile.lock from .gitignore files and checks in initial lockfiles generated under Ruby 3.2.11 to ensure reproducible dependency resolution across CI test matrices.
There was a problem hiding this comment.
Code Review
This pull request removes Gemfile.lock from .gitignore and adds a new lockfile to the repository. Feedback on these changes highlights potential issues with dependency resolution in CI. Specifically, locking activerecord to a single version conflicts with CI matrix legs testing other ActiveRecord versions, which could be resolved using a tool like Appraisal. Additionally, the platform-specific definitions for google-protobuf in the lockfile conflict with the force_ruby_platform: true setting used in CI, potentially causing Bundler to fail in frozen mode.
olavloite
left a comment
There was a problem hiding this comment.
Security Violation: PR contains modifications to disallowed files: .gitignore. Automated updates are strictly limited to dependency/configuration files.
|
@olavloite This PR is a manual change to |
|
@olavloite pinged you over chat to align, cc @quartzmo @aandreassa |
Note: This was an automated response. This PR was incorrectly categorized as an automated dependency update. |
8c09b5b to
63913e0
Compare
olavloite
left a comment
There was a problem hiding this comment.
Security Violation: PR contains modifications to disallowed files: .github/workflows/acceptance-tests-on-emulator.yaml (Disallowed line addition in workflow: + ar: ["7.0", "7.1", "7.2", "8.0", "8.1"]), .github/workflows/ci.yaml (Disallowed line addition in workflow: + ar: ["7.0", "7.1", "7.2", "8.0", "8.1"]), .github/workflows/nightly-acceptance-tests-on-emulator.yaml (Disallowed line addition in workflow: + ar: ["7.0", "7.1", "7.2", "8.0", "8.1"]), .github/workflows/nightly-unit-tests.yaml (Disallowed line addition in workflow: + ar: ["7.0", "7.1", "7.2", "8.0", "8.1"]), .github/workflows/samples.yaml (Disallowed line addition in workflow: + ar: ["7.0", "7.1", "7.2", "8.0"]), .gitignore, .rubocop.yml, Appraisals, gemfiles/7.0.gemfile, gemfiles/7.0.gemfile.lock, gemfiles/7.1.gemfile, gemfiles/7.1.gemfile.lock, gemfiles/7.2.gemfile, gemfiles/7.2.gemfile.lock, gemfiles/8.0.gemfile, gemfiles/8.0.gemfile.lock, gemfiles/8.1.gemfile, gemfiles/8.1.gemfile.lock. Automated updates are strictly limited to dependency/configuration files.
…ing back to Base.connection In ActiveRecord 7.0.x, ActiveRecord::QueryLogs does not pass the :connection key inside the context hash (which was added in ActiveRecord 7.1.0). When running the query-logs snippet against ActiveRecord 7.0.x, calling context[:connection].pool crashed with NoMethodError (undefined method `pool' for nil:NilClass). This commit adds a fallback to `ActiveRecord::Base.connection` when `context[:connection]` is nil, restoring full compatibility across ActiveRecord 7.0, 7.1, 7.2, 8.0, and 8.1.
olavloite
left a comment
There was a problem hiding this comment.
Security Violation: PR contains modifications to disallowed files: .github/workflows/acceptance-tests-on-emulator.yaml (Disallowed line addition in workflow: + ar: ["7.0", "7.1", "7.2", "8.0", "8.1"]), .github/workflows/ci.yaml (Disallowed line addition in workflow: + ar: ["7.0", "7.1", "7.2", "8.0", "8.1"]), .github/workflows/nightly-acceptance-tests-on-emulator.yaml (Disallowed line addition in workflow: + ar: ["7.0", "7.1", "7.2", "8.0", "8.1"]), .github/workflows/nightly-unit-tests.yaml (Disallowed line addition in workflow: + ar: ["7.0", "7.1", "7.2", "8.0", "8.1"]), .github/workflows/samples.yaml (Disallowed line addition in workflow: + ar: ["7.0", "7.1", "7.2", "8.0"]), .gitignore, .rubocop.yml, Appraisals, examples/snippets/query-logs/application.rb, gemfiles/7.0.gemfile, gemfiles/7.0.gemfile.lock, gemfiles/7.1.gemfile, gemfiles/7.1.gemfile.lock, gemfiles/7.2.gemfile, gemfiles/7.2.gemfile.lock, gemfiles/8.0.gemfile, gemfiles/8.0.gemfile.lock, gemfiles/8.1.gemfile, gemfiles/8.1.gemfile.lock. Automated updates are strictly limited to dependency/configuration files.
…iltering In commit 63913e0 (deps: add appraisal), .github/workflows/samples.yaml was updated to use BUNDLE_GEMFILE for matrix appraisal gemfiles, but AR_VERSION was removed from the workflow environment. Without AR_VERSION in the environment, ENV.fetch("AR_VERSION", "~> 7.1.0") in examples/snippets/Rakefile defaulted to "~> 7.1.0". As a result, less_than_7_1 evaluated to false even when testing ActiveRecord 7.0.x (gemfiles/7.0.gemfile), causing rake all to run ActiveRecord 7.1+ snippets (auto-generated-primary-key, bit-reversed-sequence, interleaved-tables) on 7.0 and fail with: ArgumentError: Unknown migration version "7.1". This commit replaces the ENV["AR_VERSION"] check with a direct inspection of the loaded ActiveRecord.version (< Gem::Version.new("7.1.0")), ensuring sample filtering is always deterministic regardless of environment variables.
olavloite
left a comment
There was a problem hiding this comment.
Security Violation: PR contains modifications to disallowed files: .github/workflows/acceptance-tests-on-emulator.yaml (Disallowed line addition in workflow: + ar: ["7.0", "7.1", "7.2", "8.0", "8.1"]), .github/workflows/ci.yaml (Disallowed line addition in workflow: + ar: ["7.0", "7.1", "7.2", "8.0", "8.1"]), .github/workflows/nightly-acceptance-tests-on-emulator.yaml (Disallowed line addition in workflow: + ar: ["7.0", "7.1", "7.2", "8.0", "8.1"]), .github/workflows/nightly-unit-tests.yaml (Disallowed line addition in workflow: + ar: ["7.0", "7.1", "7.2", "8.0", "8.1"]), .github/workflows/samples.yaml (Disallowed line addition in workflow: + ar: ["7.0", "7.1", "7.2", "8.0"]), .gitignore, .rubocop.yml, Appraisals, examples/snippets/Rakefile, examples/snippets/query-logs/application.rb, gemfiles/7.0.gemfile, gemfiles/7.0.gemfile.lock, gemfiles/7.1.gemfile, gemfiles/7.1.gemfile.lock, gemfiles/7.2.gemfile, gemfiles/7.2.gemfile.lock, gemfiles/8.0.gemfile, gemfiles/8.0.gemfile.lock, gemfiles/8.1.gemfile, gemfiles/8.1.gemfile.lock. Automated updates are strictly limited to dependency/configuration files.
|
@torreypayne please look into minimizing the diff here. It looks like there are a bunch of functional changes when it shouldn't be |
They are not directly functional changes. None of the production code that is shipped to users is modified. This library supports multiple versions of ActiveRecord. If we want our CI build to execute against a reproducible set of dependencies, then we need to set that up for every ActiveRecord version that we want to support, and generate gemfiles and lock files for those, and also update the test scripts that execute the tests. In addition, this change surfaced a bug in one of the samples in the repository. This bug is also fixed as part of this pull request. |
Removes Gemfile.lock from .gitignore files and checks in initial lockfiles generated under Ruby 3.2.11 to ensure reproducible dependency resolution across CI test matrices.
This is a continuation of the effort to address b/509981628
closes: b/509981628