Skip to content

fix(ci): publish system-tests image via S3 + GH Actions dispatch - #4065

Open
MilanGarnier wants to merge 1 commit into
masterfrom
milan.garnier/publish-ci-builds
Open

fix(ci): publish system-tests image via S3 + GH Actions dispatch#4065
MilanGarnier wants to merge 1 commit into
masterfrom
milan.garnier/publish-ci-builds

Conversation

@MilanGarnier

@MilanGarnier MilanGarnier commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Description

#4013 pushed the per-branch system-tests image to GHCR directly from GitLab CI, authenticating with an octo-sts token scoped packages: write. That token is minted from a GitHub App installation, and GHCR refuses package writes from installation tokens (permission_denied: installation not allowed to Write organization package).

The fix replaces that job with a two-step, two-runtime pipeline:

  1. GitLab CI uploads the built tarballs + installer to s3://dd-trace-php-builds/ci/<ref-slug>/, then dispatches a GitHub Actions workflow (actions: write-scoped octo-sts token). (in fix(ci): wire GitLab CI to publish the system-tests image #4079)
  2. .github/workflows/publish-system-tests-image.yml (this PR) downloads the artifacts from S3 and pushes to GHCR using the workflow's native GITHUB_TOKEN, which — unlike the octo-sts token — is actually allowed to write org packages.

Scope of this PR: only the GitHub Actions workflow file. The GitLab CI wiring (S3 upload + dispatch, plus the octo-sts policy scope change) is stacked on top in #4079, split out because workflow_dispatch resolves a workflow by filename against the default branch's registered workflow list, regardless of the ref the dispatch targets — so this file has to land on master before the GitLab side can successfully dispatch it from any branch. Nothing calls the workflow until #4079 is merged.

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Jul 27, 2026

Copy link
Copy Markdown

Pipelines  Tests

Unblock PR with BitsAI

⚠️ Warnings

🚦 144 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-php | PHP Language Tests: [8.0]   View in Datadog   GitLab

🧪 3 Tests failed

ext/curl/tests/curl_basic_008.phpt (Test curl_error() &amp; curl_errno() function with problematic host) from PHP.ext.curl.tests   View in Datadog
001&#43; DNS resolution failurestring(0) &#34;&#34;
002&#43; int(0)
001- %s resolve%s
002- int(6)
ext/curl/tests/curl_error_basic.phpt (curl_error() function - basic test for curl_error using a fake url) from PHP.ext.curl.tests   View in Datadog
== Testing curl_error with a fake URL ==
002&#43; string(0) &#34;&#34;
002- string(%d) &#34;%sfakeURL%S&#34;
View all failed tests

DataDog/apm-reliability/dd-trace-php | PHP Language Tests: [8.3]   View in Datadog   GitLab

🧪 1 Test failed

ext/curl/tests/curl_error_basic.phpt (curl_error() function - basic test for curl_error using a fake url) from php.ext.curl.tests   View in Datadog
== Testing curl_error with a fake URL ==
002- string(%d) &#34;%sfakeURL%S&#34;
002&#43; string(0) &#34;&#34;

DataDog/apm-reliability/dd-trace-php | PHP Language Tests: [8.5]   View in Datadog   GitLab

🧪 2 Tests failed

ext/curl/tests/curl_basic_008.phpt (Test curl_error() &amp; curl_errno() function with problematic host) from php.ext.curl.tests   View in Datadog
001- %s resolve%s
002- int(6)
001&#43; DNS resolution failurestring(0) &#34;&#34;
002&#43; int(0)
sapi/cgi/tests/apache_request_headers.phpt (apache_request_headers() stack overflow.) from php.sapi.cgi.tests   View in Datadog
--
     
     Array
     (
006&#43;     [Proxy] =&gt; http://127.0.0.1:15002
     )
     Array
     (
         [X-Test] =&gt; AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
011&#43;     [Proxy] =&gt; http://127.0.0.1:15002
...

View all 144 failed jobs.

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

🔄 Datadog auto-retried 1 job - 1 passed on retry View in Datadog

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 87.67% (-0.07%)

Useful? React with 👍 / 👎

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

@MilanGarnier
MilanGarnier force-pushed the milan.garnier/publish-ci-builds branch from f4dedbc to 97f2a40 Compare July 27, 2026 08:11
@MilanGarnier

Copy link
Copy Markdown
Contributor Author

@codex review

@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: 97f2a40fe0

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread .gitlab/generate-package.php Outdated
Comment thread .gitlab/generate-package.php
Comment thread .gitlab/generate-package.php Outdated
@MilanGarnier
MilanGarnier marked this pull request as ready for review July 28, 2026 12:59
@MilanGarnier
MilanGarnier requested a review from a team as a code owner July 28, 2026 12:59

@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: 6e12d4abed

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread .github/workflows/publish-system-tests-image.yml Outdated
Comment thread .gitlab/generate-package.php Outdated
Comment thread .gitlab/generate-package.php Outdated
@pr-commenter

pr-commenter Bot commented Jul 28, 2026

Copy link
Copy Markdown

Benchmarks [ tracer ]

Benchmark execution time: 2026-07-30 11:04:18

Comparing candidate commit 1cc5cf5 in PR branch milan.garnier/publish-ci-builds with baseline commit b2d669e in branch master.

Found 3 performance improvements and 2 performance regressions! Performance is the same for 189 metrics, 0 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

scenario:ComposerTelemetryBench/benchTelemetryParsing-opcache

  • 🟩 execution_time [-1426.724ns; -373.276ns] or [-8.106%; -2.121%]

scenario:MessagePackSerializationBench/benchMessagePackSerialization

  • 🟩 execution_time [-6.031µs; -4.749µs] or [-5.319%; -4.189%]

scenario:MessagePackSerializationBench/benchMessagePackSerialization-opcache

  • 🟩 execution_time [-6.970µs; -3.890µs] or [-6.015%; -3.357%]

scenario:PHPRedisBench/benchRedisOverhead

  • 🟥 execution_time [+34.415µs; +43.398µs] or [+3.357%; +4.233%]

scenario:SamplingRuleMatchingBench/benchRegexMatching4

  • 🟥 execution_time [+60.012ns; +164.388ns] or [+4.051%; +11.097%]

Standalone workflow that pulls per-branch build artifacts from S3 and
pushes a multi-arch dd-library-php image so system-tests can pull it
by branch slug. Lands first, before GitLab CI is wired to dispatch it,
since workflow_dispatch resolves the workflow by filename against the
default branch's registered workflows regardless of target ref.
@MilanGarnier
MilanGarnier marked this pull request as draft July 30, 2026 09:44
@MilanGarnier
MilanGarnier force-pushed the milan.garnier/publish-ci-builds branch from 6e12d4a to 1cc5cf5 Compare July 30, 2026 09:44
@MilanGarnier
MilanGarnier marked this pull request as ready for review July 30, 2026 11:59

@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: 1cc5cf50d3

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +35 to +36
curl -fSL --retry 3 "${base}/dd-library-php-x86_64-linux-gnu.tar.gz" -o packages/amd64/dd-library-php-x86_64-linux-gnu.tar.gz
curl -fSL --retry 3 "${base}/dd-library-php-aarch64-linux-gnu.tar.gz" -o packages/arm64/dd-library-php-aarch64-linux-gnu.tar.gz

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 Keep versioned tarball names for system-tests

When system-tests consumes this image, its PHP installer searches /binaries with the glob dd-library-php-*-${ARCH}-linux-gnu.tar.gz (system-tests install script). The files written here are dd-library-php-x86_64-linux-gnu.tar.gz and dd-library-php-aarch64-linux-gnu.tar.gz, which do not have the required version/commit segment before the architecture, so the glob finds no local package and the build falls back to the latest release instead of testing the branch artifact. Preserve the original artifact filename, or rename to include any segment before ${ARCH} before copying it into the image.

Useful? React with 👍 / 👎.

Comment on lines +73 to +75
--jq '.[] | select(.metadata.container.tags == []) | "\(.id) \(.name)"' \
| while read -r id digest; do
if grep -qxF "$digest" <<< "$keep_digests"; then

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 Scope untagged cleanup to this branch tag

When another branch tag is still in use, its multi-arch child manifests are also untagged package versions, but this cleanup enumerates every untagged version in the package and only skips digests referenced by the just-pushed ${REF_SLUG} tag. A publish for branch B can therefore delete the amd64/arm64 manifests still referenced by branch A's tagged index, making system-tests pulls for branch A fail; the fresh evidence beyond the earlier thread is that the filter still selects untagged versions globally while the keep list is current-tag-only. Delete only digests known to have been superseded for this tag, or skip the global untagged cleanup.

Useful? React with 👍 / 👎.

Comment on lines +68 to +69
# the just-pushed multi-arch index's own child manifests are untagged too, so
# keep whatever digest the current tag still references.

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 Fix invalid YAML block indentation

With these comment lines indented deeper than the first shell command in the run: | block, YAML parsers infer the block content indentation from the comments and then reject set -euo pipefail as an unexpected key. As a result, GitHub Actions will not load or dispatch this workflow at all; move the comments above run: or indent them exactly like the shell script content.

Useful? React with 👍 / 👎.

Comment on lines +57 to +59
docker buildx build --platform linux/amd64,linux/arm64 \
--label org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} \
-f Dockerfile.system-tests -t "${IMAGE}:${REF_SLUG}" --push .

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 Connect the existing GHCR package before pushing

On the first dispatch against the existing dd-trace-php/dd-library-php package, this GITHUB_TOKEN push will be rejected if that package is still the current org-scoped package: GitHub documents that GITHUB_TOKEN cannot push to a namespace that was previously published but not connected to the workflow repository, and the public package page for dd-library-php does not redirect under the repo the way the linked dd-lib-php-init package does. The source label cannot grant access until the push succeeds, so connect the existing package/add Actions access first or publish to a new linked package.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant