Skip to content

Conversation

@nv-anants
Copy link
Contributor

@nv-anants nv-anants commented Jun 10, 2025

add github workflow to automatically close stale issues (bugs) and PRs

  • Closes bug issues after 30 days of inactivity with 5-day warning
  • Closes stale PRs after 30 days of inactivity with 5-day warning
  • Runs daily at 1:30 AM PST
  • Deletes associated branches when closing PRs
  • Allows users to reopen if still relevant

closes: OPS-199

Summary by CodeRabbit

  • Chores
    • Introduced automated management for inactive issues and pull requests. Issues labeled "bug" and all pull requests are now marked as stale after 30 days of inactivity, with automatic closure and branch deletion (for PRs) after an additional 5 days. Users will receive clear notifications regarding stale status and closures.

@github-actions github-actions bot added the ci Issues/PRs that reference CI build/test label Jun 10, 2025
@nv-anants nv-anants changed the title ci: add github workflow to automatically close stale issues and PRs ci: add github workflow to close stale issues (bugs) and PRs Jun 10, 2025
@nv-anants nv-anants marked this pull request as ready for review June 10, 2025 15:48
@nv-anants nv-anants requested review from a team and nnshah1 as code owners June 10, 2025 15:48
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 10, 2025

"""

Walkthrough

A new GitHub Actions workflow file has been added to automate the process of marking and closing stale issues and pull requests. The workflow runs daily, applies inactivity rules, posts warning messages, closes items after further inactivity, and deletes branches for stale pull requests.

Changes

File(s) Change Summary
.github/workflows/stale_cleaner.yml Added workflow to automatically mark, warn, close, and clean up stale issues and pull requests.

Poem

The garden of issues, once wild and dense,
Now pruned each morning, with logic immense.
Old bugs and PRs, asleep in the dew,
Get gentle reminders—"Is this still for you?"
If silence persists, they quietly close,
While branches retire for a well-earned repose.
🐇✨
"""


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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

🧹 Nitpick comments (2)
.github/workflows/stale_cleaner.yml (2)

13-17: Clarify time zone handling in cron schedule
The comment says “1:30 AM PST,” but GitHub Actions cron expressions run in UTC. Consider updating the comment to reflect UTC (09:30 UTC) or note any daylight-saving implications (PDT vs PST).


37-37: Add newline at end of file
Ensure the file ends with a newline to satisfy YAML linting and POSIX standards.

🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 37-37: no new line character at the end of file

(new-line-at-end-of-file)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 47c3dad and c61393b.

📒 Files selected for processing (1)
  • .github/workflows/stale_cleaner.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/stale_cleaner.yml

[warning] 30-30: wrong indentation: expected 10 but found 12

(indentation)


[error] 37-37: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (3)
.github/workflows/stale_cleaner.yml (3)

1-11: License header and context comments look good
The SPDX identifiers and explanatory comments clearly document the workflow’s purpose and licensing.


18-23: Permissions are appropriately scoped
The workflow grants only the necessary write permissions for actions, contents (for branch deletion), issues, and pull-requests.


24-27: Job definition is clear and minimal
The stale job is correctly configured to run on ubuntu-latest with a single step invoking the stale action.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Anant Sharma <anants@nvidia.com>
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

🧹 Nitpick comments (2)
.github/workflows/stale_cleaner.yml (2)

28-29: Explicitly supply repo-token to the action.
Although actions/stale defaults to ${{ secrets.GITHUB_TOKEN }}, it's best practice to declare it explicitly for clarity and future compatibility.

Apply this diff:

-      - uses: actions/stale@v9
-        with:
+      - uses: actions/stale@v9
+        with:
+          repo-token: ${{ secrets.GITHUB_TOKEN }}
           stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.'

37-37: Add newline at end of file.
A trailing newline is required by POSIX and some linters.

🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 37-37: no new line character at the end of file

(new-line-at-end-of-file)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c61393b and cf1b875.

📒 Files selected for processing (1)
  • .github/workflows/stale_cleaner.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/stale_cleaner.yml

[error] 37-37: no new line character at the end of file

(new-line-at-end-of-file)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build and Test - vllm
🔇 Additional comments (4)
.github/workflows/stale_cleaner.yml (4)

1-11: The SPDX header and descriptive comments are clear and correctly present.


13-17: Verify cron schedule uses UTC vs PST.
GitHub Actions cron triggers always run in UTC, so 30 9 * * * fires at 09:30 UTC (1:30 AM PST). This will shift to 2:30 AM PDT during daylight-saving. Please confirm this aligns with the intended local schedule.


18-23: The job-level permissions for actions, contents, issues, and pull-requests are correctly scoped for this workflow.


24-27: The jobs.stale and its runner configuration are straightforward and have no issues.

@nv-tusharma
Copy link
Contributor

LGTM!

@nv-anants nv-anants merged commit e8e728b into main Jun 10, 2025
11 checks passed
@nv-anants nv-anants deleted the anants/stale-cleaner branch June 10, 2025 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Issues/PRs that reference CI build/test size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants