ci: treat ci labels as persistent gate switches#1536
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the heavy-CI gating logic so that ci:* labels act as persistent “run” switches (based on the PR’s current label set), rather than depending on the most recently added label event. It also aligns the PR welcome comment wording with the updated behavior.
Changes:
- Update the CI Guide text to state heavy jobs run when a matching
ci:*label is present. - Add label discovery logic in
check_heavy_ci_gate.shthat checks the PR’s current labels (with agh apifallback when labels aren’t available in the event payload). - Switch the gate decision from “labeled event matches” to “any allowed label currently present”.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| .github/workflows/pr-welcome-comment.yaml | Updates CI Guide wording to describe label presence as the heavy-job gate condition. |
| .github/scripts/check_heavy_ci_gate.sh | Implements persistent label-based gating by scanning current PR labels (and falling back to GitHub API when needed). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
196
to
+200
| OWNER="${REPO%%/*}" | ||
| NAME="${REPO#*/}" | ||
|
|
||
| if [ "${ACTION}" = "labeled" ] && label_is_allowed "${EVENT_LABEL}"; then | ||
| emit_decision "true" "manual-label" "${EVENT_LABEL}" | ||
| MATCHED_LABEL="$(find_allowed_pr_label || true)" | ||
| if [ -n "${MATCHED_LABEL}" ]; then |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
ci:*labels as persistent gate switches instead of one-shot label events.ci:*label is present.This fixes cases where a PR has multiple labels, e.g.
ci:atom,ci:vllm, andci:sglang, but only the workflow matching the most recently added label passes the gate.Test Plan
bash -n .github/scripts/check_heavy_ci_gate.shgit diff --check.github/workflows/pr-welcome-comment.yamlwith PyYAMLlabeledevent where the newly added label isci:sglang, while the PR already hasci:atom;ATOM Testgate returnsshould_run=true reason=label-present