Skip to content

[build] GitHub tests build Manager from source to use EngFlow cache where necessary - #18339

Merged
titusfortner merged 3 commits into
SeleniumHQ:trunkfrom
titusfortner:sm-source-tests
Nov 18, 2026
Merged

titusfortner merged 3 commits into
SeleniumHQ:trunkfrom
titusfortner:sm-source-tests

Conversation

@titusfortner

Copy link
Copy Markdown
Member

🔗 Related Issues

💥 What does this PR do?

  • GitHub Actions browser tests always build Selenium Manager from source, using what is in cache if rebuilding is not necessary, rather than always downloading the latest pinned version from the selenium_manager_artifacts repo
  • Merely bumping the version does not invalidate test result cache
  • The nightly tests read the EngFlow cache but still run every test.

Since Release PRs only bump the version, much of the test cache will no longer be invalidated, could see ~10 minutes faster release times

🔧 Implementation Notes

  • --manager=host goes in test:gh-browser configuration and on the two .NET browser jobs that don't use it, replacing the compile-manager input that only did this when Rust changed; the default, packaging and local runs stay on the pin until it is removed, and RBE keeps --manager=stub.
  • The host build shares action keys with the Rust job, which ran entirely from cache with no Rust change (2 to 3 min on each OS).
  • Only stamped builds compile the version from version.bzl; unstamped builds report rules_rust's 0.0.0, which Selenium Manager only sends as a usage stat that tests and unstamped builds already skip. After a local version bump the unstamped build re-ran nothing.
  • Scheduled runs use the read-only cache with --nocache_test_results, so the nightly's 28 browser jobs don't each compile Selenium Manager (3 to 7 min) while every binding test and //rust/... still run live daily; the three nightly-only browser jobs now set remote-cache for this.

🤖 AI assistance

  • No substantial AI assistance used
  • AI assisted (complete below)
    • Tool(s): Claude Code (Claude Opus 5.5)
    • What was generated: the workflow, config and version changes, the cache-key and CI timing analysis, and this description
    • I reviewed all AI output and can explain the change

🔄 Types of changes

  • Cleanup (CI and build only; unstamped selenium-manager --version now reports 0.0.0)

@selenium-ci

Copy link
Copy Markdown
Member

/agentic_describe

@selenium-ci

Copy link
Copy Markdown
Member

/agentic_review

@selenium-ci selenium-ci added B-build Includes scripting, bazel and CI integrations C-rust Rust code is mostly Selenium Manager B-manager Selenium Manager labels Nov 18, 2026
@qodo-code-review

qodo-code-review Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Build Selenium Manager from source in GHA browser tests

⚙️ Configuration changes ✨ Enhancement 🕐 20-40 Minutes

Grey Divider

AI Description

• Build Selenium Manager from source for GitHub Actions browser tests, using cached build actions
 when available.
• Let nightly jobs reuse EngFlow build actions while rerunning every test.
• Keep version bumps out of unstamped Rust builds to preserve build and test caches.
Merge Risk 🟡 Medium

Blast radius 🔴 High 💥 3 capabilities

  • 3 affected capabilities span independent functional scopes: repository_ci_validation, selenium_manager_release_packaging.
  • Java, JavaScript, Python, Ruby, and .NET browser tests consume the same gh-browser/manager-selection integration.
  • They are distinct test entry points but share one bounded repository CI validation subsystem; the manager selection propagates from the changed Bazel/workflow configuration into each browser-test invocation.
  • The affected language jobs all use the same reusable Bazel workflow and cache contract.
  • Their outcomes are separate test entry points, but the changed behavior is one bounded CI execution integration: selecting remote build/cache behavior and scheduled test-result invalidation.
  • The changed Rake task, shared version binding, Cargo metadata, and stamped Rust Bazel target form one bounded release-packaging behavior.
  • They affect the version identity of the Selenium Manager artifact, not the runtime browser-management algorithms or the unrelated language bindings.
Sources

.bazelrc[164-164]

test:gh-browser --manager=host

.github/workflows/bazel.yml[160-161]

            ${{ inputs.remote-cache && github.repository_owner == 'SeleniumHQ' && (github.event_name == 'push' && 'build --config=remote-cache-write' || 'build --config=remote-cache') || '' }}
            ${{ inputs.remote-cache && github.repository_owner == 'SeleniumHQ' && github.event_name == 'schedule' && 'test --nocache_test_results' || '' }}

rust/BUILD.bazel[129-133]

    # Only stamped builds carry the real version, so a bump invalidates no cached build or test.
    version = select({
        "//common:stamp": VERSIONS["rust"],
        "//conditions:default": None,
    }),

rake_tasks/rust.rake[3-5]

def rust_version
  SeleniumRake.version('rust')
end

rake_tasks/rust.rake[64-72]

  SeleniumRake.write_version('rust', new_version)

  # Anchor on the package name: other crates in Cargo.lock sit at the same
  # 0.4.x numbers (e.g. `tar`), as do dependency literals in Cargo.toml.
  pattern = /(name = "selenium-manager".*?version = ")#{Regexp.escape(old_version)}(")/m
  ['rust/Cargo.toml', 'rust/Cargo.lock'].each do |file|
    text = File.read(file).sub(pattern, "\\1#{new_version}\\2")
    File.open(file, 'w') { |f| f.puts text }
  end
Behavioral complexity 🟡 Medium 🧩 Compatibility cases

  • Before: source compilation was selected through a compile-manager input when Rust files were detected, while other invocations could use the pinned/downloaded manager.
  • After: gh-browser and the explicit .NET browser commands select host compilation directly, with non-host platform behavior still determined by the manager selector.
  • New correctness condition: host, non-host, workflow-event, and removed-input paths must remain compatible so each test matrix receives an executable manager artifact.
  • The selector and platform branches are established infrastructure; the change materially alters which CI states activate them rather than introducing a new algorithm.
Sources

.bazelrc[164-164]

test:gh-browser --manager=host
Potential damage 🟡 Medium 🩹 Temporary loss

  • The concrete loss is repository validation for one or more browser-test jobs, not an end-user capability.
  • Reverting the workflow/configuration restores the previous selection.
  • If a host build fails, the supported recovery is to correct the build/configuration or revert; no persistent state or external user effect is created.
  • High recoverability: rerun after configuration/build repair or revert.
  • No persistent state repair or external compensation is required.
Sources

.bazelrc[164-164]

test:gh-browser --manager=host
Assessed commit 90bd022
Diagram

graph TD
  CI["Browser CI"] --> CFG["gh-browser config"] --> BIN["Manager binary"]
  CI --> CACHE[("EngFlow cache")] --> BIN
  NIGHT["Nightly live tests"] --> CFG
  NIGHT -->|read actions| CACHE
  VER["version.bzl"] --> STAMP["Stamped builds"] --> BIN
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Keep conditional manager compilation
  • ➕ Avoids building the manager for browser jobs when Rust has not changed.
  • ➖ Browser tests continue to exercise the pinned download rather than current source on most changes.
  • ➖ Retains change-detection inputs across workflows.
2. Make the source build the global default
  • ➕ Uses one manager selection across CI and local builds.
  • ➖ Changes local and packaging behavior outside this PR's browser-test scope.
  • ➖ May impose Rust build costs where the pinned binary is intentional.

Recommendation: Keep the PR's CI-scoped host selection. It tests current source while preserving pinned defaults elsewhere; action caching and unstamped version isolation limit the added build cost. Review the scheduled-event cache settings and stamp selection together.

Files changed (13) +21 / -86

Refactor (3) +3 / -20
ci.ymlStop propagating Rust-change manager flags +0/-12

Stop propagating Rust-change manager flags

• Removes the 'compile-manager' target-selection output and its arguments to binding workflows. Manager selection no longer depends on whether changed files are under 'rust/'.

.github/workflows/ci.yml

bazel.rakeRemove obsolete manager-change detection +0/-4

Remove obsolete manager-change detection

• Stops writing 'build/selenium-manager-changed.txt' from the affected-targets task. CI no longer consumes that signal.

rake_tasks/bazel.rake

rust.rakeManage the Rust version through the shared version file +3/-4

Manage the Rust version through the shared version file

• Reads and writes the Selenium Manager version through 'SeleniumRake' and 'version.bzl'. Version updates still modify Cargo metadata but no longer rewrite 'rust/BUILD.bazel'.

rake_tasks/rust.rake

Documentation (1) +1 / -1
Cargo.tomlRemove the outdated Bazel-version reminder +1/-1

Remove the outdated Bazel-version reminder

• Drops the comment instructing maintainers to update the version in 'rust/BUILD.bazel'; the Rake task now writes the shared version file.

rust/Cargo.toml

Other (9) +17 / -65
.bazelrcSelect the host-built manager for GHA browser tests +1/-0

Select the host-built manager for GHA browser tests

• Adds '--manager=host' to the shared 'gh-browser' test configuration. Browser jobs using that configuration now test the source-built manager without changing the default for other builds.

.bazelrc

bazel.ymlRead remote actions but rerun scheduled tests +3/-2

Read remote actions but rerun scheduled tests

• Allows scheduled jobs to use the EngFlow remote cache when enabled. Those jobs also set '--nocache_test_results' so cached build actions do not suppress nightly test execution.

.github/workflows/bazel.yml

ci-dotnet.ymlBuild the manager for both .NET browser jobs +2/-14

Build the manager for both .NET browser jobs

• Makes the .NET browser and remote-test commands pass '--manager=host' unconditionally. Removes the obsolete 'compile-manager' workflow inputs.

.github/workflows/ci-dotnet.yml

ci-java.ymlUse the shared manager selection in Java CI +0/-13

Use the shared manager selection in Java CI

• Removes the conditional host-manager argument and 'compile-manager' inputs. Java browser tests now obtain the host selection from 'gh-browser'.

.github/workflows/ci-java.yml

ci-javascript.ymlSimplify JavaScript manager selection and cache nightly actions +1/-11

Simplify JavaScript manager selection and cache nightly actions

• Removes 'compile-manager' inputs and conditional arguments because 'gh-browser' selects the host build. Enables remote-cache access for the additional browser job.

.github/workflows/ci-javascript.yml

ci-python.ymlUnify Python browser manager selection and cache access +1/-12

Unify Python browser manager selection and cache access

• Removes 'compile-manager' inputs and conditional host arguments from Python test commands. Enables remote-cache access for the additional browser job.

.github/workflows/ci-python.yml

ci-ruby.ymlUnify Ruby browser manager selection and cache access +1/-11

Unify Ruby browser manager selection and cache access

• Removes 'compile-manager' inputs and the tag-dependent host argument; 'gh-browser' now makes the selection. Enables remote-cache access for the additional browser job.

.github/workflows/ci-ruby.yml

BUILD.bazelCompile the declared version only for stamped builds +6/-1

Compile the declared version only for stamped builds

• Replaces the literal binary version with a stamp-dependent selection from 'version.bzl'. Unstamped builds use the Rust rule's default version, avoiding a binary build-key change from a declared-version bump.

rust/BUILD.bazel

version.bzlRecord the Selenium Manager version centrally +2/-1

Record the Selenium Manager version centrally

• Adds the Rust/Selenium Manager version to 'VERSIONS' and updates the file description. Stamped Bazel builds consume this value.

version.bzl

@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

Tip of the day
💡 Did you know, you can type 'qodo, fix this' on a finding and the fix lands right on your PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@titusfortner titusfortner changed the title [build] build Selenium Manager from source for GHA browser tests and keep its version out of unstamped builds [build] GitHub tests build Manager from source to use EngFlow cache where necessary Nov 18, 2026
@titusfortner
titusfortner merged commit a7ee294 into SeleniumHQ:trunk Nov 18, 2026
51 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-manager Selenium Manager C-rust Rust code is mostly Selenium Manager

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants