Sitelet https://github.com/DataDog/datadog-agent/pull/55359
Skip to content

fix(e2e): wire mirror hardening into step-by-step suite - #55359

Open
chouetz wants to merge 3 commits into
7.82.xfrom
nschweitzer/step-by-step-centos7-vault-mirrors-7.82.x
Open

fix(e2e): wire mirror hardening into step-by-step suite#55359
chouetz wants to merge 3 commits into
7.82.xfrom
nschweitzer/step-by-step-centos7-vault-mirrors-7.82.x

Conversation

@chouetz

@chouetz chouetz commented Aug 25, 2026

Copy link
Copy Markdown
Member

Summary

Backport of #55358 to 7.82.x, opened directly since the failure was first observed on this release branch.

  • The step-by-step suite (test/new-e2e/tests/agent-platform/tests/step_by_step_test.go) installs packages directly via VMclient and never builds an installer/host.Host, so it never got the CentOS 7 vault.centos.org fix (fix(e2e): CentOS 7 yum vault mirrors #54987) or the Ubuntu apt-mirror fix (e2e/installer: harden apt against mirror outages #54459 / Harden ddot ubuntu e2e job against apt mirror 503 #55229).
  • CentOS 7's install_rhel step fails with the same 403 Forbidden / No more mirrors to try signature those PRs already fixed elsewhere — see the 7.82.x job (TestStepByStepScript/test_step_by_step_on_centos-x86-64-79/TestStepByStep/install_rhel).
  • Adds a SetupSuite to stepByStepSuite that builds an installer/host.Host and calls the existing ConfigureYumMirrors() / ConfigureAptMirrors() helpers before any install step runs, matching the pattern already used by ddotInstallSuite. Each call is a no-op on the other package manager.

Test plan

  • dda inv new-e2e-tests.run --targets=./tests/agent-platform/tests compiles cleanly (verified with a non-matching --run filter).
  • CI: confirm TestStepByStepScript/.../install_rhel on CentOS 7 no longer hits the vault 403.

The step-by-step suite installs packages directly via VMclient and never
built an installer/host.Host, so it never got the CentOS 7 vault.centos.org
fix (#54987) or the Ubuntu apt-mirror fix (#54459/#55229). CentOS 7's
`install_rhel` step now fails with the same "403 Forbidden" / "No more
mirrors to try" signature those PRs fixed elsewhere (see 7.82.x job
1977865870).
@dd-octo-sts dd-octo-sts Bot added the internal Identify a non-fork PR label Aug 25, 2026
@github-actions github-actions Bot added the short review PR is simple enough to be reviewed quickly label Aug 25, 2026
chatgpt-codex-connector[bot]

This comment was marked as outdated.

host.New() unconditionally probes systemd via setSystemdVersion(), which
fatals the test on CentOS 6 (Upstart, not systemd — see the initctl branch
already handled in ConfigureAndRunAgentService). ConfigureYumMirrors() only
applies to CentOS 7 anyway, so skip host construction entirely for the
CentOS 6.10 descriptor instead of letting host.New() blow up.
@github-actions github-actions Bot added medium review PR review might take time and removed short review PR is simple enough to be reviewed quickly labels Aug 25, 2026
@chouetz chouetz added changelog/no-changelog No changelog entry needed qa/no-code-change No code change in Agent code requiring validation labels Aug 25, 2026
@chouetz
chouetz marked this pull request as ready for review August 25, 2026 10:25
@chouetz
chouetz requested a review from a team as a code owner August 25, 2026 10:25

@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: 240d9c0b26

ℹ️ 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".

// that descriptor runs Upstart, not systemd (see the initctl branch below and in
// ConfigureAndRunAgentService). Mirror hardening is only needed for CentOS 7 anyway
// (ConfigureYumMirrors no-ops on any other version), so skip host construction entirely here.
if is.osDesc.Flavor == e2eos.CentOS && is.osVersion == 6.10 {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Check the raw CentOS 6 descriptor in the guard

When invoked with --osdescriptors=centos/x86_64/610, BuildOSDescriptor stores the raw version as "610"; the parser at lines 96–108 sees no hyphen and therefore sets is.osVersion to 0. Consequently this guard is false, host.New still executes systemctl --version on the Upstart host, and setup fails before the test runs. The fresh evidence after the earlier thread is that the newly added skip compares against a derived value that this supported descriptor never produces; compare osDesc.Version directly or parse 610 in the one-part case.

AGENTS.md reference: AGENTS.md:L169-L169

Useful? React with 👍 / 👎.

@dd-octo-sts

dd-octo-sts Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Files inventory check summary

File checks results against ancestor a03b6b77:

Results for datadog-agent_7.82.3~rc.1.git.3.c3e2b14.pipeline.133039961-1_amd64.deb:

No change detected

@AliDatadog

Copy link
Copy Markdown
Contributor

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Aug 25, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-08-25 12:09:49 UTC ℹ️ Start processing command /merge


2026-08-25 12:09:54 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in 7.82.x is approximately 2h (p90).


2026-08-25 12:29:24 UTCMergeQueue: This merge request was updated

This PR is rejected because it was updated

gh-worker-dd-mergequeue-cf854d Bot pushed a commit that referenced this pull request Aug 25, 2026
## Summary

Backport of #55358 to `7.83.x` (alongside #55359 for `7.82.x`).

- The `step-by-step` suite (`test/new-e2e/tests/agent-platform/tests/step_by_step_test.go`) installs packages directly via `VMclient` and never builds an `installer/host.Host`, so it never got the CentOS 7 `vault.centos.org` fix (#54987) or the Ubuntu apt-mirror fix (#54459 / #55229).
- CentOS 7's `install_rhel` step fails with the same `403 Forbidden` / `No more mirrors to try` signature those PRs already fixed elsewhere — see the [7.82.x job](https://gitlab.ddbuild.io/DataDog/datadog-agent/-/jobs/1977865870) (`TestStepByStepScript/test_step_by_step_on_centos-x86-64-79/TestStepByStep/install_rhel`).
- Adds a `SetupSuite` to `stepByStepSuite` that builds an `installer/host.Host` and calls the existing `ConfigureYumMirrors()` / `ConfigureAptMirrors()` helpers before any install step runs, matching the pattern already used by `ddotInstallSuite`. Each call is a no-op on the other package manager.

## Test plan

- [x] `dda inv new-e2e-tests.run --targets=./tests/agent-platform/tests` compiles cleanly (verified with a non-matching `--run` filter).
- [ ] CI: confirm `TestStepByStepScript/.../install_rhel` on CentOS 7 no longer hits the vault 403.

Co-authored-by: axel.vonengel <axel.vonengel@datadoghq.com>
host.New() unconditionally probes systemd via setSystemdVersion(), which
fatals the test on CentOS 6 (Upstart, not systemd — see the initctl branch
already handled in ConfigureAndRunAgentService). ConfigureYumMirrors() only
applies to CentOS 7 anyway, so skip host construction entirely for the
CentOS 6.10 descriptor instead of letting host.New() blow up.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/no-changelog No changelog entry needed internal Identify a non-fork PR medium review PR review might take time qa/no-code-change No code change in Agent code requiring validation team/agent-devx

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants