Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Merged PR shoutout misses the count when the program label is added after the merge

Abierto
#59 2 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@An16og ya está trabajando en esto.

Desde el 21/10/2026.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript
Área
api, backend

Línea de trabajo

Read src/webhook.ts at onPullRequest, then trace mergedPrMessage in src/messages.ts and sendMessage/editMessage in src/discord.ts. Start with the merged pull request tests in test/webhook.test.ts and run them to understand the current event handling. Done means late program labels refresh the board and update the shoutout, while open PRs, unrelated labels, and already-counted shoutouts remain unchanged; the issue also calls for npm run typecheck and npm test to pass.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug hacktoberfest help wanted

When a PR is merged, the bot posts a shoutout, and when the PR counts for the program it adds "That's their Nth merged PR on the ... leaderboard." plus, once, "With N they now qualify for ..." (src/messages.ts, lines 110 and 114). onPullRequest (src/webhook.ts, line 189) only reacts to the closed event (line 191) and only looks at the labels in that event (line 200). So when hacktoberfest-accepted is added after the merge:

  • the shoutout goes out without the count, and without the qualify line on a 5th PR
  • the later labeled event is ignored, so the cached board isn't refreshed for that PR until the cache runs out (10 minutes, src/leaderboard.ts, line 60)

This isn't rare. The "Accepted label" workflow in each repo (.github/workflows/accepted-label.yml here) exists to add the label after the merge when a maintainer missed it.

What to do

  • Handle labeled for a PR that's already merged, when the added label is a program's label and the merge falls in that program's window. Count and cache the board the way closed does (lines 204 to 225).
  • Store the shoutout's message id when it's posted (sendMessage returns it; a KV key with an expiry of a few days is enough), and on the late label, edit that message so it gets the count line, and the qualify line if this is the PR that reaches the minimum. If there's no stored id, refresh the board and skip the edit.
  • Don't count twice: if the shoutout already has the count because the label was there at the merge, a later labeled event changes nothing.

Where to look

  • src/webhook.ts: onPullRequest (line 189)
  • src/messages.ts: mergedPrMessage (line 88)
  • src/discord.ts: sendMessage (line 118) and editMessage (line 131)
  • test/webhook.test.ts: the merged pull request tests (line 320)

Acceptance criteria

  • A merged PR that gets the program label later ends up with the same shoutout text as one that had it at the merge, including the qualify line on the PR that reaches the minimum
  • The board is refreshed on that event
  • A labeled event on an open PR, for another label, or for a PR whose shoutout already has the count changes nothing
  • Tests for these cases
  • npm run typecheck and npm test pass

Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off develop, and open your PR against develop with Closes #59 in the description.

Lenguaje dominante
TypeScript
Estrellas
0
Forks
1
Merge medio
12 h 22 min
PR fusionados (30 d)
36

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de codercops/discord-bot

Todos los issues de codercops/discord-bot

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.