Skip to content

[build] extend the EngFlow cache for GHA to all bindings - #18331

Merged
titusfortner merged 1 commit into
SeleniumHQ:trunkfrom
titusfortner:remote-cache-rollout
Nov 17, 2026
Merged

titusfortner merged 1 commit into
SeleniumHQ:trunkfrom
titusfortner:remote-cache-rollout

Conversation

@titusfortner

Copy link
Copy Markdown
Member

🔗 Related Issues

Expands on #18276 per the follow-up items there

💥 What does this PR do?

  • Expands the EngFlow remote cache on GitHub Actions workflows from just Java to include Python, Ruby, JavaScript and .NET (smoke tests only)
  • Upload remote cache from every trunk push/merge instead of nightly
  • Add macOS smoke tests to trunk push/merge

🔧 Implementation Notes

  • Since [build] use the EngFlow cache for the Java GHA smoke test job #18276 there have been no cache failures, and Java PR smoke test jobs that found most of their tests cached ran 40 to 50% faster, but only a quarter of jobs did because the nightly-only cache usually went cold within hours.
  • Nightly has always intentionally run without cache so every test actually runs, but now it no longer caches those results because it shouldn't need to.
  • Over the last two weeks PR macOS jobs waited a median of 3 seconds for a runner and no macOS job was running about 21 hours a day, so there is room for macOS smoke tests on trunk pushes.
  • --remote_cache_compression (zstd) reduces transfer without changing cache keys, and Bazel fails at startup if the server doesn't support it.
  • Cache records now include the binding, since the Python, Ruby and JavaScript smoke jobs are named only by OS.

🤖 AI assistance

  • AI assisted (complete below)
    • Tool(s): Claude Code (Claude Opus 5.5)
    • What was generated: the analysis of the Java trial data, the workflow and config changes, and this description
    • I reviewed all AI output and can explain the change

💡 Additional Considerations

  • Follow-on PR for Rust since how building and caching Selenium Manager has wider implications
  • Consider whether the extra logic from affected-targets implementation is worth keeping it as an additional filter

🔄 Types of changes

  • New feature (CI only)

… and write it only from trunk pushes, macOS included
@selenium-ci

Copy link
Copy Markdown
Member

/agentic_describe

@selenium-ci

Copy link
Copy Markdown
Member

/agentic_review

@selenium-ci selenium-ci added the B-build Includes scripting, bazel and CI integrations label Nov 17, 2026
@qodo-code-review

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

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Expand EngFlow caching across CI smoke tests and trunk pushes

✨ Enhancement ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Enable EngFlow caching for Python, Ruby, JavaScript, and .NET smoke jobs alongside Java.
• Write cache results on trunk pushes instead of nightly runs; add macOS smoke coverage to pushes.
• Compress cache transfers and record each test job’s binding for cache analysis.
Merge Risk 🟡 Medium

Evidence: Partial. The provider did not establish the exact full-PR diff revisions. The exact full-PR diff revisions are unavailable. The report lists 28 more gaps.

Blast radius 🟡 Medium 💥 2 capabilities

  • 2 affected capabilities within one bounded functional scope: GitHub Actions Bazel CI.
  • The callers all invoke the same reusable Bazel workflow to validate Selenium language implementations.
  • The language-specific jobs are separate entry points within one bounded CI integration, and the changed cache configuration propagates through that shared workflow rather than affecting independent product capabilities.
  • These are distinct language entry points but the same bounded CI validation integration: each delegates to the shared Bazel workflow and produces the same system outcome, repository validation.
  • The changed behavior is broader event coverage, not independent product functionality.
  • The parser and the reusable workflow's summary/upload steps form one bounded telemetry integration.
  • The reported binding is a reporting attribute of the same remote-cache execution behavior, not a separate product capability.
Sources

.github/workflows/ci-python.yml[87-99]

    with:
      name: ${{ matrix.os }}
      needs-display: true
      os: ${{ matrix.os }}
      rerun-with-debug: true
      remote-cache: true
      download-artifact-name: targets
      run: >
        [ -s bazel-targets-py.txt ] || echo //py/... > bazel-targets-py.txt;
        ./scripts/github-actions/bazel-test-if-targets.sh
        --config=gh-browser
        ${{ inputs.compile-manager && '--manager=host' || '' }}
        --test_tag_filters=${{ matrix.tag_filters }}${{ matrix.os == 'macos' && (github.event_name == 'pull_request' || github.event_name == 'push') && ',-edge' || '' }}

.github/workflows/ci-ruby.yml[90-101]

      needs-display: true
      os: ${{ matrix.os }}
      rerun-with-debug: true
      remote-cache: true
      download-artifact-name: targets
      run: >
        [ -s bazel-targets-rb.txt ] || echo //rb/... > bazel-targets-rb.txt;
        ./scripts/github-actions/bazel-test-if-targets.sh
        --config=gh-browser
        ${{ inputs.compile-manager && contains(matrix.tag_filters, 'se-manager') && '--manager=host' || '' }}
        --test_env=SKIP_PENDING=true
        --test_tag_filters=${{ matrix.tag_filters }}${{ matrix.os == 'macos' && (github.event_name == 'pull_request' || github.event_name == 'push') && ',-edge' || '' }}

.github/workflows/bazel.yml[181-184]

          bazelrc: |
            common --color=yes
            ${{ inputs.remote-cache && github.repository_owner == 'SeleniumHQ' && github.event_name != 'schedule' && (github.event_name == 'push' && 'build --config=remote-cache-write' || 'build --config=remote-cache') || '' }}
          # Workaround for long path issues: https://github.com/bazelbuild/bazel/pull/22532

.github/workflows/ci-dotnet.yml[45-60]

      os: windows
      needs-display: true
      rerun-with-debug: true
      remote-cache: true
      run: |
        bazel test --local_resources=browser=1 ${{ inputs.compile-manager && '--manager=host' || '' }} //dotnet/test/webdriver:ElementFindingTests-firefox //dotnet/test/webdriver:ElementFindingTests-chrome

  remote-tests:
    name: Remote Tests
    uses: ./.github/workflows/bazel.yml
    with:
      name: Remote Tests
      os: windows
      needs-display: true
      rerun-with-debug: true
      remote-cache: true

.github/workflows/ci-java.yml[45-48]

        ./scripts/github-actions/bazel-test-if-targets.sh
        --config=gh-browser
        ${{ inputs.compile-manager && '--manager=host' || '' }}
        --test_tag_filters=${{ matrix.tag_filters }}${{ matrix.os == 'macos' && (github.event_name == 'pull_request' || github.event_name == 'push') && ',-edge' || '' }}

.github/workflows/ci-javascript.yml[68-80]

    with:
      name: ${{ matrix.os }}
      needs-display: true
      os: ${{ matrix.os }}
      rerun-with-debug: true
      remote-cache: true
      download-artifact-name: targets
      run: >
        [ -s bazel-targets-js.txt ] || echo //javascript/selenium-webdriver/... > bazel-targets-js.txt;
        ./scripts/github-actions/bazel-test-if-targets.sh
        --config=gh-browser
        ${{ inputs.compile-manager && '--manager=host' || '' }}
        --test_tag_filters=${{ matrix.tag_filters }}${{ matrix.os == 'macos' && (github.event_name == 'pull_request' || github.event_name == 'push') && ',-edge' || '' }}
Behavioral complexity 🟡 Medium 🧩 Interacting branches, Compatibility cases

  • Before: enabled remote-cache jobs used the read-only configuration for non-schedule events, while the prior expression selected a write mode for scheduled runs.
  • After: schedule is excluded, push selects remote-cache-write, and other enabled events select read-only remote-cache; the changed .bazelrc also enables compression and callers add package-read permission.
  • New correctness condition: event type, repository owner, caller input, credential permission, cache mode, and Bazel's remote-cache compatibility must agree so that push writes, non-push jobs read, and scheduled jobs do not unexpectedly use the cache.
  • This is an interaction between workflow event states and producer/consumer cache modes, not merely reuse of an existing helper.
Sources

.github/workflows/bazel.yml[79-80]

      remote-cache:
        description: Read the EngFlow remote cache (trunk pushes also write it; the nightly does not use it)

.github/workflows/bazel.yml[181-184]

          bazelrc: |
            common --color=yes
            ${{ inputs.remote-cache && github.repository_owner == 'SeleniumHQ' && github.event_name != 'schedule' && (github.event_name == 'push' && 'build --config=remote-cache-write' || 'build --config=remote-cache') || '' }}
          # Workaround for long path issues: https://github.com/bazelbuild/bazel/pull/22532

.github/workflows/ci-dotnet.yml[19-21]

permissions:
  contents: read
  packages: read

.github/workflows/ci-dotnet.yml[45-60]

      os: windows
      needs-display: true
      rerun-with-debug: true
      remote-cache: true
      run: |
        bazel test --local_resources=browser=1 ${{ inputs.compile-manager && '--manager=host' || '' }} //dotnet/test/webdriver:ElementFindingTests-firefox //dotnet/test/webdriver:ElementFindingTests-chrome

  remote-tests:
    name: Remote Tests
    uses: ./.github/workflows/bazel.yml
    with:
      name: Remote Tests
      os: windows
      needs-display: true
      rerun-with-debug: true
      remote-cache: true
Potential damage 🟡 Medium 🩹 Temporary loss

  • A cache configuration or authorization fault can block selected CI validation jobs, but the affected capability is test execution infrastructure.
  • Reverting the workflow/configuration can restore execution; no product data or deployed Selenium state is modified.
  • The package permission is a prerequisite for the cache credential path, not evidence of a product confidentiality impact.
  • Recoverable by disabling remote-cache for the jobs or reverting the cache configuration and rerunning failed CI.
  • There is no persistent application state to repair and no external user effect shown.
Sources

.github/workflows/bazel.yml[181-184]

          bazelrc: |
            common --color=yes
            ${{ inputs.remote-cache && github.repository_owner == 'SeleniumHQ' && github.event_name != 'schedule' && (github.event_name == 'push' && 'build --config=remote-cache-write' || 'build --config=remote-cache') || '' }}
          # Workaround for long path issues: https://github.com/bazelbuild/bazel/pull/22532

.github/workflows/ci-dotnet.yml[19-21]

permissions:
  contents: read
  packages: read

.github/workflows/ci-dotnet.yml[45-60]

      os: windows
      needs-display: true
      rerun-with-debug: true
      remote-cache: true
      run: |
        bazel test --local_resources=browser=1 ${{ inputs.compile-manager && '--manager=host' || '' }} //dotnet/test/webdriver:ElementFindingTests-firefox //dotnet/test/webdriver:ElementFindingTests-chrome

  remote-tests:
    name: Remote Tests
    uses: ./.github/workflows/bazel.yml
    with:
      name: Remote Tests
      os: windows
      needs-display: true
      rerun-with-debug: true
      remote-cache: true

.github/workflows/ci-javascript.yml[68-80]

    with:
      name: ${{ matrix.os }}
      needs-display: true
      os: ${{ matrix.os }}
      rerun-with-debug: true
      remote-cache: true
      download-artifact-name: targets
      run: >
        [ -s bazel-targets-js.txt ] || echo //javascript/selenium-webdriver/... > bazel-targets-js.txt;
        ./scripts/github-actions/bazel-test-if-targets.sh
        --config=gh-browser
        ${{ inputs.compile-manager && '--manager=host' || '' }}
        --test_tag_filters=${{ matrix.tag_filters }}${{ matrix.os == 'macos' && (github.event_name == 'pull_request' || github.event_name == 'push') && ',-edge' || '' }}

.github/workflows/ci-python.yml[87-99]

    with:
      name: ${{ matrix.os }}
      needs-display: true
      os: ${{ matrix.os }}
      rerun-with-debug: true
      remote-cache: true
      download-artifact-name: targets
      run: >
        [ -s bazel-targets-py.txt ] || echo //py/... > bazel-targets-py.txt;
        ./scripts/github-actions/bazel-test-if-targets.sh
        --config=gh-browser
        ${{ inputs.compile-manager && '--manager=host' || '' }}
        --test_tag_filters=${{ matrix.tag_filters }}${{ matrix.os == 'macos' && (github.event_name == 'pull_request' || github.event_name == 'push') && ',-edge' || '' }}

.github/workflows/ci-ruby.yml[90-101]

      needs-display: true
      os: ${{ matrix.os }}
      rerun-with-debug: true
      remote-cache: true
      download-artifact-name: targets
      run: >
        [ -s bazel-targets-rb.txt ] || echo //rb/... > bazel-targets-rb.txt;
        ./scripts/github-actions/bazel-test-if-targets.sh
        --config=gh-browser
        ${{ inputs.compile-manager && contains(matrix.tag_filters, 'se-manager') && '--manager=host' || '' }}
        --test_env=SKIP_PENDING=true
        --test_tag_filters=${{ matrix.tag_filters }}${{ matrix.os == 'macos' && (github.event_name == 'pull_request' || github.event_name == 'push') && ',-edge' || '' }}
