Skip to content

[CI] Add stale pull request label - #5540

Merged
Boss2002n merged 2 commits into
mainfrom
satya/stale_branch_fix
Oct 7, 2026
Merged

Boss2002n merged 2 commits into
mainfrom
satya/stale_branch_fix

Conversation

@Boss2002n

@Boss2002n Boss2002n commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

actions/stale, daily: a pull request is labelled stale after 15 days without activity; a push or comment clears it. Nothing is closed — days-before-pr-close is -1, since leaving it unset would mean the action's 7-day default. Drafts and PRs labelled do-not-close are exempt. Issues are out of scope. The action is pinned to the v10.4.0 commit.

Branch cleanup is proposed separately, with archival before deletion, in satya/stale_branch_archive

@Boss2002n
Boss2002n requested review from a team and gyohuangxin and a lite review from Copilot September 15, 2026 12:05
@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter op tests (gfx942 + gfx950)
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:gfx1250-ffm-triton Run the five-shard gfx1250 FFM Triton test suite
ci:triton-300x Run an additional Triton test job on MI300X in PRs; main branch always runs both MI35X and MI300X
multigpu Aiter multi-GPU tests on the 8-GPU runner
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: GPT-OSS-120B, DeepSeek-R1-0528, Kimi-K2.5
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 5540 --add-label <label>

PR title tags & labels:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title and as PR labels automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf], op tags like [MLA], and human labels (ci:*) are left untouched. Add the no-auto-title label to opt this PR out.

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.

🟡 Changes recommended

Critical branch-cleanup safety issues and unresolved permission, timing, and exemption-label problems must be addressed.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds automated cleanup for stale pull requests and branches.

Changes:

  • Marks inactive pull requests stale after 30 days and closes them after 7 more days.
  • Warns about stale branches after 60 days and removes them after the grace period.
  • Adds exemptions for selected labels, protected branches, and branches with open pull requests.
File summaries
File Review findings
.github/workflows/stale-prs.yml Moderate: Exemption labels are not currently created or provisioned (1 vote).
.github/workflows/stale-branches.yml Critical: Uses commit author dates instead of last-update timestamps (2 votes); third-party action is mutable-tag referenced (1 vote). Moderate: Missing actions: read permission (2 votes); weekly scheduling extends the effective grace period to roughly 14 days (1 vote).
Review details

Suppressed comments (2)

.github/workflows/stale-branches.yml:41

  • With a weekly Monday schedule, a branch marked stale during one run is usually still just under seven days old at the next Monday check because the comment is posted after the run starts. The v2.4.0 action keeps comments whose timestamp is >= now - days-before-branch-delete, so deletion is then deferred to the following Monday—roughly 14 days after the warning rather than the documented seven. Author must either run this check at least daily during the grace period or explicitly document and accept the longer effective window.
          days-before-branch-stale: 60
          days-before-branch-delete: 7

.github/workflows/stale-prs.yml:32

  • [verified] The repository currently has no keep-open, blocked, do-not-close, or dependencies label, and actions/stale only checks for labels named by exempt-pr-labels; it does not provision those exemption labels. The advertised escape hatch therefore cannot be selected in GitHub until the labels are created, so maintainers may be unable to prevent a PR from being closed. Author must create these labels as part of the repository setup or replace them with existing labels.
          exempt-pr-labels: 'keep-open,blocked,do-not-close,dependencies'
  • Files reviewed: 2/2 changed files
  • Comments generated: 3
  • Review effort level: Lite

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

Comment thread .github/workflows/stale-branches.yml Resolved
Comment thread .github/workflows/stale-branches.yml Resolved
Comment thread .github/workflows/stale-branches.yml Resolved
Copilot AI review requested due to automatic review settings September 15, 2026 12:21
@Boss2002n
Boss2002n force-pushed the satya/stale_branch_fix branch from 5493cd0 to ce93432 Compare September 15, 2026 12:21

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.

🟡 Changes recommended

Resolve the stale-branch timing, throughput, freshness-safety, and action-pinning findings.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (2)

.github/workflows/stale-branches.yml:50

  • [verified] The PR description specifies a 60-day stale threshold for branches, but this input is 30, so branches become eligible for warning/deletion at day 30/37 rather than day 60/67. Author must align the workflow, its comments, and the PR description to one threshold.
    .github/workflows/stale-branches.yml:50
  • [verified] The pinned action defaults operations-per-run to 10, and this workflow does not override it. With the 717 branches described as already past the threshold, each weekly run can perform only 10 mark/remove operations; a clean first run therefore warns 10, deletes 10 the following week, and can take roughly 144 weekly runs to drain the backlog. Author must set an explicit operations-per-run appropriate for the backlog or document this staged rate.
  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread .github/workflows/stale-branches.yml Resolved
Comment thread .github/workflows/stale-prs.yml Resolved
Copilot AI review requested due to automatic review settings September 15, 2026 12:25

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.

🟡 Changes recommended

The branch threshold conflicts with the stated policy, and PR exemption labels are not provisioned.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (2)

.github/workflows/stale-branches.yml:49

  • [verified] docs-website is an explicit push/deploy branch in .github/workflows/docs.yml:7,62, but this exemption omits it. If that branch is unprotected and reaches the stale threshold, this job will delete it and remove a documented way to deploy the docs. Author must exempt docs-website or remove that workflow path if the branch is intentionally disposable.
          exempt-branches-regex: '^(main|master|gh-pages|stable|release/.*|v[0-9].*)$'

.github/workflows/stale-prs.yml:32

  • [verified] None of the four configured exemption labels (keep-open, blocked, do-not-close, dependencies) exists in the repository's current label set, and this workflow does not provision them. Until they are created separately, the advertised label escape hatch is unavailable and a PR cannot use those exemptions. Author must add these labels as part of the change or replace them with labels that already exist.
          exempt-pr-labels: 'keep-open,blocked,do-not-close,dependencies'
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread .github/workflows/stale-branches.yml Resolved
@Boss2002n Boss2002n self-assigned this Sep 15, 2026
Copilot AI review requested due to automatic review settings September 15, 2026 17: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.

🟡 Changes recommended

Unresolved critical and moderate findings affect stale-label provisioning, action integrity, and branch cleanup correctness.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (3)

.github/workflows/stale-branches.yml:44

  • [verified] remove-stale-branches derives the branch age from GitHub's authoredDate, not the timestamp when the tip commit was created/pushed. A branch whose tip is a recent cherry-pick or rebase commit with an author date older than 30 days can therefore be marked here and deleted after 7 days despite recent activity. Author must use a cleanup implementation that evaluates the tip commit's committed/pushed time or add an equivalent recent-commit guard.
          days-before-branch-stale: 30
          days-before-branch-delete: 7

.github/workflows/stale-branches.yml:38

  • ⚠️ [verified] ignore-unknown-authors defaults to false in this action, so its planner skips a branch before stale processing whenever GitHub cannot resolve the latest commit's author. Those branches never receive a warning or get deleted, which makes the stated cleanup incomplete for eligible stale branches. Author must configure an explicit fallback recipient with ignore-unknown-authors: true, or document and verify that unknown-author branches are intentionally exempt.
      - uses: fpicalausa/remove-stale-branches@7c4f2afe88a36c0f9114cd958380979b9d7323fb  # v2.4.0

.github/workflows/stale-prs.yml:24

  • ⚠️ [verified] actions/stale@v10 is a mutable tag, while this workflow grants the action issues: write and pull-requests: write; a tag move or compromise could therefore replace the code that mutates labels, comments, and PR state. The branch cleanup is pinned for this same reason. Author must pin this action to an immutable commit and update it deliberately.
      - uses: actions/stale@v10
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread .github/workflows/stale-prs.yml Resolved
Copilot AI review requested due to automatic review settings September 15, 2026 18:06

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@gyohuangxin

Copy link
Copy Markdown
Member

Could we run the stale branch cleanup in dry-run mode for the first one or two weeks before enabling actual deletion? That would give us time to review the branches it would touch and tune the exemption list if needed. PR closing is reversible, but branch deletion is harder to recover from if we miss an important branch.

Copilot AI review requested due to automatic review settings September 16, 2026 03:34
@Boss2002n
Boss2002n requested review from Copilot and removed request for Copilot September 16, 2026 03:35
@Boss2002n
Boss2002n force-pushed the satya/stale_branch_fix branch from 9b12a2e to 856022b Compare September 16, 2026 03: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.

🟡 Changes recommended

Moderate issues remain in branch age detection, label exemptions, and action pinning.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (2)

.github/workflows/stale-branches.yml:52

  • [verified] The pinned action decides branch age from the tip commit's authoredDate, not its commit/push time. For example, a commit pushed today with an author date 60 days ago is eligible immediately, so this workflow can delete a branch that received a commit within the 30-day window described above. Author must use an implementation/version that bases staleness on the commit time, or otherwise prevent this action from treating newly pushed old-authored commits as stale.
      - uses: fpicalausa/remove-stale-branches@7c4f2afe88a36c0f9114cd958380979b9d7323fb  # v2.4.0

.github/workflows/stale-prs.yml:24

  • This workflow grants the action issues: write and pull-requests: write, but actions/stale@v10 is a mutable tag. The adjacent branch-deletion action is pinned to a full SHA specifically because tags can move; leaving this privileged action tag-pinned allows a later tag retarget to execute unreviewed code with write access and close or modify PRs. Author must pin it to a reviewed full commit SHA.
      - uses: actions/stale@v10
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread .github/workflows/stale-prs.yml Resolved
@gyohuangxin
gyohuangxin requested a review from zufayu September 16, 2026 12:13
Copilot AI review requested due to automatic review settings September 17, 2026 03:41
Copilot AI review requested due to automatic review settings September 18, 2026 04:47
@Boss2002n

Copy link
Copy Markdown
Contributor Author

[ROCm/aiter] PR #5540 — [CI] Add stale pull request and stale branch cleanup

Adds two scheduled GitHub workflows — a daily actions/stale run that labels PRs idle for 15 days and closes them 15 days later, and a weekly remove-stale-branches run that comments on branches idle for 30 days with deletion disabled and commenting gated behind the STALE_BRANCHES_NOTIFY repo variable.

Review (advisory): ⚠️ NEEDS WORK Validation (deterministic): N/A — no runtime surface changed Perf (advisory): N/A — no runtime surface changed

⚠️ [verified] The PR description documents a policy the head code does not ship: it says PRs go stale after 30 days and close 7 days later with four exempt labels (keep-open, blocked, do-not-close, dependencies) and that stale branches are deleted 7 days after the warning, but .github/workflows/stale-prs.yml implements 15/15 days with exempt-pr-labels 'do-not-close,keep-open' and .github/workflows/stale-branches.yml sets days-before-branch-delete: 36500 (never deletes) with commenting gated behind STALE_BRANCHES_NOTIFY — a reviewer approving on the description approves a policy that does not ship, and anyone later aligning the code to it would re-enable branch deletion that exempt-branches-regex does not cover for docs-website, the deploy branch docs.yml runs from. Author must update the PR description to the shipped 15/15, two-label, never-delete policy. ⚠️ [verified] .github/workflows/stale-prs.yml grants actions/stale@v10 — a movable tag — both pull-requests: write and issues: write, while the same PR pins the other write-capable action in .github/workflows/stale-branches.yml to a full SHA and documents why ("a tag can be moved"); a retargeted v10 tag would execute unreviewed code able to close PRs and mutate labels and comments. Author must pin actions/stale to a reviewed full commit SHA, as the branch workflow in this same PR already does. 📝 [verified] .github/workflows/stale-branches.yml leaves ignore-unknown-authors at the pinned action's default (false), which aborts the run early when a commit author cannot be resolved to a GitHub user — with ~700 branches past the threshold, one unresolvable author email stalls the weekly drain mid-list with no failure signal, bounded today only by deletion being unreachable and commenting gated off. Reviewer should ask whether unknown-author branches are intentionally exempt, or set the input explicitly with a default-recipient.

addressed.
:)

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.

🔵 Needs a closer look

The implemented stale/close/delete timings and exemptions in the workflows materially diverge from the PR description and should be reconciled before merging.

Review details

Suppressed comments (5)

Previously missed (2) — in code that hasn't changed since the last review.

.github/workflows/stale-prs.yml:31

  • The PR description says PRs should be marked stale after 30 days and closed 7 days later, but this workflow uses 15/15. Please align these values (or update the PR description) to avoid enforcing a different policy than intended.

This issue also appears in the following locations of the same file:

  • line 46
  • line 51
    .github/workflows/stale-prs.yml:39
  • The PR description lists additional exempt labels (e.g. blocked, dependencies), but the workflow only exempts do-not-close and keep-open. If those labels are meant to protect PRs from auto-close, they need to be included here.

.github/workflows/stale-prs.yml:50

  • This stale warning message is hard-coded to the 15/15 policy; if the intended policy is 30 days to stale and 7 additional days to close (per PR description), update the text so the bot message matches the actual enforcement window.
          stale-pr-message: >
            This pull request has had no activity for 15 days, so it is now
            marked stale. Push a commit, leave a comment, or add the
            `keep-open` label within 15 days to keep it open. Closing is not a
            judgement on the work — reopen it whenever you pick it back up.

.github/workflows/stale-prs.yml:53

  • The close message currently says "Closed after 30 days without activity", which only matches the current 15/15 config; if the intended policy is 30+7 days (per PR description), update this message to reflect the true close timing.
          close-pr-message: >
            Closed after 30 days without activity. The branch is untouched;
            reopen this pull request when the work resumes.

.github/workflows/stale-branches.yml:60

  • The PR description says stale branches should be deleted 7 days after the initial 30-day warning, but this workflow sets days-before-branch-delete to 36500, making deletion effectively unreachable. Please reconcile the implementation with the described policy (either change the config and comments to enable deletion, or update the PR description to state that this workflow is warning-only).
          days-before-branch-stale: 30
          # Effectively never; read the note at the top before changing it.
          days-before-branch-delete: 36500
          # Upstream's 10 is a standstill here: ~700 branches are past 30
  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 20, 2026 15:10

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.

Copilot review overview

🟡 Changes recommended

The implemented workflow behavior (timing, exemptions, and branch deletion policy) has multiple mismatches with the PR description that should be reconciled before merge.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 3 Medium severity

Open (3)

Comment thread .github/workflows/stale-branches.yml Resolved
Comment thread .github/workflows/stale-prs.yml Resolved
Comment thread .github/workflows/stale-prs.yml Resolved
@zufayu

zufayu commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Thanks for the safety improvements. Disabling branch deletion by default, protecting open-PR/protected/release branches, and pinning the actions are good changes.

I would still hold this PR:

  • Stale PR handling and branch lifecycle management should be separate PRs with independently reviewed policies.
  • The workflow implements a 15-day stale period plus 15 days before automatic closure, while the PR description says 30+7 days. The documented and implemented exemption labels also differ.
  • The branch workflow does not implement the previous cleanup guarantees: 90 days of inactivity, two weeks’ notice, protection for open PR head/base branches, and archival before deletion.
  • Enabling notifications could immediately generate comments across roughly 700 old branches.

Please keep this PR limited to stale PR labeling, with automatic closure disabled for now. Move branch cleanup to a separate proposal that includes an explicit archival and recovery design, and make the documented policy match the implementation exactly.

actions/stale, daily: a pull request is labelled `stale` after 15 days without
activity; any push or comment clears it. Nothing is closed -- -1, since leaving
it unset would mean the action's 7-day default. Drafts and PRs labelled
keep-open, blocked, do-not-close or dependencies are exempt. Issues are out of
scope. Pinned to the v10.4.0 commit.

Branch cleanup is proposed separately, with archival before deletion, on
satya/stale_branch_archive.
Copilot AI review requested due to automatic review settings September 22, 2026 12:59
@Boss2002n
Boss2002n force-pushed the satya/stale_branch_fix branch from b43d835 to 461e969 Compare September 22, 2026 12:59

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.

Copilot review overview

🟡 Changes recommended

The workflow’s stale/close timings and messaging are inconsistent with the PR description and should be aligned before approval.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 Medium severity · 1 Low severity

Open (3)
Resolved since last review (1)

Comment thread .github/workflows/stale-prs.yml Resolved
@Boss2002n

Copy link
Copy Markdown
Contributor Author

Thanks for the safety improvements. Disabling branch deletion by default, protecting open-PR/protected/release branches, and pinning the actions are good changes.

I would still hold this PR:

  • Stale PR handling and branch lifecycle management should be separate PRs with independently reviewed policies.
  • The workflow implements a 15-day stale period plus 15 days before automatic closure, while the PR description says 30+7 days. The documented and implemented exemption labels also differ.
  • The branch workflow does not implement the previous cleanup guarantees: 90 days of inactivity, two weeks’ notice, protection for open PR head/base branches, and archival before deletion.
  • Enabling notifications could immediately generate comments across roughly 700 old branches.

Please keep this PR limited to stale PR labeling, with automatic closure disabled for now. Move branch cleanup to a separate proposal that includes an explicit archival and recovery design, and make the documented policy match the implementation exactly.

addressed

@brunomazzottiamd brunomazzottiamd 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.

What should we do with this PR? The last comment states that the suggestions are addressed, and it's from last week.

leo-automation
leo-automation previously approved these changes Oct 2, 2026

@leo-automation leo-automation left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: The PR needs title and desc updated

Comment thread .github/workflows/stale-prs.yml Resolved
@brunomazzottiamd

Copy link
Copy Markdown
Contributor

nit: The PR needs title and desc updated

This isn't a nitpick IMHO, it's a good practice. The worst situation is when you have to dig thought ancient PRs to understand what happened and find outdated / unreliable information...

Updated exempt PR labels to only include 'do-not-close'.
Copilot AI lite review requested due to automatic review settings October 2, 2026 20:31
@Boss2002n Boss2002n changed the title [CI] Add stale pull request and stale branch cleanup [CI] Add stale pull request label Oct 2, 2026

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.

Copilot review overview

🟡 Changes recommended

Correct the exemption label in the notification.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
Resolved since last review (3)

Comment thread .github/workflows/stale-prs.yml Resolved
@Boss2002n
Boss2002n merged commit e4ceb9d into main Oct 7, 2026
@Boss2002n
Boss2002n deleted the satya/stale_branch_fix branch October 7, 2026 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants