Add build-terraform-provider CI step to detect breaking changes#3894
Merged
Add build-terraform-provider CI step to detect breaking changes#3894
Conversation
4 tasks
9101ec0 to
ed19f01
Compare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…er CI Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When called from api-spec, github.event.pull_request.head.sha is the api-spec SHA, not a go-client SHA — the lookup fails. inputs.target-branch carries the correct go-client branch name in that path. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
nogates
approved these changes
Apr 13, 2026
github-actions bot
pushed a commit
that referenced
this pull request
Apr 13, 2026
* moves CLI testing to Go library repo * Use PR description for terraform provider fix link instead of file * Remove file-based terraform-provider-pr cleanup from release.yml * Pass tf-provider-pr as input instead of re-parsing PR description * Remove PR description parsing from go-client; use tf-provider-pr input or master * Revert GO_CLIENT_BRANCH fallback, no longer needed without edited event * Improve build failure message with force rebuild option * Remove redundant explicit PR event types from test.yml Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Fix rebuild instruction — a new commit is always required to re-trigger CI Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Restore inputs.target-branch fallback for GO_CLIENT_BRANCH When called from api-spec, github.event.pull_request.head.sha is the api-spec SHA, not a go-client SHA — the lookup fails. inputs.target-branch carries the correct go-client branch name in that path. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: David Tapiador <david.tapiadordeldujo@datadoghq.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> ac1d655
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?
Adds a
build-terraform-providerjob to the Go client CI that buildsterraform-provider-datadogagainst the generated Go client code on every PR. This catches breaking changes (renamed types, removed fields, etc.) before they are merged, rather than discovering them after the fact.How it works
build-terraform-providerstep checks outterraform-provider-datadog, replaces itsdatadog-api-client-godependency with the PR's commit, and runsgo build ./....terraform-provider-datadogmust be created and linked. The link is passed in via thetf-provider-prinput (set bydatadog-api-spec's CI — see below). The check then builds against that branch instead ofmaster. Stale references to merged/closed PRs are automatically ignored.Relationship with datadog-api-spec
This workflow is designed to be called from
datadog-api-spec's CI pipeline, which handles the full flow:Fix Terraform Provider PR:link is added or changed in the api-spec PR descriptiontf-provider-prinput, so this workflow doesn't need to parse any PR description itselfmasterFiles changed
.github/workflows/reusable-go-test.yml— Newbuild-terraform-providerjob. Uses thetf-provider-prinput if provided, otherwise falls back tomaster..github/workflows/reusable-ci.yml— Passes the newtf-provider-prinput through toreusable-go-test.yml..github/workflows/test.yml— Passes secrets through toreusable-ci.yml.Additional Notes
Validated end-to-end with a deliberate breaking change:
DashboardListDeleteItemsRequest→DashboardListRemoveItemsRequestReview 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.