Repository navigation
[rb] generate version.rb from the root version.bzl so tests do not read the version - #18164
Conversation
PR Summary by QodoGenerate Ruby version from the root version file without invalidating tests
AI Description
Diagram
High-Level Assessment
Files changed (10)
|
Code Review by Qodo
1.
|
|
Code review by qodo was updated up to the latest commit 8a2c54a |
…ib/rules_ruby#421 and how to back it out
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit d7b7402 |
|
I'm going to merge this and we can see how it does with next week's release. If we decide not to implement this in rules_ruby, we should revert this PR rather than maintain the patch. |
|
This breaks using the gem as a git source (like |
|
@Earlopain it is already broken as a git source for some features ( |
|
We publish nightly gems you can use, see instructions here: https://github.com/SeleniumHQ/selenium/pkgs/rubygems/selenium-webdriver |
|
Thanks, but currently I'm just reading the source code uri from the gemspec (I'm not specifically testing against selenium). I guess it's better to break early. |
🔗 Related Issues
Builds on #18138 (Java and .NET versions moved to a root
version.bzlthat tests do not read)Equivalent to #18158 for Python
Carries bazel-contrib/rules_ruby#421 as a patch until it is released
💥 What does this PR do?
version.bzlalongside Java and .NET.🔧 Implementation Notes
version.rbis generated fromversion.rb.tpl:--stampbuilds get the real version, unstamped builds get4.999.0.dev, which has to stay within selenium-devtools'~> 4.2requirement or Bundler re-resolves and fails.VERSION_STUBlike Python and .NET because the gemspec readsVERSIONand Bundler requires a validGem::Version.@bundlepreviously copiedversion.rbat fetch time, so every bump reinstalled the bundle; a rules_ruby patch addsgenerated_srcs, which stages build outputs into the bundle and rewrites path gem versions in its copy ofGemfile.lockto match the gemspecs.Gemfile.lockkeeps the real version, and the patch makes it irrelevant whether it matchesversion.bzl, so the nightly date suffix no longer needs a separate bump target.//rb:bundle-lock,//rb:bundle-updateandrb:local_devwrite a gitignoredversion.rbso Bundler still works outside Bazel;generated_srcsnever reads it.version.rbto the current version inversion.bzl, which makesversion.rbthe single source again.🤖 AI assistance
💡 Additional Considerations
generated_srcstorb_bundle_fetchbazel-contrib/rules_ruby#421; merging this first shows it working in Selenium and measures the next release.🔄 Types of changes
4.999.0.devasSelenium::WebDriver::VERSION)