chore(issue): 强制非维护者通过 Issue 表单提交 (#990) - #1011
Merged
Merged
Conversation
- Bug / Feature 表单新增 issue-form:bug、issue-form:feature 来源标签 - 新增 lithe-issue-form-gate 工作流:issues opened 时校验作者权限, 非 write/maintain/admin 作者且无表单标签时双语评论并关闭 - 判定逻辑抽到 .github/lithe-issue-form/logic.mjs,权限未知、表单标签 未创建、转移等不确定情况一律不关闭 - 新增 scripts/test-lithe-issue-form-gate.mjs 覆盖验收标准 - 新增 process Agent Note 记录决策与备选方案 Co-Authored-By: Claude <noreply@anthropic.com>
表单标签可能在 Issue 创建后约 1 秒才写入(见 #987 的事件记录), 在评论和关闭前再读一次 Issue 并重新判定,出现表单标签或已被关闭时不处理。 Co-Authored-By: Claude <noreply@anthropic.com>
xiaoyumuxi
requested changes
Oct 1, 2026
xiaoyumuxi
left a comment
Collaborator
There was a problem hiding this comment.
有两个会破坏“非维护者必须通过 Issue Form 提交”这一约束的边界问题,建议修复后再合并。
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #990
背景与行为
blank_issues_enabled: false只隐藏网页空白 Issue 入口,不能阻止普通用户通过 API、CLI 或第三方客户端绕过表单。本 PR 给 Bug / Feature 表单添加来源标签,并在 Issue 创建或重新打开时检查:write / maintain / admin 作者放行;其他作者需要允许的来源标签,否则收到中英双语说明及表单链接,并以not_planned关闭。改动明细
bug/enhancement标签,分别增加issue-form:bug/issue-form:feature。author_association推断协作者写权限。issues: [opened, reopened]门禁:作者自己重新打开仍需检查,其他触发者(例如维护者转移或重新打开)跳过;Bot 和 OWNER 跳过。getLabel返回的archived_at,不能只以接口成功作为可用依据。addLabels/removeLabel,仅增删自己管理的类型、优先级、平台和模块标签,避免旧快照的setLabels覆盖稍后写入的来源标签或其他非托管标签。Verify issue automationCI,对相关 PR 和 main/preview 推送运行 Issue 自动化测试,单测试超时 10 秒、job 超时 5 分钟;同步更新中文 Agent Note。工作流使用
contents: read、issues: write,checkout 禁用凭据持久化;Issue 标题和正文不插入 shell 或表达式。测试 CI 只需要contents: read。验证
node --test --test-timeout=10000 scripts/test-lithe-issue-*.mjs:23 个测试全部通过,包括 7 个工作流编排测试;生成了本地逐测试计时 HTML / JUnit 报告。部署条件与限制
issue-form:bug、issue-form:feature两个标签;任一不可用时门禁安全退化,不关闭无来源标签的 Issue。