Skip to content

chore(deps): automate Gemfile.lock maintenance (phase 1)#34666

Merged
torreypayne merged 8 commits into
mainfrom
chore/automate-gemfile-locks-phase-1
Jul 6, 2026
Merged

chore(deps): automate Gemfile.lock maintenance (phase 1)#34666
torreypayne merged 8 commits into
mainfrom
chore/automate-gemfile-locks-phase-1

Conversation

@torreypayne

Copy link
Copy Markdown
Member

Overview

This PR implements Phase 1 of the organization-wide compliance initiative to generate and maintain deterministic Gemfile.lock files across Ruby client libraries (resolving b/509981628).

For the full architectural strategy, throughput analysis, and multi-phase rollout cadence, please see the proposal document in Google Drive:
📄 Scale & Automate Dependency Security across Ruby Repositories (P1 Compliance)


Phase 1 Scope & Changes

Rather than attempting to generate and maintain ~880 lockfiles across google-cloud-ruby in a single unmanageable PR, this PR establishes a hybrid automation architecture rolling out in manageable weekly batches:

  1. Renovate Lockfile Maintenance (.github/renovate.json):

    • Enables weekly scheduled bundle lock --update runs (before 5am on monday).
    • Enforces Conventional Commits (chore(deps): maintain Gemfile.lock files) in compliance with Ruby Cloud SDK team versioning rules.
    • Scopes Phase 1 maintenance exclusively to core handwritten gems:
      • google-cloud-core
      • google-cloud-storage
      • google-cloud-pubsub
      • google-cloud-spanner
      • google-cloud-bigquery
      • google-cloud-errors
  2. Batch Generation Workflow (.github/workflows/generate-lockfiles.yml):

    • Adds a matrix sharding workflow to generate initial Gemfile.lock files in parallel batches without exceeding hosted runner container timeout limits.

Rollout Cadence

  • Phase 1 (This PR): Core & Handwritten Gems (~20 gems)
  • Phase 2 (Week 2): Generated Gems (google-cloud-[a-d]*)
  • Phase 3 (Week 3): Generated Gems (google-cloud-[e-o]*)
  • Phase 4 (Week 4): Generated Gems (google-cloud-[p-z]*)

Reviewed and coordinated with @andreassa as part of the multi-phase compliance rollout.

@torreypayne torreypayne marked this pull request as ready for review June 25, 2026 20:34
@torreypayne torreypayne requested review from a team and yoshi-approver as code owners June 25, 2026 20:34

@suztomo suztomo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you familiarize yourself with this zizmor tool? go/github-zizmor-help?polyglot=github-com#local-scans-run-zizmor-on-your-cloudtop It tells fixes for GitHub actions.

Comment thread .github/workflows/generate-lockfiles.yml Outdated
@torreypayne

Copy link
Copy Markdown
Member Author

Would you familiarize yourself with this zizmor tool? go/github-zizmor-help?polyglot=github-com#local-scans-run-zizmor-on-your-cloudtop It tells fixes for GitHub actions.

Installed, ran, and fixes applied! Thanks for introducing me to the tool 👍🏿

yoshi-automation and others added 2 commits June 25, 2026 22:09
…get list

Remove Gemfile.lock from root and Phase 1 gem .gitignore files so lockfiles can be tracked.

Remove google-cloud-spanner from Phase 1 target matrix in generate-lockfiles.yml and renovate.json as it is hosted in ruby-spanner.
@torreypayne torreypayne requested a review from a team as a code owner June 30, 2026 18:24
Comment thread .gitignore
Comment thread .github/workflows/generate-lockfiles.yml Outdated
Restore Gemfile.lock in root .gitignore and use explicit !Gemfile.lock negation rules in Phase 1 libraries per reviewer recommendation.

Remove third-party write action (generate-lockfiles.yml) to eliminate software supply chain risk in GitHub Actions runners.

Check in initial Gemfile.lock files directly for Phase 1 libraries (google-cloud-core, google-cloud-storage, google-cloud-pubsub, google-cloud-bigquery, google-cloud-errors).
Update renovate.json syntax to use modern config:recommended and managerFilePatterns to restrict file scanning to the 5 Phase 1 libraries.
…raries

Add negation matching rules (!google-cloud-core/**, etc.) with enabled: false to packageRules in renovate.json. This ensures that while Renovate discovers all Gemfiles during initial repository extraction, all 881 non-Phase 1 libraries are completely disabled and dropped from update evaluation.
@torreypayne torreypayne added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Jul 1, 2026
@torreypayne

Copy link
Copy Markdown
Member Author

Will merge after holidays

@quartzmo quartzmo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executed the Renovate CLI against the local filesystem in lookup mode (which parses configuration files and simulates dep lookup without repository writes):

npx -y renovate --platform=local --dry-run=lookup

The only generated diff was the standard Bundler metadata lines updating from 4.0.14 (the version @torreypayne used to commit the lockfiles) to 4.0.10 (the active Bundler version on my local environment):
diff BUNDLED WITH - 4.0.14 + 4.0.10
This confirms that the Gemfile.lock files in this PR are in sync with current dependency releases.

@torreypayne torreypayne removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Jul 6, 2026
@torreypayne

Copy link
Copy Markdown
Member Author

@aandreassa @quartzmo the conformance tests seem to be flaky/broken (see: https://github.com/googleapis/google-cloud-ruby/actions/runs/27684540736/job/81879963991 and the associated PR #34619)

I'm going to merge since the errors are unrelated to my PR, and I'm going to fix as a fast-follow and track as a separate issue

@aandreassa

Copy link
Copy Markdown
Contributor

Errors seem unrelated, so LGTM.

Please consider how we want to integrate changes from #34678 into this as well! (As a quick diff, the new file is .json5). We should try to get that other change in this week

@torreypayne torreypayne merged commit a35f254 into main Jul 6, 2026
27 of 31 checks passed
@torreypayne torreypayne deleted the chore/automate-gemfile-locks-phase-1 branch July 6, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants