You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update to #16736, which used --pin_browsers flag to determine whether to compile selenium manager
💥 What does this PR do?
Reduces how often Selenium Manager is compiled in PR jobs (only when rust code has changed)
Ensures Selenium Manager download pin is kept up to date with trunk instead of previous release
🔧 Implementation Notes
Replaces --pin_browsers as the compilation flag with --//common:manager, a string flag with download (default) and host values; --pin_browsers=false on its own now downloads the pinned binary
CI compiles the manager only in Python and Ruby jobs that test Selenium Manager and only when a PR or push touches rust/
bazel:affected_targets reports whether rust/ changed alongside the target list, and the two jobs add --manager=host to their bazel test command from a workflow input
SM pin is updated every time a new set of binaries is published to selenium_manager_artifacts from trunk branch. This ensures that tests are always run on the current Selenium Manager code.
The bump lands through commit-changes.yml with the CI bot, like the release mirror, and only for trunk snapshots, so the release flow's call on a release branch keeps bumping the pin itself; a failure anywhere in the trunk snapshot chain posts to Slack, since a rejected push would otherwise go unnoticed
🤖 AI assistance
AI assisted (complete below)
Tool(s): Claude Code (Claude Fable 5.1)
What was generated: analysis of the existing wiring, the flag and CI changes, the snapshot bump job, and this description
I reviewed all AI output and can explain the change
💡 Additional Considerations
The first automated pin commit lands on trunk after the next rust/ merge
--//common:manager=all is reserved for cross-compiled release builds once those exist
🔄 Types of changes
Cleanup (build and CI wiring; published packages are unaffected)
• Decouples Selenium Manager source compilation from browser pinning with a dedicated Bazel flag.
• Compiles Manager in Python and Ruby CI only when rust/ files change.
• Refreshes trunk’s pinned Manager binary after snapshots and alerts on update failures.
Diagram
graph TD
A["Changed Files"] --> B{"rust/ changed?"} -->|Yes| C["Python Ruby CI"] --> D["Manager Alias"] -->|Compile| E["Source Build"]
B -->|No| C
D -->|Default| F["Pinned Binary"]
G["Snapshot Publish"] --> H["Trunk Pin Commit"] --> F
Loading
High-Level Assessment
The dedicated --compile_manager flag is the appropriate approach because Manager compilation and browser pinning are independent concerns. Keeping the old coupling would preserve unnecessary builds, while always compiling would defeat the CI optimization; propagating the existing affected-file result avoids duplicating path-filter logic across workflows.
Files changed (10) +109 / -11
Refactor (1) +8 / -8
BUILD.bazelDefault Manager aliases to pinned binaries+8/-8
Default Manager aliases to pinned binaries
• Changes each platform alias to select the Rust-built Manager only under 'manager_from_source'. All other builds now download the pinned binary independently of 'pin_browsers'.
ci-ruby.ymlConditionally compile Manager in Ruby integration tests+11/-0
Conditionally compile Manager in Ruby integration tests
• Adds reusable and manual workflow inputs for Manager compilation. Ruby Manager tests conditionally enable the new Bazel flag while retaining pinned-binary behavior by default.
ci.ymlPropagate Rust-change detection into binding workflows+11/-1
Propagate Rust-change detection into binding workflows
• Carries 'compile-manager.txt' through the affected-target artifact and exposes it as a job output. Python and Ruby reusable workflows receive the resulting boolean input.
sm-snapshot.ymlCommit each trunk snapshot pin automatically+46/-0
Commit each trunk snapshot pin automatically
• After publishing trunk snapshots, runs the Manager pin updater and commits its patch to trunk through the CI bot. Adds Slack notification when the trunk pin update or commit fails, while leaving release-branch pinning unchanged.
1. Rust changes can bypass manager tests✓ Resolved🐞 Bug≡ Correctness
Description
read-targets enables compilation only when compile-manager.txt contains true, but the run-all
branch writes only bazel-targets.txt and never invokes the rake code that creates the new flag
file. Release-preparation pull requests, reusable CI calls, and manually dispatched runs take that
branch, so Rust changes in those runs reach the Python and Ruby manager tests using the downloaded
binary instead of the changed source.
+ if [ "$(cat compile-manager.txt 2>/dev/null)" = "true" ]; then+ echo "compile-manager=true" >> "$GITHUB_OUTPUT"+ fi
Evidence
The run-all branch bypasses bazel:affected_targets, while that rake task is the only producer of
compile-manager.txt; the newly added reader therefore defaults compilation off on those paths.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
Run-all CI paths do not create `compile-manager.txt`, so Rust changes can be tested against the downloaded Selenium Manager rather than the changed source.
## Fix Focus Areas
- .github/workflows/ci.yml[38-63]
- .github/workflows/ci.yml[89-92]
- rake_tasks/bazel.rake[66-68]
## Recommended Fix
Ensure every check-targets path writes `compile-manager.txt`. For run-all pull-request or reusable-workflow paths, compute whether the relevant commit range changes `rust/`; write `true` when it does and `false` otherwise before uploading the artifact.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
2. Manual pin updates use another branch✓ Resolved📘 Rule violation☼ Reliability
Description
update-pin calls bazel.yml without passing its ref input, and no focused workflow test covers
the newly added manual-dispatch path. When a dispatch requests inputs.branch == 'trunk' from a
different selected ref, the snapshot jobs publish trunk binaries while this job creates a patch from
that other checkout and commit-pin then applies it to trunk.
Compliance rule 5 requires focused coverage for changed behavior. The snapshot build checks out
inputs.branch, but the added update-pin call omits the reusable Bazel workflow's ref, whose
checkout consequently defaults to github.ref; the resulting patch is then explicitly committed to
trunk.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The new manual pin-update path does not forward the requested branch to the reusable Bazel workflow, so a dispatch initiated from another ref can generate a patch from the wrong checkout. This path also lacks focused regression coverage.
## Fix Focus Areas
- .github/workflows/sm-snapshot.yml[327-350]
## Recommended Fix
Pass `ref: trunk` to the `update-pin` invocation, matching the condition that restricts this job to trunk snapshots and the branch used by `commit-pin`. Add a focused workflow validation that confirms manual trunk snapshots generate and apply the pin patch from the trunk checkout regardless of the dispatch ref.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
3. Failed pin generation can reach trunk✗ Dismissed🐞 Bug☼ Reliability
Description
update-pin runs ./go update_manager through a reusable step that pipes the command to tee
without pipefail, making the step successful when the generator exits nonzero. If the generator
leaves any changed pin content before failing, the unconditional artifact capture passes that patch
to commit-pin, which applies and pushes it to trunk instead of activating the failure path.
The new update job depends directly on a runner whose pipeline masks the invoked command's status,
while later steps always save the working-tree diff and the commit workflow pushes any nonempty
patch.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The reusable Bazel runner masks `update_manager` failures because its pipeline returns `tee`'s status, allowing output from a failed pin generation to be committed.
## Fix Focus Areas
- .github/workflows/sm-snapshot.yml[327-350]
- .github/workflows/bazel.yml[264-272]
## Recommended Fix
Enable `set -o pipefail` before executing the reusable runner's command and ensure mutation artifacts are uploaded for committing only after the command succeeds. Preserve any separate failed-log collection behavior without allowing a failed generator's patch to enter `commit-pin`.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Review mode: ⚖️ Balanced: Downgraded extended -> standard: change is below the extended eligibility bar (hunks 26/18, lines 186/200; both must reach the floor). Router rationale: This push changes multiple independent CI workflow paths, Bazel selection logic, test-suite composition, and automated pin-update/commit handling, creating several plausible easy-to-miss defects.
Tip of the day
💡 Did you know, you can hide the parts of a finding you never read, like the evidence or the agent prompt
titusfortner
changed the title
[build] compile Selenium Manager only when rust/ changes and keep the pin on trunk
[build] only compile Selenium Manager when necessary and keep download pin updated with trunk
Sep 12, 2026
titusfortner
changed the title
[build] only compile Selenium Manager when necessary and keep download pin updated with trunk
[build] always use the latest Selenium Manager code when needed for tests
Sep 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
B-buildIncludes scripting, bazel and CI integrationsB-managerSelenium ManagerC-rustRust code is mostly Selenium Manager
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Related Issues
Update to #16736, which used
--pin_browsersflag to determine whether to compile selenium manager💥 What does this PR do?
🔧 Implementation Notes
--pin_browsersas the compilation flag with--//common:manager, a string flag withdownload(default) andhostvalues;--pin_browsers=falseon its own now downloads the pinned binaryrust/bazel:affected_targetsreports whetherrust/changed alongside the target list, and the two jobs add--manager=hostto theirbazel testcommand from a workflow inputcommit-changes.ymlwith the CI bot, like the release mirror, and only for trunk snapshots, so the release flow's call on a release branch keeps bumping the pin itself; a failure anywhere in the trunk snapshot chain posts to Slack, since a rejected push would otherwise go unnoticed🤖 AI assistance
💡 Additional Considerations
rust/merge--//common:manager=allis reserved for cross-compiled release builds once those exist🔄 Types of changes