Skip to content

[build] only build debug artifacts when releasing#17595

Open
titusfortner wants to merge 1 commit into
trunkfrom
c/rust_debug
Open

[build] only build debug artifacts when releasing#17595
titusfortner wants to merge 1 commit into
trunkfrom
c/rust_debug

Conversation

@titusfortner
Copy link
Copy Markdown
Member

@titusfortner titusfortner commented May 30, 2026

🔗 Related Issues

Altnerative to #17590

First, we should verify what we are using these for in the first place, but I don't think we need to build the artifacts if we aren't going to save them to the artifacts repo.

💥 What does this PR do?

Gates the Rust debug binary builds (Windows, Linux, macOS) in ci-rust.yml behind the same condition as the release job, so they only run on trunk pushes with rust changes, or when inputs.release is true

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

Review Summary by Qodo

Gate Rust debug builds to release conditions only

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Gate debug artifact builds behind release conditions
• Prevent unnecessary CI runs on PRs and forks
• Align debug jobs with release job requirements
• Reduce wasted CI minutes on discarded artifacts
Diagram
flowchart LR
  A["Debug Build Jobs<br/>windows-debug<br/>linux-debug<br/>macos-debug"] -->|"Updated if condition"| B["Stricter Gate:<br/>not schedule AND<br/>not fork AND<br/>trunk or release"]
  B -->|"Result"| C["Only run on:<br/>trunk pushes or<br/>manual release"]

Loading

Grey Divider

File Changes

1. .github/workflows/ci-rust.yml ⚙️ Configuration changes +3/-3

Gate all debug build jobs to release conditions

• Updated if: condition for windows-debug job to gate behind release requirements
• Updated if: condition for linux-debug job to gate behind release requirements
• Updated if: condition for macos-debug job to gate behind release requirements
• All three debug jobs now share identical condition: exclude schedules, forks, and only run on
 trunk or manual release

.github/workflows/ci-rust.yml


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown
Contributor

qodo-code-review Bot commented May 30, 2026

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0)

Grey Divider


Remediation recommended

1. Duplicated release condition 🐞 Bug ⚙ Maintainability
Description
The same long if: expression is now duplicated across the three debug jobs (and also exists on
release), which increases the chance of future edits updating one job gate but not the others and
causing inconsistent CI behavior. Centralizing the condition would reduce drift risk while
preserving the current logic.
Code

.github/workflows/ci-rust.yml[80]

Evidence
The workflow contains the same long gating expression repeated across multiple jobs, so any future
change would need to be made in several places to avoid divergence.

.github/workflows/ci-rust.yml[76-81]
.github/workflows/ci-rust.yml[135-140]
.github/workflows/ci-rust.yml[198-203]
.github/workflows/ci-rust.yml[233-238]

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

### Issue description
The workflow duplicates a complex release gating expression in multiple jobs. This makes it easy for future changes to accidentally update only one instance (e.g., update `release` but forget a debug job), leading to inconsistent job execution.

### Issue Context
The identical expression appears on:
- `windows-debug`
- `linux-debug`
- `macos-debug`
- `release`

A simple way to keep these in sync is to define the expression once using a YAML anchor (or another shared mechanism) and reference it from each job.

### Fix Focus Areas
- .github/workflows/ci-rust.yml[19-25]
- .github/workflows/ci-rust.yml[76-83]
- .github/workflows/ci-rust.yml[135-141]
- .github/workflows/ci-rust.yml[198-203]
- .github/workflows/ci-rust.yml[233-238]

### Suggested change (example)
Add a shared anchor once (placement can be near the top-level keys):
```yml
x-release-if: &release_if >-
 github.event_name != 'schedule' &&
 github.event.repository.fork == false &&
 (github.ref == 'refs/heads/trunk' || inputs.release)
```
Then replace each duplicated job condition with:
```yml
if: *release_if
```
(Optionally apply the same to the `release` job too, so all 4 jobs reference the same condition.)

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


Grey Divider

Qodo Logo

@titusfortner titusfortner requested a review from bonigarcia May 30, 2026 00:23
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