-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
ci: add close stale issues GH action #11651
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdds a new GitHub Actions workflow Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Maintainer
participant GitHub
participant Workflow as close-stale-issues
participant Stale as actions/stale@v10
participant Issues as GitHub Issues
Maintainer->>GitHub: Trigger workflow_dispatch
GitHub->>Workflow: Start job (ubuntu-latest, issues: write)
Workflow->>Stale: Run with config (180d stale, 0d close, PR checks disabled, labels, messages)
Stale->>Issues: Find issues inactive >= 180 days
alt Exempt (labels: pinned or security)
Stale->>Issues: Skip labeling/closing
else Not exempt
Stale->>Issues: Add "stale" label (no stale message)
Stale->>Issues: Post close message and close issue immediately
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (5)
.github/workflows/close-stale-issues.yml (5)
3-5: One‑shot vs ongoing: do you also want a scheduled run?Right now it’s manual only (
workflow_dispatch). If you want continuous hygiene, add a cron. If this is intentionally a one‑time cleanup, ignore.on: + schedule: + - cron: '30 1 * * *' # daily at 01:30 UTC workflow_dispatch:The stale action is typically scheduled to iterate over backlogs. (github.com)
9-11: Scope limited to issues? Make it explicit to avoid PR side‑effects.You set only
issues: write. That’s fine if PRs are out of scope, but the action can process both unless configured otherwise. Consider explicitly disabling PR closure to avoid surprises.- uses: actions/stale@v10 with: days-before-stale: 180 # 6 months days-before-close: 0 + days-before-pr-close: -1 + stale-pr-message: "" # do not mark PRs staleInputs overview shows separate issue/PR knobs. (github.com)
17-22: Provide a close message and align to US English.
- Empty
close-issue-messagemeans the close event may have no explanation comment. Add a brief close message.- Minor copy tweak: “prioritise” → “prioritize” (US locale).
stale-issue-message: > TypeORM has returned to active development after recently transitioning to new leadership ([see related announcement](https://typeorm.io/docs/future-of-typeorm/)). - As part of the new team's efforts to prioritise work on the project moving forward, it is necessary to clean up the backlog of stale issues. + As part of the new team's efforts to prioritize work on the project moving forward, it is necessary to clean up the backlog of stale issues. 🧹 This issue is being automatically closed because it has had no activity in the last 6 months. If you believe this issue is still relevant, feel free to comment below and the maintainers may reopen it. Thank you for your contribution. - close-issue-message: "" + close-issue-message: > + Closing as part of a one-time backlog cleanup after 6+ months of inactivity. If this is still relevant, please comment and maintainers can reopen. Thank you!Close/stale message behaviors are documented. (github.com)
23-24: Label casing and exemptions — verify repository conventions.
stale-issue-label: "stale"will create/use a lowercase label; the action’s default is “Stale”. Ensure this matches existing labels to avoid duplication.- Consider whether other labels (e.g., “help wanted”, “good first issue”, “roadmap”, team triage labels) should be exempt.
Reference list of label options. (github.com)
12-24: Large backlog? Consider bumping the per‑run operation cap.Default
operations-per-runis 30. TypeORM has a big issue set; increasing this (e.g., 300–1000) can reduce the number of re‑runs, at the cost of higher short‑burst API usage. Optional.with: days-before-stale: 180 # 6 months days-before-close: 0 + operations-per-run: 500Docs explain rate‑limit tradeoffs. (github.com)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/close-stale-issues.yml(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
- GitHub Check: tests-linux (20) / oracle
- GitHub Check: tests-linux (20) / sqljs
- GitHub Check: tests-linux (20) / sqlite
- GitHub Check: tests-linux (20) / sap
- GitHub Check: tests-linux (20) / better-sqlite3
- GitHub Check: tests-linux (18) / sqljs
- GitHub Check: tests-linux (20) / mongodb
- GitHub Check: tests-linux (20) / mssql
- GitHub Check: tests-linux (18) / mssql
- GitHub Check: tests-linux (18) / postgres (14-3.5)
- GitHub Check: tests-linux (18) / postgres (17-3.5)
- GitHub Check: tests-linux (18) / mongodb
- GitHub Check: tests-linux (18) / sqlite
- GitHub Check: tests-linux (18) / oracle
- GitHub Check: tests-linux (18) / sap
- GitHub Check: tests-linux (18) / better-sqlite3
- GitHub Check: tests-windows / sqljs
- GitHub Check: tests-windows / sqlite
- GitHub Check: tests-windows / better-sqlite3
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (2)
.github/workflows/close-stale-issues.yml (2)
15-16: Immediate close on detection — confirm intent.
days-before-close: 0will close items in the same run they’re labeled stale. This is aggressive but aligns with a one‑time purge. Please confirm this is intended.Docs describe the close timers and per‑type overrides. (github.com)
13-13: Pin the action to the v10 commit SHA (supply-chain hardening).- - uses: actions/stale@v10 + - uses: actions/stale@3a9db7e6a41a89f618792c92c0e97cc736e1b13f # v10
sgarner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @gioboa 🙌
Co-authored-by: Simon Garner <simon@equalogic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (1)
.github/workflows/close-stale-issues.yml (1)
19-24: Message content/formatting looks good and addresses prior feedback.Paragraph spacing and tone are clear and aligned with the intent to close.
🧹 Nitpick comments (3)
.github/workflows/close-stale-issues.yml (3)
25-25: Normalize stale label casing to avoid creating a second label.Default is “Stale”. Using lowercase will create/use a different label (“stale”). Align with the default to reduce label sprawl.
- stale-issue-label: "stale" + stale-issue-label: "Stale"Reference defaults. (github.com)
3-8: Add a concurrency group to prevent overlapping manual runs.Prevents double-processing if someone triggers multiple runs.
on: workflow_dispatch: +concurrency: + group: close-stale-issues + cancel-in-progress: true + jobs: close-stale-issues:
12-26: Increase throughput and process oldest first for backlog cleanup.Default ops-per-run is 30; raising it reduces the number of reruns. Also sort/process oldest first to retire the deepest backlog sooner.
- uses: actions/stale@v10 with: days-before-stale: 180 # 6 months days-before-close: 0 stale-issue-message: "" + operations-per-run: 500 + sort-by: updated + ascending: trueOps limit and sorting options per action docs. (github.com)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/close-stale-issues.yml(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
- GitHub Check: tests-linux (18) / mysql_mariadb
- GitHub Check: tests-linux (18) / mssql
- GitHub Check: tests-linux (20) / mssql
- GitHub Check: tests-linux (20) / better-sqlite3
- GitHub Check: tests-linux (20) / sqljs
- GitHub Check: tests-linux (20) / cockroachdb
- GitHub Check: tests-linux (20) / sqlite
- GitHub Check: tests-linux (20) / mongodb
- GitHub Check: tests-linux (20) / mysql_mariadb
- GitHub Check: tests-linux (20) / oracle
- GitHub Check: tests-windows / sqljs
- GitHub Check: tests-windows / sqlite
- GitHub Check: tests-windows / better-sqlite3
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (2)
.github/workflows/close-stale-issues.yml (2)
15-18: Confirm immediate-close behavior; consider a dry run first.With
days-before-close: 0, closure may occur in the same run (timer measured from labeling time). Recommend a one-off dry run to validate behavior on a subset before mass closure.Apply temporarily, then remove:
with: days-before-stale: 180 # 6 months days-before-close: 0 + debug-only: trueDocs on close timing and debug mode. (github.com)
26-26: Verify 'pinned' and 'security' labels exist and are applied.github/workflows/close-stale-issues.yml (line 26) sets exempt-issue-labels: "pinned,security" — confirm both labels exist in the repo and are applied as intended; add the labels or update the workflow if missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (1)
.github/workflows/close-stale-issues.yml (1)
9-11: Good fix: PR handling explicitly disabled while keeping minimal permissions.Setting
days-before-pr-stale/close: -1and granting onlyissues: writealigns with the workflow’s scope and avoids PR permission errors flagged earlier.Also applies to: 17-18
🧹 Nitpick comments (2)
.github/workflows/close-stale-issues.yml (2)
20-26: Use literal block (|) for message to preserve line breaks exactly.
>folds line breaks;|keeps them as-is, ensuring Markdown spacing stays identical to what you see here.- close-issue-message: > + close-issue-message: | TypeORM has returned to active development after recently transitioning to new leadership ([see related announcement](https://typeorm.io/docs/future-of-typeorm/)). As part of the new team's efforts to prioritise work on the project moving forward, it is necessary to clean up the backlog of stale issues. 🧹 This issue is being automatically closed because it has had no activity in the last 6 months. If you believe this issue is still relevant, feel free to comment below and the maintainers may reopen it. Thank you for your contribution.
6-11: Add concurrency guard and tune batch size for large backlogs.Prevent overlapping manual runs and speed up each run while staying under API limits.
jobs: close-stale-issues: runs-on: ubuntu-latest + concurrency: + group: stale-issues + cancel-in-progress: true permissions: issues: write @@ with: days-before-stale: 180 # 6 months days-before-close: 0 + operations-per-run: 500Note: Adjust
operations-per-run(e.g., 200–1000) to balance throughput vs. API throttling.Also applies to: 12-13, 15-16
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/close-stale-issues.yml(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
- GitHub Check: tests-linux (18) / postgres (17-3.5)
- GitHub Check: tests-linux (18) / sqlite
- GitHub Check: tests-linux (18) / sqljs
- GitHub Check: tests-linux (18) / mysql_mariadb_latest
- GitHub Check: tests-windows / better-sqlite3
- GitHub Check: tests-windows / sqlite
- GitHub Check: tests-linux (18) / mysql_mariadb
- GitHub Check: tests-linux (18) / mssql
- GitHub Check: tests-windows / sqljs
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (2)
.github/workflows/close-stale-issues.yml (2)
12-13: Add close-issue-reason input (supported in actions/stale@v10 — upstream bug may ignore it)Input name: close-issue-reason; valid values: completed or not_planned (default: not_planned). actions/stale@v10 exposes this input, but there are reported bugs where the chosen reason is ignored and issues close as "completed". Update the actions/stale@v10 step in .github/workflows/close-stale-issues.yml (lines 12–13; also applies to 15–26) if you still want to set it, but verify behavior upstream before relying on it.
15-16: Correction — actions/stale@v10 does NOT close newly-staled issues in the same run; consider a 7-day graceactions/stale@v10 updates an issue's updated_at when it marks an issue stale, and days-before-close is calculated from that timestamp — newly-staled items won't be closed until a subsequent run. If you want a community-friendlier flow, use a short grace period and add a message:
days-before-stale: 180 # 6 months - days-before-close: 0 + days-before-close: 7 - stale-issue-message: "" + stale-issue-message: | + TypeORM has returned to active development after recently transitioning to new leadership ([see related announcement](https://typeorm.io/docs/future-of-typeorm/)). + + As part of the new team's efforts to prioritise work on the project moving forward, it is necessary to clean up the backlog of stale issues. + + 👉 This issue has had no activity in the last 6 months and may be closed in 7 days. If you believe this issue is still relevant, please post a comment explaining why it's important to you.Also applies to: 19-26
Likely an incorrect or invalid review comment.
sgarner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @gioboa 👏
Co-authored-by: Simon Garner <simon@equalogic.com>
TypeORM has returned to active development after recently transitioning to new leadership (see related announcement).
As part of the new team's efforts to prioritise work on the project moving forward, it is necessary to clean up the backlog of stale issues.
Description of change
Pull-Request Checklist
masterbranchSummary by CodeRabbit