Skip to content

Harden build.sh script#7086

Merged
cbeauchesne merged 2 commits into
mainfrom
cbeauchesne/harden-build
Jun 5, 2026
Merged

Harden build.sh script#7086
cbeauchesne merged 2 commits into
mainfrom
cbeauchesne/harden-build

Conversation

@cbeauchesne
Copy link
Copy Markdown
Collaborator

@cbeauchesne cbeauchesne commented Jun 4, 2026

Motivation

When ./build.sh -i runner was executed with an env var TEST_LIBRARY=cpp, it was trying to get the default weblog of cpp (which does not exists) and failed, even if the purpose of the call was not to build the weblog.

It was sneaky, as ./build.sh -i runner can be called by ./run.sh if the venv is updated. For cpp folks, it was breaking run.sh

Issue raised in #7082

Changes

Move weblog and variant resolution inside the block that actually build the weblog

Workflow

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes
  3. Mark it as ready for review
    • Test logic is modified? -> Get a review from RFC owner.
    • Framework is modified, or non obvious usage of it -> get a review from R&P team

🚀 Once your PR is reviewed and the CI green, you can merge it!

🛟 #apm-shared-testing 🛟

Reviewer checklist

  • Anything but tests/ or manifests/ is modified ? I have the approval from R&P team
  • A docker base image is modified?
    • the relevant build-XXX-image label is present
  • A scenario is added, removed or renamed?

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

CODEOWNERS have been resolved as:

utils/build/build.sh                                                    @DataDog/system-tests-core

Copy link
Copy Markdown
Contributor

@xlamorlette-datadog xlamorlette-datadog left a comment

Choose a reason for hiding this comment

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

I confirm it's working fine.

@cbeauchesne cbeauchesne marked this pull request as ready for review June 4, 2026 16:08
@cbeauchesne cbeauchesne requested a review from a team as a code owner June 4, 2026 16:08
Copy link
Copy Markdown

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

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: 9c6f82dcd0

ℹ️ 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 utils/build/build.sh
@datadog-datadog-prod-us1-2
Copy link
Copy Markdown

datadog-datadog-prod-us1-2 Bot commented Jun 4, 2026

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

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

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR hardens utils/build/build.sh by deferring weblog validation and default-variant resolution until the script is actually building the weblog image, preventing failures when BUILD_IMAGES does not include weblog (e.g., ./build.sh -i runner with TEST_LIBRARY=cpp).

Changes:

  • Move library existence checks, default weblog variant resolution, and variant Dockerfile validation into the weblog image build branch.
  • Move remote Docker cache configuration to the weblog build path so it’s not computed when weblog isn’t being built.
  • Remove the previous unconditional/global weblog validation block at the end of the script.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread utils/build/build.sh
Comment on lines +233 to +236
if [[ ! -d "${SCRIPT_DIR}/docker/${TEST_LIBRARY}" ]]; then
echo "Library ${TEST_LIBRARY} not found"
echo "Available libraries: $(echo $(list-libraries))"
exit 1
@cbeauchesne cbeauchesne merged commit 6e64766 into main Jun 5, 2026
2668 of 2671 checks passed
@cbeauchesne cbeauchesne deleted the cbeauchesne/harden-build branch June 5, 2026 11:24
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.

3 participants