Skip to content

Conversation

@ocetars
Copy link
Member

@ocetars ocetars commented Dec 29, 2025

Motivation / 动机:

为项目添加自动化 Issue 管理功能。随着项目发展,Issue 数量不断增加,一些长期未解决的 bug 可能被遗忘或失去关注。通过引入 stale workflow,可以自动识别和处理长时间不活跃的 bug issue,提高项目维护效率。

解决的问题:

  • 自动标记90天无活动的 bug issue 为 stale 状态
  • 30天后自动关闭仍无活动的 stale issue
  • 避免重要 bug 被遗忘,同时清理无效/过时的 issue
  • 支持手动触发和预览模式,便于维护者控制
  • 提供友好的中英双语提示,改善用户体验

Modifications / 改动点

新增文件:

  • .github/workflows/stale.yml - 新增 GitHub Actions stale workflow

实现的功能:

  • 🎯 精确目标管理:仅处理带有 bug 标签的 Issue,不干扰其他类型 Issue 或 PR

  • 智能时间策略:90天无活动标记为 stale,额外30天观察期后自动关闭

  • 🔄 自动恢复机制:启用 remove-stale-when-updated,Issue 有新活动时自动移除 stale 标签

  • 🌍 双语支持:提供中英双语的标记和关闭消息模板

  • 🛠️ 调试友好:支持 workflow_dispatch 手动触发和 dry-run 预览模式

  • This is NOT a breaking change. / 这不是一个破坏性变更。

Screenshots or Test Results / 运行截图或测试结果

验证步骤:

  1. ✅ 检查 workflow 文件语法正确,无 YAML 格式错误
  2. ✅ 验证 dry-run 模式能正确预览将要处理的 Issue
  3. ✅ 确认只处理带有 bug 标签的 Issue

Checklist / 检查清单

  • 😊 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。/ If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
  • 👀 我的更改经过了良好的测试,并已在上方提供了"验证步骤"和"运行截图"。/ My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
  • 🤓 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到了 requirements.txtpyproject.toml 文件相应位置。/ I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in requirements.txt and pyproject.toml.
  • 😮 我的更改没有引入恶意代码。/ My changes do not introduce malicious code.

Summary by Sourcery

配置一个自动化的 GitHub Actions 工作流,用于给长期未活动的缺陷(bug)问题打标并关闭。

New Features:

  • 引入一个定时运行的 stale 工作流,仅针对标记为 bug 的 Issue,并排除 Pull Request。
  • 添加手动触发的 workflow_dispatch 支持,并提供可选的 dry-run 模式,用于预览 stale 处理行为。

Enhancements:

  • 定义用于标记和关闭陈旧缺陷问题的未活动阈值、标签以及双语通知消息。
Original summary in English

Summary by Sourcery

Configure an automated GitHub Actions workflow to label and close long-inactive bug issues.

New Features:

  • Introduce a scheduled stale workflow that targets only issues labeled as bug and excludes pull requests.
  • Add manual workflow_dispatch support with an optional dry-run mode for previewing stale processing behavior.

Enhancements:

  • Define inactivity thresholds, labels, and bilingual notification messages for marking and closing stale bug issues.

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Dec 29, 2025
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - 我在这里给出了一些整体性的反馈:

  • 目前陈旧问题(stale-issue)和关闭问题(close-issue)的提示信息里只说问题会在“某个时间段后”被关闭;建议明确写出 30 天的时间窗口,与配置的 days-before-issue-close 保持一致,避免让用户产生困惑。
  • debug-only 标志只在 workflow_dispatch 下生效,并且默认值是 true,这意味着手动触发的运行默认是干跑(dry-run);如果维护者会经常通过手动运行来做真实的清理操作,可能更合适把 dry-run 的默认值设为 false
给 AI Agent 的提示
Please address the comments from this code review:

## Overall Comments
- The stale-issue and close-issue messages say issues will be closed "in a certain period of time"; consider explicitly mentioning the 30‑day window to match the configured `days-before-issue-close` and avoid confusion for users.
- The `debug-only` flag is only active for `workflow_dispatch` and defaults to `true`, which means manual runs are dry-run by default; if maintainers will commonly use manual runs for real cleanup, you might want to default `dry-run` to `false` instead.

Sourcery 对开源项目是免费的——如果你觉得我们的评审有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进今后的评审。
Original comment in English

Hey - I've left some high level feedback:

  • The stale-issue and close-issue messages say issues will be closed "in a certain period of time"; consider explicitly mentioning the 30‑day window to match the configured days-before-issue-close and avoid confusion for users.
  • The debug-only flag is only active for workflow_dispatch and defaults to true, which means manual runs are dry-run by default; if maintainers will commonly use manual runs for real cleanup, you might want to default dry-run to false instead.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The stale-issue and close-issue messages say issues will be closed "in a certain period of time"; consider explicitly mentioning the 30‑day window to match the configured `days-before-issue-close` and avoid confusion for users.
- The `debug-only` flag is only active for `workflow_dispatch` and defaults to `true`, which means manual runs are dry-run by default; if maintainers will commonly use manual runs for real cleanup, you might want to default `dry-run` to `false` instead.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Dec 29, 2025
@Soulter Soulter changed the title chore: 添加 stale issue 工作流,处理长期不活动的 issue chore: add github actions for marking bug issues stale Dec 29, 2025
@Soulter Soulter merged commit 1039a4f into AstrBotDevs:master Dec 29, 2025
6 checks passed
@ocetars ocetars deleted the chore/stale branch December 29, 2025 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants