Thanks to visit codestin.com
Credit goes to github.com

Skip to content

chore: reduce "Upload tests to datadog" times in CI #17668

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 5, 2025

Conversation

hugodutka
Copy link
Contributor

@hugodutka hugodutka commented May 5, 2025

This PR speeds up the "Upload tests to datadog" step by downloading the datadog-ci binary directly from GitHub releases. Most of the time used to be spent in npm install, which consistently timed out on Windows after a minute. Now it takes 3 seconds.

I updated it to version v2.48.0 because v2.21.0 didn't have the artifacts for arm64 macOS.

@hugodutka hugodutka changed the title chore: optimize "Upload tests to datadog" times in CI chore: reduce "Upload tests to datadog" times in CI May 5, 2025
@hugodutka hugodutka marked this pull request as ready for review May 5, 2025 12:08
@hugodutka hugodutka requested a review from deansheather May 5, 2025 12:09
@hugodutka hugodutka force-pushed the hugodutka/datadog-ci-optimization branch from bb80dee to 5d42295 Compare May 5, 2025 12:29
exit 1
fi

echo "Downloading DataDog CI binary version ${BINARY_VERSION} for ${{ runner.os }}..."
Copy link
Member

Choose a reason for hiding this comment

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

Needs SHA256 validation

Copy link
Member

Choose a reason for hiding this comment

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

Which will be hard now that the version is an input...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll remove the input then

Copy link
Member

@matifali matifali May 5, 2025

Choose a reason for hiding this comment

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

Why would it need SHA256 validation? We are downloading from the official repo, and also, the CLI only works if the correct token is available? Also, the test logs are all public; there is no sensitive data. Or. is it, and I am missing something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It mitigates supply-chain attacks. If somebody took over Datadog's repo, they'd be able to swap the release files for a malicious payload. AFAIK, release artifacts are mutable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@deansheather I added hash verification

@hugodutka hugodutka force-pushed the hugodutka/datadog-ci-optimization branch from 5d42295 to f589664 Compare May 5, 2025 16:16
BINARY_HASH_MACOS="e87c808638fddb21a87a5c4584b68ba802965eb0a593d43959c81f67246bd9eb"
BINARY_HASH_LINUX="5e700c465728fff8313e77c2d5ba1ce19a736168735137e1ddc7c6346ed48208"

TMP_DIR=$(mktemp -d)
Copy link
Member

Choose a reason for hiding this comment

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

Could this go in runner temp instead so it hits the ramdisk? The perf savings are probably miniscule but might as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The perf savings are probably miniscule

Indeed, I don't think it's worth optimizing further if the entire step already takes only 3 seconds

@hugodutka hugodutka merged commit 6b4d3f8 into main May 5, 2025
35 of 37 checks passed
@hugodutka hugodutka deleted the hugodutka/datadog-ci-optimization branch May 5, 2025 16:50
@github-actions github-actions bot locked and limited conversation to collaborators May 5, 2025
@hugodutka
Copy link
Contributor Author

For future reference, this helps unblock #15109.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants