Skip to content

Onboard off public-images GitLab job-token trigger - #299

Closed
AliDatadog wants to merge 6 commits into
mainfrom
ali.b/onboard-dd-pkg-publish-image
Closed

Onboard off public-images GitLab job-token trigger#299
AliDatadog wants to merge 6 commits into
mainfrom
ali.b/onboard-dd-pkg-publish-image

Conversation

@AliDatadog

@AliDatadog AliDatadog commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

DataDog/extendeddaemonset currently publishes public container images by directly triggering the DataDog/public-images GitLab CI pipeline via trigger: project: DataDog/public-images. We're migrating repos off that legacy job-token trigger mechanism onto dd-pkg publish-image, a CLI call against the artifact-gateway service.

dd-pkg publish-image still drives the same public-images pipeline 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.yml edit.

Changes:

  • Added a shared .docker_publish_job_definition template that runs dd-pkg publish-image, translating the existing IMG_* job variables into CLI flags.
  • Replaced the trigger: project: DataDog/public-images block in publish_public_main, publish_public_tag, and publish_public_latest with extends: .docker_publish_job_definition.
  • Left stage:, rules:, needs:, and variables: on each job untouched; only the trigger mechanism changed.
  • Left the unrelated trigger: project: DataDog/images jobs (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.
  • Merge to main and confirm publish_public_main (and -fips variant) successfully publish images via dd-pkg publish-image.
  • Cut a tag and confirm publish_public_tag/publish_public_latest (and -fips variants) still publish correctly when run manually.

…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
@datadog-official

datadog-official Bot commented Jul 27, 2026

Copy link
Copy Markdown

Code Coverage

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 37.19% (+0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 7b0a1fe | Docs | Datadog PR Page | Give us feedback!

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 38.01%. Comparing base (b6860a0) to head (dcd1056).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #299   +/-   ##
=======================================
  Coverage   38.01%   38.01%           
=======================================
  Files          65       65           
  Lines        3856     3856           
=======================================
  Hits         1466     1466           
  Misses       2275     2275           
  Partials      115      115           
Flag Coverage Δ
unittests 38.01% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b6860a0...dcd1056. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AliDatadog
AliDatadog marked this pull request as ready for review July 28, 2026 10:40
@AliDatadog
AliDatadog requested review from a team as code owners July 28, 2026 10:40

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread .gitlab-ci.yml
Comment on lines +133 to +134
.docker_publish_job_definition:
image: registry.ddbuild.io/agent-delivery/dd-pkg:v0.9.0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@AliDatadog AliDatadog added qa/skip-qa tooling Issue linked to the repository tooling labels Jul 28, 2026
AliDatadog and others added 5 commits July 28, 2026 14:11
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.
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.
@AliDatadog

Copy link
Copy Markdown
Contributor Author

closed as no release in the future

@AliDatadog AliDatadog closed this Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

qa/skip-qa tooling Issue linked to the repository tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants