Skip to content

[build] upgrade rules_ruby to 0.28.0 and drop vendored Bazel::Runfiles workaround#17824

Merged
titusfortner merged 1 commit into
SeleniumHQ:trunkfrom
titusfortner:rules-ruby-0.28-upgrade
Jul 26, 2026
Merged

[build] upgrade rules_ruby to 0.28.0 and drop vendored Bazel::Runfiles workaround#17824
titusfortner merged 1 commit into
SeleniumHQ:trunkfrom
titusfortner:rules-ruby-0.28-upgrade

Conversation

@titusfortner

Copy link
Copy Markdown
Member

🔗 Related Issues

💥 What does this PR do?

  • Upgrades rules_ruby from 0.26.0 to 0.28.0.
  • Ruby's runfiles resolution (Bazel::Runfiles) now comes from the upstream @rules_ruby//ruby/runfiles library instead of a copy vendored in this repo.

🔧 Implementation Notes

  • 0.28.0 ships the Bazel::Runfiles helper (rules_ruby#374), so the vendored rb/lib/bazel/runfiles.rb and its ensure_runfiles_on_load_path load-path shim in generated_note.rb are removed; the upstream rb_library sets its own lib root, so require 'bazel/runfiles' resolves directly.
  • The require path (bazel/runfiles) and class (Bazel::Runfiles) are identical to the vendored copy, so consumers (generated_note, integration test_environment) only needed their Bazel dep swapped to @rules_ruby//ruby/runfiles.
  • Verified both Ruby generators still produce identical output through the new runfiles path: verify-bidi-generated passes, and the cdp generator re-runs and emits its runfiles-resolved generated-file marker.

🤖 AI assistance

  • No substantial AI assistance used
  • AI assisted (complete below)
    • Tool(s): Claude Code
    • What was generated: the dependency bump and workaround removal
    • I reviewed all AI output and can explain the change

💡 Additional Considerations

🔄 Types of changes

  • Cleanup (formatting, renaming)

@selenium-ci selenium-ci added C-rb Ruby Bindings B-build Includes scripting, bazel and CI integrations B-support Issue or PR related to support classes labels Jul 26, 2026
@selenium-ci

Copy link
Copy Markdown
Member

Thank you, @titusfortner for this code suggestion.

The support packages contain example code that many users find helpful, but they do not necessarily represent
the best practices for using Selenium, and the Selenium team is not currently merging changes to them.

After reviewing the change, unless it is a critical fix or a feature that is needed for Selenium
to work, we will likely close the PR.

We actively encourage people to add the wrapper and helper code that makes sense for them to their own frameworks.
If you have any questions, please contact us

@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Upgrade rules_ruby to 0.28.0 and use upstream Bazel::Runfiles

⚙️ Configuration changes ✨ Enhancement 🕐 20-40 Minutes

Grey Divider

AI Description

• Bump rules_ruby to 0.28.0 via MODULE.bazel.
• Switch Ruby Bazel targets to depend on upstream @rules_ruby//ruby/runfiles.
• Remove vendored Bazel::Runfiles shim and related Steep ignore entries.
Diagram

graph TD
  A["MODULE.bazel"] --> B{{"rules_ruby 0.28.0"}}
  C["rb/support/generated_note.rb"] --> D{{"@rules_ruby//ruby/runfiles"}} --> E["Bazel::Runfiles"]
  F["rb/spec/integration/.../BUILD.bazel"] --> D
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Keep vendored Bazel::Runfiles as fallback
  • ➕ More resilient to future upstream behavior changes or regressions
  • ➕ Easier to temporarily pin/rollback rules_ruby without breaking require paths
  • ➖ Ongoing maintenance burden and risk of diverging from upstream semantics
  • ➖ More complicated dependency graph and load-path behavior
2. Wrap runfiles behind a local adapter module
  • ➕ Centralizes the dependency and gives a stable internal API for consumers
  • ➕ Allows future swaps (upstream vs custom) with minimal churn
  • ➖ Adds an extra indirection layer for a now-stable upstream API
  • ➖ Not necessary if Bazel::Runfiles API remains consistent

Recommendation: Proceed with the PR’s approach: upgrading rules_ruby and removing the vendored Runfiles copy reduces maintenance and aligns with upstream-provided functionality. A fallback/adapter is only worthwhile if you expect frequent rules_ruby pinning/rollback or anticipate upstream runfiles API churn; given the identical require path/class name, the direct dependency swap is the simplest, lowest-maintenance option.

Files changed (5) +3 / -16

Enhancement (1) +0 / -11
generated_note.rbRemove load-path shim for vendored Bazel::Runfiles +0/-11

Remove load-path shim for vendored Bazel::Runfiles

• Deletes the custom ensure_runfiles_on_load_path shim used to locate the vendored runfiles implementation. The code now relies on requiring 'bazel/runfiles' from the upstream rules_ruby-provided library.

rb/support/generated_note.rb

Other (4) +3 / -5
MODULE.bazelBump rules_ruby from 0.26.0 to 0.28.0 +1/-1

Bump rules_ruby from 0.26.0 to 0.28.0

• Updates the Bzlmod dependency for rules_ruby to 0.28.0. This enables using the upstream Bazel::Runfiles helper shipped by rules_ruby.

MODULE.bazel

SteepfileStop ignoring vendored bazel runfiles sources +0/-2

Stop ignoring vendored bazel runfiles sources

• Removes the ignore pattern for the previously-vendored Bazel::Runfiles Ruby sources. This matches the deletion of the local runfiles implementation in favor of upstream.

rb/Steepfile

BUILD.bazelSwap integration deps to @rules_ruby//ruby/runfiles +1/-1

Swap integration deps to @rules_ruby//ruby/runfiles

• Removes the dependency on the repo’s vendored //rb/lib/bazel:runfiles target. Adds a direct dependency on the upstream @rules_ruby//ruby/runfiles library.

rb/spec/integration/selenium/webdriver/BUILD.bazel

BUILD.bazelPoint generated_note rb_library at upstream runfiles +1/-1

Point generated_note rb_library at upstream runfiles

• Changes the generated_note build target to depend on @rules_ruby//ruby/runfiles. This eliminates the need for a local runfiles package dependency.

rb/support/BUILD.bazel

@qodo-code-review

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Qodo Logo

@titusfortner
titusfortner merged commit 8bd635e into SeleniumHQ:trunk Jul 26, 2026
94 of 96 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B-build Includes scripting, bazel and CI integrations B-support Issue or PR related to support classes C-rb Ruby Bindings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants