-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[build] Remove git.add() calls from rake tasks #16994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Removes implicit staging (SeleniumRake.git.add) from Rake tasks so task-generated changes remain unstaged, allowing workflows that capture git diff (e.g., git diff --binary) to reliably produce patches.
Changes:
- Removed all
SeleniumRake.git.add(...)calls across Rake tasks (version bumps, pin/update tasks, AUTHORS/CDP updates). - Updated shared changelog update helper to stop auto-staging changelog files.
- Ensured task output is reviewable/stageable by the user (or CI) without relying on the index.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
Rakefile |
Stops auto-staging outputs from top-level update/version-related tasks. |
rake_tasks/common.rb |
Prevents changelog updates from implicitly staging the changelog file. |
rake_tasks/java.rake |
Removes staging from Maven pin/version tasks. |
rake_tasks/node.rake |
Removes staging from pnpm lockfile pin and JS version bump tasks. |
rake_tasks/python.rake |
Removes staging from Python version bump task (including docs config updates). |
rake_tasks/ruby.rake |
Removes staging from Ruby version/pin/update tasks. |
rake_tasks/rust.rake |
Removes staging from Rust version task (including lockfile outputs). |
rake_tasks/dotnet.rake |
Removes staging from .NET version/pin tasks. |
User description
2 clever ideas conflicting.
I've been using explicit git add commands in Rakefiles to ensure only files we cared about were
committed. Then I moved the actual commit logic from rakefiles to CI (better separation of concerns)
Recently we switched to using git diff in our bazel workflow to store a patch that can be used by
calling workflows. Except if you stage a file it's no longer in the diff.
💥 What does this PR do?
Removes all
SeleniumRake.git.add()calls from rake tasks.Files modified by rake tasks are now left unstaged, letting users review and stage changes explicitly.
Removed 36 lines across 8 files:
Rakefile- update_browsers, update_manager, update_multitool, update_cdp, authors, all:versionrake_tasks/java.rake- pin, versionrake_tasks/python.rake- versionrake_tasks/ruby.rake- version, pin, updaterake_tasks/rust.rake- versionrake_tasks/node.rake- pin, versionrake_tasks/dotnet.rake- version, pinrake_tasks/common.rb- update_changelog🔧 Implementation Notes
The only things that I know that can sully the working directory are the version changes we make to python/ruby/node,
but those should be limited to just unit tests so won't matter for these operations.
There are a bunch of ways this could have gone, but I think trying to control which exact files is... excessive at this point.
💡 Additional Considerations
The git gem is still used for read-only operations (listing tags for changelog generation).
🔄 Types of changes
PR Type
Enhancement
Description
Remove all
SeleniumRake.git.add()calls from rake tasksAllow users to explicitly stage modified files
Enable git diff workflow for patch generation
Improve separation of concerns between build and CI
Diagram Walkthrough
File Walkthrough
common.rb
Remove git.add() from changelog updaterake_tasks/common.rb
git.add(changelog)call fromupdate_changelogmethoddotnet.rake
Remove git.add() from .NET tasksrake_tasks/dotnet.rake
SeleniumRake.git.add(file)from version taskgit.add()calls for paket.lock and paket.nuget.bzl in pin taskjava.rake
Remove git.add() from Java tasksrake_tasks/java.rake
git.add()calls for MODULE.bazel and maven_install.json in pintask
git.add(file)from version tasknode.rake
Remove git.add() from Node tasksrake_tasks/node.rake
SeleniumRake.git.add('pnpm-lock.yaml')from pin taskgit.add()calls from version task for package.json andBUILD.bazel
python.rake
Remove git.add() from Python tasksrake_tasks/python.rake
git.add(file)calls from version task for multiple Pythonfiles
git.add(conf)from version task for conf.pyruby.rake
Remove git.add() from Ruby tasksrake_tasks/ruby.rake
git.add(file)from version taskgit.add()calls from pin task for MODULE.bazelgit.add()calls from update task for Gemfile.lock andrbs_collection.lock.yaml
rust.rake
Remove git.add() from Rust tasksrake_tasks/rust.rake
git.add(file)calls from version task for Cargo.toml andBUILD.bazel
git.add()calls for Cargo.Bazel.lock and Cargo.lockRakefile
Remove git.add() from main Rakefile tasksRakefile
git.add('common/repositories.bzl')from update_browsers taskgit.add('common/selenium_manager.bzl')from update_managertask
git.add('multitool.lock.json')from update_multitool taskgit.add()calls from update_cdp task (14 files)git.add('AUTHORS')from authors taskgit.add(file)from all:version task