Switch to syncing tracks via push rather than pull config

Aperta
#1,750 8 commenti 1 reazione 2 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@SaschaMann ci sta già lavorando.

Dal 29/12/2020.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

CI cross-track consistency discussion

GitHub recently introduced a new feature called Environments that let you create a »container« of sorts to limit access to secrets in a more fine-grained way than giving everyone with the commit bit permission to access and use them. GHA workflows can require access to an environment, which will prevent them from running until a select group of people has »reviewed« the run and clicked a button.

This feature would allow us to switch to trigger events from problem-specifications to the track repos, rather than the current configuration where track repos must pull new info.

What would (need to) change?

  • Configure a machine user with write access to all track repos.

  • Configure an environment in problem-specifications with an access token of that bot user.

  • Determine a trusted group of (currently up to 6) people who can approve workflow runs in that environment.

  • Configure a workflow in problem-specifications that sends out repository_dispatch to each track repo. repository_dispatch events are kinda like webhooks. They are web requests that may contain an arbitrary payload that are sent to the track repos and trigger a workflow run there.
    There are two viable triggers, both with their own up- and downsides:

    • push:
      • Send an event to tracks on every commit to the main branch in problem-specifications.
      • 👍 Changes to problem-specifications map 1-to-1 to repository_dispatch.
      • 👍 Changes will make their way to the track repos ASAP.
      • 👎 This may cause a lot of work for the workflow approvers, as they’ll have to approve a run for every PR.
      • 👎 It is not clear when a change will hit the track repos as it depends on the availability of the approvers.
    • schedule:
      • Once a day (or more/less often), send out an event that contains a »summary« of recent changes (if there were any) to the track repos.
      • 👍 The work for workflow approvers is limited.
      • 👍 It’s fairly predictable how long it will take for a change to trigger an event in the track repos.
      • 👎 It may take more time for a change to make its way into a track repo.
      • 👎 The receiving workflows will be more complex, as they’ll have to handle several changes at once.
  • Each track can then decide if and how they want to act on these events. For example, they could…

    • … automatically run their test generators on the new tests.
    • … open an issue that contains a summary of the change.

    Some of these could be standardized in actions, so that tracks don’t have to write their own workflows from scratch.

Advantages

  • Less resources are wasted on scheduled runs looking for changes in problem-specs.

  • We can create an event payload ourselves to make it easier for tracks to handle updates (semi-) automatically.

  • It would be easy to setup each track with a default behaviour, like creating an issue, so that even tracks that lack the peoplepower to setup elaborate automated workflows would benefit from update notifications.

  • All of this would also be possible with webhooks and an external (serverless) service where secrets are stored. However, that would require additional infrastructure and would make it harder to change or fix the setup compared to a purely GHA-based setup.

Lingua principale
Ruby
Stelle
362
Fork
566
Merge medio
15h 13m
PR unite (30g)
8

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 exercism/problem-specifications

Tutte le issue di exercism/problem-specifications

Issue simili

Altre issue su Ruby

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.