Onboard off public-images GitLab job-token trigger - #299
Conversation
…h-image Replaces the direct `trigger: project: DataDog/public-images` CI jobs with `dd-pkg publish-image` calls against the artifact-gateway service. This routes public image publishing through a policy/audit layer while still driving the same public-images pipeline; no per-repo registration is required since authorization is implicit via CI job identity. See https://datadoghq.atlassian.net/wiki/x/ooQkngE Ref: BARX-1951
|
🎯 Code Coverage (details) 🔗 Commit SHA: 7b0a1fe | Docs | Datadog PR Page | Give us feedback! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #299 +/- ##
=======================================
Coverage 38.01% 38.01%
=======================================
Files 65 65
Lines 3856 3856
=======================================
Hits 1466 1466
Misses 2275 2275
Partials 115 115
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dcd10562cb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .docker_publish_job_definition: | ||
| image: registry.ddbuild.io/agent-delivery/dd-pkg:v0.9.0 |
There was a problem hiding this comment.
Clear the inherited before_script for publishing jobs
Because these are now ordinary jobs rather than bridge trigger jobs, every main/tag publication inherits the top-level before_script at lines 27-28 and runs make install-tools before this script. That target installs the repository's Go development toolchain, so the purpose-built dd-pkg image can fail before reaching dd-pkg publish-image when it lacks make or Go; even if those tools happen to exist, each publication unnecessarily installs all development tools. Override before_script with an empty list in this template.
Useful? React with 👍 / 👎.
Publishing jobs now run as ordinary jobs (not bridge triggers), so they inherit the top-level before_script (make install-tools), which can fail on the purpose-built dd-pkg image and is unnecessary overhead. Also make the target registry explicit instead of relying on the dd-pkg default.
…ge' into ali.b/onboard-dd-pkg-publish-image
Publishing jobs run as ordinary script jobs now, not bridge trigger jobs, so they need explicit runner tags like every other script job in this pipeline; without one they'd have no eligible runner. Matches the arch:amd64 convention used by sibling repos onboarded off the same public-images trigger (e.g. fips-proxy).
Switches the shared publish-image job template's runner tag from arch:amd64 to arch:arm64 per updated runner allocation guidance.
|
closed as no release in the future |
Summary
DataDog/extendeddaemonsetcurrently publishes public container images by directly triggering theDataDog/public-imagesGitLab CI pipeline viatrigger: project: DataDog/public-images. We're migrating repos off that legacy job-token trigger mechanism ontodd-pkg publish-image, a CLI call against theartifact-gatewayservice.dd-pkg publish-imagestill drives the samepublic-imagespipeline under the hood, but routes through a policy/audit layer instead of an unauthenticated cross-project trigger. No per-repo registration or allowlist step is needed — authorization is implicit via CI job identity — so this change is purely a.gitlab-ci.ymledit.Changes:
.docker_publish_job_definitiontemplate that runsdd-pkg publish-image, translating the existingIMG_*job variables into CLI flags.trigger: project: DataDog/public-imagesblock inpublish_public_main,publish_public_tag, andpublish_public_latestwithextends: .docker_publish_job_definition.stage:,rules:,needs:, andvariables:on each job untouched; only the trigger mechanism changed.trigger: project: DataDog/imagesjobs (internal image promotion) as-is — out of scope for this migration.Background: https://datadoghq.atlassian.net/wiki/x/ooQkngE
Ref: https://datadoghq.atlassian.net/browse/BARX-1951
Follow-up (outside this PR): this migration adds real authn/authz for public image publishing via artifact-gateway, in place of the old job-token trust-any-caller model. As a next step we'll be asking this repo's owners who should be allowed to release these images, and who/how to reach them if an authz check ever fails.
Test plan
ruby -ryaml -e "YAML.load_file('.gitlab-ci.yml'); puts 'OK'"confirms the file is valid YAML.mainand confirmpublish_public_main(and-fipsvariant) successfully publish images viadd-pkg publish-image.publish_public_tag/publish_public_latest(and-fipsvariants) still publish correctly when run manually.