feat: report a CI job's executor and pull with its payload credential
What and why
The Artifact Registry's monolith/S16 puts a registry credential for the Artifact Registry host in a CI job's payload, so a runner pulls the job's image: and services: with the job's own identity. GitLab issues it only to a runner that reports an executor other than Kubernetes. The two catalog rows for it, e2e.docker.auth.ci-image-pull and e2e.docker.auth.ci-image-pull-denied (S16 criteria 7 and 8), need glee to claim the job the way such a runner does and to pull with that credential:
gitlab.JobToken{Executor: "docker"}reports the executor in the claim (info.executor); with noExecutorthe claim reports none, as today. The identity keeps the payload'scredentials, each password redacted, andCredential(type, url)returns one by the host GitLab wrote, port included.ar.JobPullCredential{Job: "job"}is the payload'sregistrycredential for the Artifact Registry host. A step acting as it logs in as the payload's username (gitlab-ci-token) with its password, with no token exchange. The fixture fails when the payload holds no credential for the host, and itsDeletereleases nothing: the credential expires with its job, which the job token finishes.
A scenario then reads, for the granted case:
Given: e2e.Given{
"repo": ar.Repository{Format: ar.Docker},
"project": gitlab.Project{},
"dev": gitlab.User{Grant: e2e.Grants(ar.Viewer.On("repo"), gitlab.Developer.On("project"))},
"job": gitlab.JobToken{Project: "project", By: "dev", Executor: "docker"},
"pull": ar.JobPullCredential{Job: "job"},
},
Steps: e2e.Steps{
docker.Pull("pull").As("pull").From("repo").Image("ci:v1").Fresh(),
},The scenarios land in the Artifact Registry with its Step 3 (artifact-registry!3934 (merged)), after this releases. The flag ci_artifact_registry_pull_credentials stays the rig's to set, through its profile: glee does not change it.
Layer
core (gitlab), packs/artifactregistry, docs
Checklist
- A test that failed before this change:
TestTheJobClaimReportsItsExecutorAndKeepsThePayloadCredentials(the claim'sinfoand the kept credentials) andTestAJobPullCredentialLogsInWithThePayloadCredential, which fails with the token exchange whencredentialignores the payload password. - Keeps every design principle: the claim and the payload are GitLab's public runner API, the verdict rests on the pull the client gets, and nothing on the target changes.
- Docs updated: CI job tokens without a runner.
- The commit type says what this releases: squash-merged as one
feat:commit, a minor release. - Security: the payload passwords are new secrets in glee's memory; each is passed to
env.Redactas the claim decodes it, and again by the fixture, so no report or log prints it. No new outbound connection: the claim already goes toPOST /api/v4/jobs/request.
Locally on macOS, ci/check.sh fails three report and run tests (TestJUnitAttachesTheScreenshotOfARedBrowserScenario, TestAResultNamesItsRowsCatalogFile, TestProjectRelStaysInsideTheRoot) and two ci/ script tests that need GNU sed and a coverage.out; the same tests fail on main here, so CI is the check for those. gitlint is not installed locally; the commit-msg hook ran it on both commits.
Related to gitlab-org/gitlab#630573