/take-pr lets several people claim one issue, and its whitespace handling is inconsistent

Aperta Adatta ai principianti
#75 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
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
github-actions, yaml
Ambito
devtools

Direzione di ricerca

Inizia da .github/workflows/issue-assignment-commands.yml ed esamina la condizione del job e lo script che gestisce /take-pr e /remove-pr. Controlla come il workflow legge gli assegnatari e rimuove gli spazi bianchi dal corpo dei commenti; fai in modo che il comportamento dichiarato per le issue e la gestione degli spazi bianchi corrispondano alle aspettative indicate. Il lavoro è completato quando una seconda persona che rivendica la issue riceve una risposta con il nome dell’assegnatario corrente e gli spazi intorno ai comandi seguono una regola coerente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug maintenance

.github/workflows/issue-assignment-commands.yml has two gaps.

1. Anyone can claim an issue that is already claimed

/take-pr only checks whether the commenter is already an assignee. It does not check whether someone else is assigned. A second and third contributor can run /take-pr on the same issue and all of them are added, so the assignment no longer shows who is working on it.

Expected: if the issue already has an assignee, the bot replies that it is taken and names the assignee, and does not add another one. Maintainers can still assign people by hand.

2. The job condition and the script disagree about whitespace

The job runs only on an exact match:

(github.event.comment.body == '/take-pr' || github.event.comment.body == '/remove-pr')

The script then calls .trim() on the body and compares again. That trim can never matter, because a body with a leading or trailing space or newline has already been filtered out by the if. Such a comment is skipped with no feedback to the contributor.

Expected: one rule. Either trim in both places (for example move the command check fully into the script and keep only the bot and pull-request filters in if), or drop the unused trim.

Smaller point

The commands are named /take-pr and /remove-pr but they work on issues and are skipped on pull requests. A name such as /take or /assign-me would be clearer; the old names could stay as aliases.

Lingua principale
Python
Stelle
22
Fork
15
Merge medio
14h 14m
PR unite (30g)
29

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 OWASP/OWASP-Hunting

Tutte le issue di OWASP/OWASP-Hunting

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.