Assessed commit ed6e6f5 > Snapshot assessment: the current PR revision could not be verified.
Diagram

graph TD
  Events["CI events"] --> Smoke["Binding smoke jobs"] --> Bazel["Shared Bazel workflow"] --> Config["Cache configuration"] --> EngFlow[("EngFlow cache")]
  Bazel --> Summary["Cache summary"] --> Artifacts["Record artifacts"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Automatically enable caching in the shared workflow
  • ➕ Avoids repeating cache opt-ins across binding workflows.
  • ➖ Could enable caching for non-smoke jobs or require brittle job classification.
  • ➖ Makes the rollout scope less explicit to reviewers.

Recommendation: Keep the explicit smoke-job opt-ins and central event-based read/write policy. This limits cache exposure while ensuring all opted-in bindings follow the same push, PR, and nightly behavior.

Files changed (8) +27 / -22

Enhancement (6) +23 / -19
ci-dotnet.ymlEnable caching for .NET browser and remote tests +3/-0

Enable caching for .NET browser and remote tests

• Grants package-read permission and opts both Windows browser and remote test jobs into the shared EngFlow cache.

.github/workflows/ci-dotnet.yml

ci-java.ymlRun Java macOS smoke tests on pushes +1/-4

Run Java macOS smoke tests on pushes

• Removes the push exclusion for macOS smoke tests and extends the macOS Edge filter to push runs.

.github/workflows/ci-java.yml

ci-javascript.ymlCache JavaScript smoke tests and add macOS push coverage +3/-4

Cache JavaScript smoke tests and add macOS push coverage

• Grants package-read permission, opts smoke jobs into EngFlow caching, and runs macOS smoke tests on pushes while excluding Edge there.

.github/workflows/ci-javascript.yml

ci-python.ymlCache Python smoke tests and add macOS push coverage +3/-4

Cache Python smoke tests and add macOS push coverage

• Grants package-read permission, opts smoke jobs into EngFlow caching, and runs macOS smoke tests on pushes while excluding Edge there.

.github/workflows/ci-python.yml

ci-ruby.ymlCache Ruby smoke tests and add macOS push coverage +3/-4

Cache Ruby smoke tests and add macOS push coverage

• Grants package-read permission, opts smoke jobs into EngFlow caching, and runs macOS smoke tests on pushes while excluding Edge there.

.github/workflows/ci-ruby.yml

remote-cache-summary.shAttribute cache records to test bindings +10/-3

Attribute cache records to test bindings

• Infers the dominant binding from passed test labels and adds it to each JSON cache record. Runs without passed tests no longer emit a record.

scripts/github-actions/remote-cache-summary.sh

Other (2) +4 / -3
.bazelrc.remoteCompress EngFlow remote-cache transfers +1/-0

Compress EngFlow remote-cache transfers

• Enables remote-cache compression for cache-enabled Bazel runs, reducing transfer size without changing cache keys.

.bazelrc.remote

bazel.ymlMove cache writes from nightly runs to pushes +3/-3

Move cache writes from nightly runs to pushes

• Opted-in jobs read the cache on non-scheduled events and write results on pushes. Scheduled jobs no longer use the remote cache or produce cache-use summaries.

.github/workflows/bazel.yml

@qodo-code-review

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

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Failed runs lose cache usage records ✗ Dismissed
Description
remote-cache-summary.sh exits when it finds no PASSED test lines, even after parsing the
invocation’s cache hits and process counts. If every test fails or filters select no tests, it never
writes the record that the artifact-upload step requires.

Grey Divider

Context sources
✅ Linked PRs:
  🌐 PR #18276
Review mode: Auto: ⚖️ Balanced: Behavioral CI and caching changes span multiple workflows and event paths.

Grey Divider

Tip of the day
💡 Did you know, you can enable the Remediation agent and Qodo fixes findings in a dedicated fix PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@titusfortner titusfortner changed the title [build] extend the EngFlow cache to Python, Ruby, JavaScript and .NET and write it only from trunk pushes, macOS included [build] extend the EngFlow cache for GHA to all bindings Nov 17, 2026
@titusfortner
titusfortner merged commit 43df7b9 into SeleniumHQ:trunk Nov 17, 2026
48 checks passed
This was referenced Nov 23, 2026
This was referenced Nov 24, 2026
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants