nodejs / nodejs/github-bot

Modernizing the project

Abierto
#264 9 comentarios 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Lenguaje dominante
JavaScript
Estrellas
305
Forks
148
Merge medio
9 h 2 min
PR fusionados (30 d)
3

Descripción

First of, I love our GitHub bot. It's an essential piece of our infrastructure, and it can fill the gaps where GitHub Actions don't work well (the whole read-only, no secrets situation with forked PRs). With that being said, I have been trying to contribute to the project and the entry barrier seems somewhat high:

  1. Getting the development environment working on my machine took between one and two hours
  2. There's no way (afaik) to properly test Jenkins hooks
  3. Some of the dependencies we use are deprecate (github, request, there might be others too)
  4. github is not only deprecated, it lacks documentation. To find out which method to use, developers need to look into the TypeScript definition and then figure out which GitHub API is being called to read the documentation on https://developer.github.com/v3/
  5. Some parts of the code have hardcoded nodejs as org and node as repository, which makes it impossible for users to test without finding these conditionals and changing them/commenting those out

The project is also heavily callback-oriented, some parts would probably benefit from changing to an async/await-oriented implementation (I know this is more controversial, so I won't push too much on it).

Based on the points above, I have some suggestions to modernize the project:

  1. To improve the development experience, we could set up our own relay, which would essentially be a multiplexer receiving webhook calls from nodejs/node-auto-test. Anyone who wants to collaborate would connect to that relay, and they would receive the appropriate tokens needed for testing. We could add checks so that only certain teams are allowed to request access. We can also have a separate user with permissions limited to nodejs/node-auto-test, to prevent folks from mistakenly affecting other repositories. The same relay could be used for Jenkins hooks.
  2. To avoid hardcoded repositories and orgs, we could move some of the logic to the repositories. For example, labeling is only enabled on nodejs/node, if we moved the labels definition to nodejs/node (so that the bot loads the definition when needed), it would be easier for collaborators to include/remove definitions for new files, and it would also allow the bot to detect if that repository supports labeling or not.
  3. Replacing deprecated dependencies and potentially moving more towards async/await API might be harder. We could either start a new branch from scratch, or try to modernize different pieces individually. Either way it will need some coordination efforts as well as a lot of work to get it working properly.

As an alternative, we could turn the github-bot into an Actions relay: it would receive events from GitHub and Jenkins, and would forward those events to the repository dispatch API. This way, we could define everything as Actions on the respective repositories, circumventing the gaps with Actions on forked PRs and being able to define Actions for Jenkins events.

What do folks think? cc @nodejs/github-bot

Guía de contribución

Abrir la guía de contribución

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.

Línea de trabajo

Comienza revisando la configuración de desarrollo y scripts/node-subsystem-label.js; después, inspecciona los puntos de entrada del webhook y de Jenkins-hook mencionados en el issue. El trabajo propuesto abarca el reemplazo de dependencias, la infraestructura de pruebas, repositorios configurables y posiblemente un relay de Actions. Para darlo por terminado sería necesario contar con un plan de modernización acotado y una implementación coordinada, en lugar de un único cambio aislado.

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

Evaluación

Stack tecnológico
github-actions, javascript, nodejs
Área
ci-cd, devops, tooling
Tipo de issue
Refactorización
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.