Link a referenced issue for its assignee, and ask for the issue first when we cannot
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 75/100
- Issue 類型
- 文件
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- javascript
研究方向
閱讀 scripts/constants.js 中的 BOT_MESSAGE_LINK_ISSUE,並查看 #111 中貢獻者頁面的更新,以確認議定的措辭。更新訊息,請貢獻者下次先建立 issue 並連結至指南;執行 scripts/contributor-pr-reply.test.js,確認未連結的 pull request 會附加提示,而已連結的 pull request 不會附加提示。
由索引模型根據 Issue 內容生成。
描述
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Overview
A pull request that links no issue gets a message asking the contributor to link one. When the
description already names an issue the author is assigned to, link it for them instead of
asking. Keep the ask for every other case, and say there that the issue comes first.
Complexity: Medium
Target branch: main
Context
BOT_MESSAGE_LINK_ISSUE in scripts/constants.js, added in #103, asks for the link. It does
not say that the issue comes first, and it asks for work the automation can do itself.
learningequality/kolibri#15631 is the example. The description named the issue as a markdown
link, so GitHub recorded a cross-reference and not a link, and a maintainer linked it by hand.
addCloseIssueReferences(issueId, pullRequestIds) creates that link, so the description is
never edited. removeCloseIssueReferences undoes one.
The Change
All of this sits in the branch that asks for a link today, which contributor-pr-reply.js:54
gates on an empty getLinkedIssues result. A closing keyword, or a link a maintainer made in
the sidebar, fills that result, so nothing below runs and the reply stays as it is.
- A helper in
scripts/utils.js, besidegetLinkedIssues, finds a referenced issue in the
description: a bare#123, anowner/repo#123, an issue URL, or a markdown link to one. It
ignores code spans and fenced blocks, and keeps only open issues in the same repository. - One candidate with the author among its assignees is linked with
addCloseIssueReferences.
Being assigned is what makes a parsed reference safe to act on. Nothing else is linked. - Three replies replace the single message:
| Case | Reply |
|---|---|
| One candidate, author is an assignee | names the issue it linked, and asks for Closes #123 next time |
| No candidate, or none assigned to the author | today's message, plus the issue-first sentence |
| Several candidates assigned to the author | names them, and asks which one the pull request closes |
- The issue-first sentence points at the contributing guidelines, so its wording follows #111.
- A refused mutation sends the asking reply and logs the refusal. It never reports a link it
did not make.
Out of Scope
- Closing a pull request because of a parsed reference. #103 closes on a real link only.
- A referenced issue assigned to somebody else, as in learningequality/kolibri#15562. It
escapes the close path today, and it still will. - A reference added in a later edit. The automation runs on
opened. - Links across repositories, and any edit to the description.
Acceptance Criteria
- One referenced open issue in the same repository, with the author among its assignees,
is linked, and the reply names it and asks for a keyword next time. - All four reference forms are found, and a reference inside a code span is ignored.
- Nothing is linked when the candidate is a pull request, a closed issue, unassigned, or
assigned to somebody else. The reply asks. - Two candidates assigned to the author link neither, and the reply names both.
- A pull request that already links an issue is untouched.
- A pull request naming no issue gets the asking reply, with the issue-first sentence.
- A refused mutation sends the asking reply and does not fail the run.
- Tests in
scripts/contributor-pr-reply.test.jscover each reply, and
docs/community-automations.mddescribes the assignee rule.
Testing
Test in test-actions. See
testing the automations.
The cases need an account outside the organization.
- Confirm that the LE bot app's token can run
addCloseIssueReferences. The mutation targets
the issue, so it needs write access to issues. Run this first. - Assign an issue to the outside account, then open a pull request naming it as a markdown
link. Expect the link in the Development sidebar, and the reply that names it. - Open a pull request naming an issue assigned to somebody else. Expect no link, and the ask.
- Open a pull request with
Closes #N. Expect no link message.
References
- #103 added the message and
getLinkedIssues. - #111 updates the contributing page. The issue-first sentence follows its wording.
- learningequality/kolibri#15631 is the example.
AI usage
I used Claude Code to find the message, confirm what it says today, and confirm that the
mutation exists. The assignee rule and the decision to link are mine.
- 主要語言
- JavaScript
- 星號
- 1
- 分支
- 7
- 平均合併
- 2 天 8 小時
- 30 天內合併 PR
- 10
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
learningequality/.github 的其他 Issue
-
難度 4/5 3-5 天 新手友好度 42/100
learningequality/.github#130 ·
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 45/100
learningequality/.github#129 ·
維護者通常 1 天內回覆
-
難度 5/5 一週以上 新手友好度 24/100
learningequality/.github#128 ·
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 58/100
learningequality/.github#127 ·
維護者通常 1 天內回覆
-
Migrate generate-automation.js to js-yaml 5可能已有人在做 @rtibblesbot 於 1 天前認領。 未關閉community-contribution-in-progress dependencies javascript
learningequality/.github#122 · 1 則留言 · 1 個 reaction · 已指派 1 人 ·
維護者通常 1 天內回覆
查看 learningequality/.github 的全部 Issue
相似的 Issue
-
external-plugin ready-for-review third party
難度 2/5 1-3 小時 新手友好度 68/100
github/awesome-copilot#5713 · 1 則留言 ·
維護者通常 1 天內回覆
-
Mend: dependency security vulnerability
難度 2/5 1-3 小時 新手友好度 68/100
carbon-design-system/carbon-react-router-starter#1005 ·
維護者通常 1 天內回覆
-
enhancement p2 setup
難度 1/5 1 小時以內 新手友好度 88/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
bug good first issue query-log web
難度 2/5 1-3 小時 新手友好度 85/100
ferrous-networking/ferrous-dns#326 ·
維護者通常 1 天內回覆