Link a referenced issue for its assignee, and ask for the issue first when we cannot
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 75/100
- Tipo di issue
- Documentazione
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- javascript
- Ambito
- developer-experience, documentation
Direzione di ricerca
Leggi scripts/constants.js per BOT_MESSAGE_LINK_ISSUE e controlla l’aggiornamento della pagina dedicata ai contributi in #111 per verificare la formulazione concordata. Aggiorna il messaggio chiedendo ai collaboratori di aprire prima un issue la prossima volta e di inserire un link alle linee guida; esegui scripts/contributor-pr-reply.test.js per verificare che il messaggio venga aggiunto alle pull request non collegate e omesso da quelle collegate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
❌ 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.
- Lingua principale
- JavaScript
- Stelle
- 1
- Fork
- 7
- Merge medio
- 2g 8h
- PR unite (30g)
- 10
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di learningequality/.github
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
learningequality/.github#130 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
learningequality/.github#129 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 24/100
learningequality/.github#128 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 58/100
learningequality/.github#127 ·
I maintainer di solito rispondono entro 1 giorno
-
Migrate generate-automation.js to js-yaml 5Forse già presa @rtibblesbot l’ha presa 3 giorni fa. Apertacommunity-contribution-in-progress dependencies javascript
learningequality/.github#122 · 1 commento · 1 reazione · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di learningequality/.github
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 91/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement ui-dashboard
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
security
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
remotestorage/remotestorage.js#1405 ·
-
ai_context (Express): `express.raw()` / `bodyParser.raw()` body parser reported as an XSS sinkAperta🐞 bug 🧩 ai-context
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
owasp-noir/noir#3295 ·
I maintainer di solito rispondono entro 1 giorno