Skip to content

Conversation

@gioboa
Copy link
Collaborator

@gioboa gioboa commented Sep 16, 2025

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

  • Code is up-to-date with the master branch

Summary by CodeRabbit

  • Chores
    • Added an automated workflow to mark issues stale after 180 days and close them immediately thereafter.
    • Stale issues are labeled "stale"; "pinned" and "security" issues are exempt.
    • Close message provides backlog-cleanup context, a leadership update, and invites reopening if still relevant.
    • Workflow can be triggered manually for maintenance.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 16, 2025

Walkthrough

Adds a new GitHub Actions workflow .github/workflows/close-stale-issues.yml that marks issues stale after 180 days and immediately closes them (unless exempted by labels); it is manually triggerable, runs actions/stale@v10 with issues: write, and uses an empty stale message and a multi-line close message.

Changes

Cohort / File(s) Summary of changes
GitHub Actions workflow: Close stale issues
.github/workflows/close-stale-issues.yml
Added new workflow Close Stale Issues (workflow_dispatch) with a job on ubuntu-latest (permissions: issues: write) using actions/stale@v10 configured days-before-stale: 180, days-before-close: 0, days-before-pr-stale: -1, days-before-pr-close: -1, stale-issue-label: "stale", exempt-issue-labels: "pinned,security", an empty stale-issue-message, and a multi-line close-issue-message referencing leadership/backlog cleanup and inviting reopening.

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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

I twitch my whiskers, sweep the thread,
Six months of silence, softly said.
A tiny broom, a courteous close,
Reopen the door if the thought still grows. 🐇🧹

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "ci: add close stale issues GH action" succinctly and accurately describes the primary change—adding a GitHub Actions workflow to close stale issues—and is concise and relevant enough for a teammate scanning PR history.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0e523dd and c13e081.

📒 Files selected for processing (1)
  • .github/workflows/close-stale-issues.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/close-stale-issues.yml
⏰ 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) / cockroachdb
  • GitHub Check: tests-linux (20) / sap
  • GitHub Check: tests-linux (20) / postgres (14-3.5)
  • GitHub Check: tests-linux (20) / oracle
  • GitHub Check: tests-linux (20) / postgres (17-3.5)
  • GitHub Check: tests-linux (20) / mysql_mariadb_latest
  • GitHub Check: tests-linux (20) / mysql_mariadb
  • GitHub Check: tests-linux (18) / mysql_mariadb_latest
  • GitHub Check: tests-linux (20) / mongodb
  • GitHub Check: tests-linux (18) / postgres (17-3.5)
  • GitHub Check: tests-linux (18) / postgres (14-3.5)
  • GitHub Check: tests-linux (18) / sqlite
  • GitHub Check: tests-linux (18) / oracle
  • GitHub Check: tests-linux (18) / better-sqlite3
  • GitHub Check: tests-linux (18) / sqljs
  • GitHub Check: tests-linux (18) / mssql
  • GitHub Check: tests-windows / sqljs
  • GitHub Check: tests-windows / sqlite
  • GitHub Check: tests-windows / better-sqlite3
  • GitHub Check: Analyze (javascript-typescript)

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 stale

Inputs overview shows separate issue/PR knobs. (github.com)


17-22: Provide a close message and align to US English.

  • Empty close-issue-message means 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-run is 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: 500

Docs explain rate‑limit tradeoffs. (github.com)

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6e92aad and 5df3735.

📒 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: 0 will 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

Copy link
Collaborator

@sgarner sgarner left a comment

Choose a reason for hiding this comment

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

Thanks @gioboa 🙌

gioboa and others added 2 commits September 16, 2025 23:28
Co-authored-by: Simon Garner <simon@equalogic.com>
@gioboa
Copy link
Collaborator Author

gioboa commented Sep 16, 2025

@sgarner
I did a test in this repo
it's working fine with one execution.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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: true

Ops limit and sorting options per action docs. (github.com)

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b8aa796 and cb43255.

📒 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: true

Docs 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.

@gioboa gioboa requested a review from sgarner September 16, 2025 21:47
@coveralls
Copy link

coveralls commented Sep 17, 2025

Coverage Status

coverage: 76.39%. first build
when pulling 0e523dd on gioboa:ci/stale-issues
into fa3cd43 on typeorm:master.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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: -1 and granting only issues: write aligns 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: 500

Note: 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

📥 Commits

Reviewing files that changed from the base of the PR and between cb43255 and 0e523dd.

📒 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 grace

actions/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.

Copy link
Collaborator

@sgarner sgarner left a 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>
@gioboa gioboa merged commit 93aa5c4 into typeorm:master Sep 17, 2025
15 of 64 checks passed
@gioboa gioboa deleted the ci/stale-issues branch September 17, 2025 13:25
gioboa added a commit that referenced this pull request Sep 30, 2025
ThbltLmr pushed a commit to ThbltLmr/typeorm that referenced this pull request Dec 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants