Skip to content

fix(pre-release): update job dependencies and streamline version bump process#17321

Merged
diemol merged 1 commit intotrunkfrom
linear-pre-release-workflow
Apr 8, 2026
Merged

fix(pre-release): update job dependencies and streamline version bump process#17321
diemol merged 1 commit intotrunkfrom
linear-pre-release-workflow

Conversation

@diemol
Copy link
Copy Markdown
Member

@diemol diemol commented Apr 8, 2026

fix(pre-release): update job dependencies and streamline version bump process

Copilot AI review requested due to automatic review settings April 8, 2026 20:37
@qodo-code-review
Copy link
Copy Markdown
Contributor

Review Summary by Qodo

Streamline pre-release workflow and fix cargo repin timing

🐞 Bug fix

Grey Divider

Walkthroughs

Description
• Remove automatic cargo repin from Rust version task to prevent file-hash conflicts
• Add job dependency on cleanup-rust-branch before updating versions
• Ensure rust:update runs explicitly in dependency updates job for 'all' language releases
• Streamline pre-release workflow by deferring cargo repin to separate job execution

Grey Divider

File Changes

1. rake_tasks/rust.rake 🐞 Bug fix +0/-12

Remove automatic cargo repin from version task

• Removed automatic cargo repin invocation after version update
• Eliminated inline Rake task reenable and invoke calls
• Prevents file-hash conflicts in Bazel evaluation during version transitions

rake_tasks/rust.rake


2. .github/workflows/pre-release.yml ⚙️ Configuration changes +3/-3

Update job dependencies and explicit rust update calls

• Added restrict-trunk dependency to generate-rust-version job
• Added cleanup-rust-branch dependency to update-versions job
• Explicitly added rust:update command to dependency-updates job for 'all' language releases
• Ensures proper job sequencing and cargo repin execution timing

.github/workflows/pre-release.yml


Grey Divider

Qodo Logo

@selenium-ci selenium-ci added the B-build Includes scripting, bazel and CI integrations label Apr 8, 2026
@qodo-code-review
Copy link
Copy Markdown
Contributor

qodo-code-review bot commented Apr 8, 2026

Code Review by Qodo

🐞 Bugs (1)   📘 Rule violations (0)   📎 Requirement gaps (0)   🎨 UX Issues (0)
🐞\ ☼ Reliability (1)

Grey Divider


Action required

1. Rust lockfiles left stale 🐞
Description
rust:version now updates only rust/Cargo.toml and rust/BUILD.bazel, leaving rust/Cargo.lock
and rust/Cargo.Bazel.lock potentially containing the old selenium-manager version. In the
pre-release workflow, Bazel-based jobs run on the staging ref after the version bump but before the
first rust:update, so crate_universe may evaluate using lockfiles inconsistent with the updated
manifest.
Code

rake_tasks/rust.rake[R57-60]

    text = File.read(file).gsub(old_version, new_version)
    File.open(file, 'w') { |f| f.puts text }
  end
-
-  # Repin cargo immediately after updating the version so Cargo.Bazel.lock is
-  # never left in a stale state between jobs.  Running CARGO_BAZEL_REPIN=true
-  # against a Cargo.toml whose version has already changed (but whose lockfile
-  # hasn't been updated yet) causes Bazel to detect a mid-evaluation file-hash
-  # conflict and crash (rules_rust extensions.bzl reads the lockfile twice
-  # within the same Bazel evaluation).
-  # reenable is required because Rake::Task#invoke is a no-op if the task has
-  # already run once in this Ruby process (e.g. when multiple tasks are chained
-  # in a single ./go invocation).
-  Rake::Task['rust:update'].reenable
-  Rake::Task['rust:update'].invoke
end
Evidence
The rust:update task is explicitly described as updating Rust lock files, but rust:version no
longer invokes it. The Bazel module configuration consumes Cargo.toml + Cargo.lock +
Cargo.Bazel.lock together, and Cargo.Bazel.lock embeds the selenium-manager version key, so
bumping the manifest version without updating lockfiles creates an inconsistent set of inputs. The
pre-release workflow bumps Rust version in update-versions / generate-rust-version, while
rust:update is only run later in update-dependencies, meaning other Bazel executions on the
staging ref can occur before lockfile repinning.

rake_tasks/rust.rake[15-19]
rake_tasks/rust.rake[44-60]
MODULE.bazel[386-396]
rust/Cargo.Bazel.lock[12007-12010]
.github/workflows/pre-release.yml[91-99]
.github/workflows/pre-release.yml[140-152]
Rakefile[106-125]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`rust:version` no longer updates Rust lockfiles (`rust/Cargo.lock` and `rust/Cargo.Bazel.lock`). The release workflow still runs Bazel jobs on refs where `rust/Cargo.toml` has been version-bumped, which can create an inconsistent `crate.from_cargo` input set.

### Issue Context
- `crate.from_cargo` consumes `Cargo.toml`, `Cargo.lock`, and `Cargo.Bazel.lock` together.
- `Cargo.Bazel.lock` contains the `selenium-manager <version>` entry, so changing the crate version without updating lockfiles leaves the lock data stale.
- The pre-release workflow bumps Rust version before the first explicit `rust:update`.

### Fix (choose one)
1) **Workflow fix (recommended):** run `./go rust:update` immediately after any `./go rust:version ...` **in the same job** (before committing/uploading patches).
  - For `generate-rust-version`, change `run:` to `./go rust:version <ver> && ./go rust:update`.
  - For `update-versions` when `language == 'all'`, extend the chained command to include `&& ./go rust:update` right after `rust:version`.

2) **Task-level fix:** reintroduce a repin call inside `rust:version` (invoke/reenable `rust:update`) so any caller gets consistent lockfiles automatically.

### Fix Focus Areas
- .github/workflows/pre-release.yml[28-37]
- .github/workflows/pre-release.yml[91-99]
- .github/workflows/pre-release.yml[140-152]
- rake_tasks/rust.rake[44-60]
- MODULE.bazel[386-396]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts the pre-release automation to change job ordering/dependencies and to streamline how Rust version bumps and dependency repinning are handled during release preparation.

Changes:

  • Removes the implicit Rust repin step from the rust:version Rake task.
  • Updates the pre-release workflow job graph (adds new needs relationships).
  • Extends the dependency update command to run rust:update when doing an all release.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
rake_tasks/rust.rake Removes automatic Rust lockfile repin from the Rust version bump task.
.github/workflows/pre-release.yml Adjusts job dependencies and appends a conditional Rust repin to the dependency update step.

@diemol diemol enabled auto-merge (squash) April 8, 2026 20:46
@diemol diemol disabled auto-merge April 8, 2026 20:46
@diemol diemol merged commit 2677c26 into trunk Apr 8, 2026
31 checks passed
@diemol diemol deleted the linear-pre-release-workflow branch April 8, 2026 20:53
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.

3 participants