Skip to content

Skip duplicate heavy CI runs for same PR SHA - #1920

Open
gyohuangxin wants to merge 3 commits into
mainfrom
gyohuangxin/skip-duplicate-heavy-ci
Open

Skip duplicate heavy CI runs for same PR SHA#1920
gyohuangxin wants to merge 3 commits into
mainfrom
gyohuangxin/skip-duplicate-heavy-ci

Conversation

@gyohuangxin

Copy link
Copy Markdown
Member

Summary

  • add duplicate-run detection to the shared heavy CI gate script
  • skip heavy CI when the same workflow already has a successful heavy job for the same PR head SHA
  • wire the check into ATOM, ATOM vLLM, and ATOM SGLang heavy CI workflows

Details

The duplicate check looks at prior successful runs of the same workflow file for the current PR head SHA, then verifies that a real heavy job succeeded before skipping. This avoids treating gate-only/skipped workflow runs as duplicates.

Testing

  • bash -n .github/scripts/check_heavy_ci_gate.sh
  • git diff --check
  • locally simulated PR 1916 pull_request_review event and verified it returns should_run=false with reason duplicate-successful-run when the same SHA already had a successful vLLM heavy run
  • locally simulated a labeled event with an unseen SHA and verified it still returns should_run=true with reason label-present

Copilot AI lite review requested due to automatic review settings August 17, 2026 07:32
@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every eligible PR before approval:

  • ✅ Pre Checkin: Black, Ruff, catalog schema validation, non-GPU unit tests

Heavy model tests:

  • ✅ Run after the PR is approved and Pre Checkin passes
  • ✅ Run immediately when an approval review is submitted
  • ✅ Can be requested before approval with labels
Label Tests
ci:full Run all heavy PR model tests: native ATOM, vLLM, and SGLang
ci:atom Run native ATOM model accuracy tests
ci:vllm Run ATOM vLLM OOT model accuracy tests
ci:sglang Run ATOM SGLang model accuracy tests

Heavy jobs are skipped when the PR is not approved and no matching ci:* label is present.
Add labels via the sidebar or gh pr edit 1920 --add-label <label>

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 enhances the shared heavy CI gate to detect and skip duplicate heavy workflow executions for the same PR head SHA when an earlier run of the same workflow already completed successfully with a real “heavy” job.

Changes:

  • Add duplicate-successful-run detection to .github/scripts/check_heavy_ci_gate.sh by querying prior successful workflow runs for the same head_sha and validating that a matching heavy job succeeded.
  • Update ATOM / vLLM / SGLang heavy CI workflows to grant actions: read and to configure CI_GATE_DUPLICATE_SUCCESS_JOB_PATTERN for identifying successful heavy jobs.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/atom-vllm-test.yaml Adds actions: read and configures the duplicate-success job name regex for vLLM heavy runs.
.github/workflows/atom-test.yaml Adds actions: read and configures the duplicate-success job name regex for ATOM heavy runs.
.github/workflows/atom-sglang-test.yaml Adds actions: read and configures the duplicate-success job name regex for SGLang heavy runs.
.github/scripts/check_heavy_ci_gate.sh Implements duplicate-successful-run detection and emits the duplicate run URL in outputs/summary.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/atom-test.yaml Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 17, 2026 07:39

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Suppressed comments (2)

.github/workflows/atom-test.yaml:74

  • The duplicate-run detector is configured to treat a prior successful "Offline inference smoke test" job as evidence of a prior heavy run. Since that job is intentionally ungated (runs even when the gate is closed), this can incorrectly suppress the later gated Accuracy job for the same SHA when a label/approval arrives. Limit the pattern to gated heavy jobs (e.g., Accuracy) so gate-only runs are not considered duplicates.
          CI_GATE_LABELS: ci:full,ci:atom
          CI_GATE_DUPLICATE_SUCCESS_JOB_PATTERN: '^(Offline inference smoke test|Accuracy)($| \(| / )'
          CI_GATE_PATHS_IGNORE: |

.github/scripts/check_heavy_ci_gate.sh:145

  • The workflow-runs query relies on status=success, which is not consistently supported as a filter for this endpoint and can also allow in-progress runs to be considered if the filter is ignored. That can cause the duplicate check to silently stop working (API error) or to skip heavy CI based on a partially completed run. Instead, fetch recent runs and filter by .status=="completed" and .conclusion=="success" in jq (and consider raising per_page to reduce false negatives).
  echo "Checking for prior successful ${workflow_file} heavy CI run on head SHA ${head_sha}..."
  if ! run_rows="$(
    gh api "repos/${REPO}/actions/workflows/${workflow_file}/runs" \
      --method GET \
      -F "head_sha=${head_sha}" \
      -F "status=success" \
      -F "per_page=20" \
      --jq ".workflow_runs[] | select(.id != ${current_run_id}) | [.id, .event, .html_url] | @tsv"

Copilot AI review requested due to automatic review settings August 17, 2026 07:52

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Suppressed comments (1)

.github/workflows/atom-test.yaml:73

  • CI_GATE_DUPLICATE_SUCCESS_JOB_PATTERN is set to ^Accuracy \(, but in this workflow the heavy job name is exactly Accuracy (no parentheses). As a result, duplicate successful runs for the same PR SHA will never be detected for atom-test.yaml, and heavy CI will still run redundantly.
          CI_GATE_DUPLICATE_SUCCESS_JOB_PATTERN: '^Accuracy \('

@zufayu
zufayu requested a review from valarLip August 18, 2026 02:39
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.

3 participants