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
We are mostly relying on RBE to tell us if there is a problem, this is supposed to be extra information that strikes a good balance between information and execution time.
💥 What does this PR do?
ci.yml kicks off on every commit. It runs the new and improved check-bazel-targets.sh
Instead of just checking to see if there are any rb targets and running the whole ci-ruby workflow, the unique set of applicable test targets are passed from the script to ci-ruby.yml and browser tests are only run on those
Additionally, docs/steep/unit tests are only run if the PR includes "[rb]" or is executed manually (passed into ci-ruby.yml from ci.yml with a run-full-suite argument.
Even if tagged [rb], if only a subset of ruby tests are matched, only those will be run
Removed build instead of gating all tests on it. Most of the build is executed by the applicable tests as necessary. If there is something weird that breaks building, it'll get detected in nightly run
It's now 2 jobs instead of 6, but effective changes are:
Changes firefox/windows to firefox-beta/windows
Changes chrome/windows to chrome-beta/windows
Adds chrome-beta-remote/windows
Adds firefox-beta-remote/windows
Removes Edge Windows
Removes Edge Remote Windows
Removes Chrome Mac
Removes Chrome Firefox
Update: fixed so it run edge remote like previously and doesn't run chrome/firefox remote
🔧 Implementation Notes
I'm picking betas instead of production browsers as a way to get additional information earlier. Failures in new browser versions will still be managed in a PR updating them, not in trunk.
💡 Additional Considerations
This probably doesn't decrease the total amount of Ruby testing by enough, so we probably need to add more filters, but I think this is a good place to start.
PR Type
Enhancement, Tests
Description
Implement selective Ruby test filtering based on changed files
Limit test universe to binding roots for faster CI execution
Remove build job and consolidate to two browser test jobs
Filter test targets by [rb] tag and file changes
Diagram Walkthrough
flowchart LR
A["Changed Files"] -->|"bazel query"| B["Affected Targets"]
B -->|"Filter to //rb"| C["Ruby Targets"]
C -->|"Check [rb] tag"| D["Run Full Suite"]
D -->|"Yes"| E["Docs + Steep + Unit Tests"]
D -->|"No"| F["Browser Tests Only"]
E --> G["Filter Targets Job"]
F --> G
G -->|"//rb targets"| H["Browser Tests<br/>chrome-beta/firefox-beta"]
Loading
File Walkthrough
Relevant files
Enhancement
check-bazel-targets.sh
Restrict target universe and improve query logic
scripts/github-actions/check-bazel-targets.sh
Add strict error handling with set -euo pipefail
Limit bazel query universe to binding roots only
Filter out manual test tags from results
Return unique sorted set of test targets
Fix bazel query syntax to properly handle file-to-target mapping
Generic: Robust Error Handling and Edge Case Management
Objective: Ensure comprehensive error handling that provides meaningful context and graceful degradation
Status: Incorrect query input: The script attempts to map changed files to Bazel targets but calls bazel query with the literal string file (and suppresses errors), which can silently produce incorrect/empty target sets and cause missed test execution.
Referred Code
forfilein$affected_files;doif query_output=$(bazel query --keep_going --noshow_progress "file"2>/dev/null);then
bazel_targets+=(${query_output})
fi
Generic: Security-First Input Validation and Data Handling
Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent vulnerabilities
Status: Unvalidated workflow input: The workflow accepts inputs.targets and passes it into a shell loop without validation or strict parsing, which may allow unexpected values to influence which Bazel targets are executed.
Why: This suggestion identifies a critical bug where the script queries the literal string "file" instead of the filename variable, which would cause the target detection to fail.
High
Fix incorrect GitHub Actions output
Remove the single quotes when setting the bazel-targets output to prevent it from being treated as a single string by downstream jobs.
-echo "bazel-targets='${bazel_targets[*]}'" | tee -a "$GITHUB_OUTPUT"+echo "bazel-targets=${bazel_targets[*]}" >> "$GITHUB_OUTPUT"
Apply / Chat
Suggestion importance[1-10]: 9
__
Why: This suggestion correctly identifies and fixes a critical bug where single quotes in the GitHub Action output would break downstream jobs by passing the target list as a single string.
High
Consolidate and quote query string
Consolidate the multi-line bazel query into a single variable before execution to improve readability and prevent potential syntax issues.
Why: The suggestion improves code readability by consolidating a multi-line bazel query into a variable, but the original code is functionally correct.
Low
Learned best practice
Validate and normalize workflow input
Normalize and validate inputs.targets before iterating (trim, handle newlines, and avoid unsafe word-splitting) so empty/odd input formats don’t break filtering.
run: |
targets="${{ inputs.targets }}"
filtered=()
++ # Normalize whitespace/newlines into spaces+ targets="$(printf '%s' "$targets" | tr '\n\t' ' ')"
for t in $targets; do
[[ "$t" == //rb* ]] && filtered+=("$t")
done
if [ ${#filtered[@]} -eq 0 ]; then
echo "targets=//rb/spec/..." >> "$GITHUB_OUTPUT"
else
echo "targets=${filtered[*]}" >> "$GITHUB_OUTPUT"
fi
Apply / Chat
Suggestion importance[1-10]: 5
__
Why:
Relevant best practice - Add explicit validation and null/availability guards at integration boundaries by trimming inputs and checking presence before use.
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
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.
User description
🔗 Related Issues
Ruby implementation of #16809
We are mostly relying on RBE to tell us if there is a problem, this is supposed to be extra information that strikes a good balance between information and execution time.
💥 What does this PR do?
ci.ymlkicks off on every commit. It runs the new and improvedcheck-bazel-targets.shInstead of just checking to see if there are any
rbtargets and running the whole ci-ruby workflow, the unique set of applicable test targets are passed from the script toci-ruby.ymland browser tests are only run on thoseAdditionally, docs/steep/unit tests are only run if the PR includes "[rb]" or is executed manually (passed into
ci-ruby.ymlfromci.ymlwith arun-full-suiteargument.Even if tagged
[rb], if only a subset of ruby tests are matched, only those will be runRemoved build instead of gating all tests on it. Most of the build is executed by the applicable tests as necessary. If there is something weird that breaks building, it'll get detected in nightly run
It's now 2 jobs instead of 6, but effective changes are:
Adds chrome-beta-remote/windowsAdds firefox-beta-remote/windowsRemoves Edge Remote WindowsUpdate: fixed so it run edge remote like previously and doesn't run chrome/firefox remote
🔧 Implementation Notes
I'm picking betas instead of production browsers as a way to get additional information earlier. Failures in new browser versions will still be managed in a PR updating them, not in trunk.
💡 Additional Considerations
This probably doesn't decrease the total amount of Ruby testing by enough, so we probably need to add more filters, but I think this is a good place to start.
PR Type
Enhancement, Tests
Description
Implement selective Ruby test filtering based on changed files
Limit test universe to binding roots for faster CI execution
Remove build job and consolidate to two browser test jobs
Filter test targets by
[rb]tag and file changesDiagram Walkthrough
File Walkthrough
check-bazel-targets.sh
Restrict target universe and improve query logicscripts/github-actions/check-bazel-targets.sh
set -euo pipefailci-ruby.yml
Refactor workflow with selective test filtering.github/workflows/ci-ruby.yml
targetsandrun-full-suiteparametersfilter-targetsjob to filter Ruby-specific targetsonly
run-full-suiteinputci.yml
Wire target filtering to Ruby workflow inputs.github/workflows/ci.yml
run-full-suitelogic based on[rb]tag and event type[rb]tag