feat(ci): run CI in the main Worker, with secrets, pull request runs and a job limit
- The refs Worker now holds RunHub, JobRunner, JobSlots, the RunPipeline Workflow and the job container. workers/ci and the operator API are removed. - Jobs get the secrets they name under `secrets:`. Organization secrets are new (ci_namespace_secrets). Job output is masked with the values. - Environments use their stored rules: allowed branches, approval, wait timer. - Pull requests start runs when they open and when their head branch moves. - A namespace runs at most 4 jobs at once. - ci_jobs rows follow each job's state. - New python, go, rust and android images. Custom images are refused.
3 decisions
A decision record here could not be read. Line 8: expected "name: value" under rejected.
A decision record here could not be read. Line 7: expected "name: value" under rejected.
A job gets only the secrets it names. An environment secret wins over a repository secret, and a repository secret wins over an organization secret.
Why
- A job that does not need a secret cannot leak it
- The nearest owner of a secret is the most specific one
Assumes
- Runs that agents start or push get no secrets
- Environment secrets need a person's approval of the job, or a push by a person to a protected branch
Touches
job-secrets.tsrun-hub.tsparse-pipeline.ts
A manual run gets every secret only on a protected branch. On other branches it gets organization and repository secrets.
Why
- An agent can write the pipeline file on any branch, and a person who starts that branch must not give it every secret
Touches
trust.ts
Each namespace runs at most 4 jobs at the same time. Other jobs wait for a free slot, for at most 2 hours.
Why
- One namespace must not use all the containers
Assumes
- One limit fits every namespace until plans differ
Touches
job-slots.tsrun-pipeline.ts