Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Link a referenced issue for its assignee, and ask for the issue first when we cannot

Aperta Adatta ai principianti
#112 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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

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, beside getLinkedIssues, finds a referenced issue in the
    description: a bare #123, an owner/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.js cover each reply, and
    docs/community-automations.md describes the assignee rule.
Testing

Test in test-actions. See
testing the automations.
The cases need an account outside the organization.

  1. 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.
  2. 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.
  3. Open a pull request naming an issue assigned to somebody else. Expect no link, and the ask.
  4. 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

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di learningequality/.github

Tutte le issue di learningequality/.github

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.