Explore performance improvements in golang generation pipeline#3979
Merged
Explore performance improvements in golang generation pipeline#3979
Conversation
5e32eb6 to
0293cfb
Compare
Extract staticcheck from run-tests.sh into a dedicated parallel job in reusable-go-test.yml, using dominikh/staticcheck-action@v1 for better caching. Move run-tests.sh to scripts/ for consistency. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the single check-examples.sh job (~7min for 1490 examples) with a two-stage workflow: scripts/prepare-examples.sh counts examples and emits a dynamic matrix, then scripts/build-examples-group.sh runs in parallel across 4 groups (~400 examples each, ~2.5min per job). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
0293cfb to
cbc2d4a
Compare
MintsInc
approved these changes
Apr 20, 2026
github-actions Bot
pushed a commit
that referenced
this pull request
Apr 20, 2026
* Move staticcheck to its own CI job using dominikh/staticcheck-action Extract staticcheck from run-tests.sh into a dedicated parallel job in reusable-go-test.yml, using dominikh/staticcheck-action@v1 for better caching. Move run-tests.sh to scripts/ for consistency. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Split example builds into parallel matrix jobs to cut CI time ~60% Replace the single check-examples.sh job (~7min for 1490 examples) with a two-stage workflow: scripts/prepare-examples.sh counts examples and emits a dynamic matrix, then scripts/build-examples-group.sh runs in parallel across 4 groups (~400 examples each, ~2.5min per job). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> 0e958d9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR focuses on improving CI pipeline performance and maintainability for the datadog-api-client-go repository. The two main pain points targeted were the long test job runtime — caused by bundling static analysis directly inside every test matrix runner — and the monolithic example build that was running all 1,490 examples sequentially in a single job. The changes decouple these concerns both organizationally and in terms of execution time.
Staticcheck was previously installed from source (go install honnef.co/go/tools/cmd/staticcheck@latest) and run inline inside run-tests.sh, meaning every one of the four test matrix jobs (Go 1.22 × 1.23 × two build tag variants) had to pay the cost of downloading, compiling, and running it before tests could even start. This has been replaced with a dedicated staticcheck job in the reusable Go test workflow using the official dominikh/staticcheck-action@v1. The action ships a pre-built binary with its own caching layer, and —crucially — it now runs in parallel with the test jobs rather than being on their critical path, removing it entirely from the test job's wall-clock time.
Example builds went from a single job compiling all 1,490 example packages in sequence (~7 minutes on GitHub's 2-core runners) to a two-stage matrix workflow. A lightweight prepare job counts the examples and emits a dynamic matrix JSON (currently [1,2,3,4] for 400 examples per group). Four build jobs then run in parallel, each checking out the repo and building its own slice. Based on the observed 7-minute baseline for 1,490 examples, each group of ~375–400 examples is expected to take around 1.9 minutes of build time, bringing the total wall-clock time — including checkout and Go setup — to roughly 2.5–3 minutes, down from 7. The group size is controlled by the EXAMPLES_PER_GROUP variable in both scripts, so it can be tuned as the example count grows over time.
Overall, these changes reduce the two longest-running CI steps by roughly 55–60% in wall-clock time, without sacrificing coverage or correctness. The test job is now leaner and focused purely on running tests; static analysis and example validation each run in their own dedicated, parallelised jobs. The approach is also future-proof: as new examples are added, the matrix automatically gains more groups to keep each job within the target budget.
Additional Notes
Review checklist
Please check relevant items below:
This PR includes all newly recorded cassettes for any modified tests.
This PR does not rely on API client schema changes.
Or, this PR relies on API schema changes and this is a Draft PR to include tests for that new functionality.