Skip to content

ci: treat ci labels as persistent gate switches#1536

Merged
gyohuangxin merged 1 commit into
mainfrom
ci/persistent-ci-label-gate
Jul 9, 2026
Merged

ci: treat ci labels as persistent gate switches#1536
gyohuangxin merged 1 commit into
mainfrom
ci/persistent-ci-label-gate

Conversation

@gyohuangxin

Copy link
Copy Markdown
Member

Summary

  • Treat ci:* labels as persistent gate switches instead of one-shot label events.
  • Update the CI Guide wording to say heavy jobs run when a matching ci:* label is present.

This fixes cases where a PR has multiple labels, e.g. ci:atom, ci:vllm, and ci:sglang, but only the workflow matching the most recently added label passes the gate.

Test Plan

  • bash -n .github/scripts/check_heavy_ci_gate.sh
  • git diff --check
  • Parsed .github/workflows/pr-welcome-comment.yaml with PyYAML
  • Mocked a labeled event where the newly added label is ci:sglang, while the PR already has ci:atom; ATOM Test gate returns should_run=true reason=label-present

Copilot AI review requested due to automatic review settings July 9, 2026 08:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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.sh that checks the PR’s current labels (with a gh api fallback 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
@gyohuangxin gyohuangxin merged commit 0bdcea6 into main Jul 9, 2026
32 of 61 checks passed
@gyohuangxin gyohuangxin deleted the ci/persistent-ci-label-gate branch July 9, 2026 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants