Skip to content

feat: expose infragraph entitlement fields from API#1351

Open
JadhavPoonam wants to merge 3 commits into
mainfrom
IG-2129/expose-infragraph-entitlements
Open

feat: expose infragraph entitlement fields from API#1351
JadhavPoonam wants to merge 3 commits into
mainfrom
IG-2129/expose-infragraph-entitlements

Conversation

@JadhavPoonam
Copy link
Copy Markdown

@JadhavPoonam JadhavPoonam commented Jun 1, 2026

Description

Adds Infragraph and InfragraphWithNRTU boolean fields to the Entitlements struct, mapping to the infragraph and infragraph-with-nrtu HTTP API attributes.

Testing plan

Tested in staging by assigning my user admin role.

  1. Assign my user admin role
  2. Generate user token
  3. Set env vars export TFE_ADMIN_PROVISION_LICENSES_TOKEN="<token>" and export TFE_ADDRESS="https://app.staging.terraform.io"

External links

Atlas changes in the
Related PR
Jira ticket

Output from tests

Including output from tests may require access to a TFE instance. Ignore this section if you have no environment to test against.

$ TFE_ADDRESS="https://app.staging.terraform.io" TFE_TOKEN="token" go test ./... -v -run TestOrganizationsReadEntitlements

go test -v -run TestOrganizationsReadEntitlements -timeout 120s                                                                                                                        
=== RUN   TestOrganizationsReadEntitlements
=== PAUSE TestOrganizationsReadEntitlements
=== CONT  TestOrganizationsReadEntitlements
=== RUN   TestOrganizationsReadEntitlements/when_the_org_exists
=== RUN   TestOrganizationsReadEntitlements/with_invalid_name
=== RUN   TestOrganizationsReadEntitlements/when_the_org_does_not_exist
--- PASS: TestOrganizationsReadEntitlements (2.49s)
    --- PASS: TestOrganizationsReadEntitlements/when_the_org_exists (0.13s)
    --- PASS: TestOrganizationsReadEntitlements/with_invalid_name (0.00s)
    --- PASS: TestOrganizationsReadEntitlements/when_the_org_does_not_exist (0.11s)
PASS
ok      github.com/hashicorp/go-tfe     2.746s

Rollback Plan

Changes to Security Controls

@datadog-terraform-cloud-hashicorp
Copy link
Copy Markdown

datadog-terraform-cloud-hashicorp Bot commented Jun 1, 2026

Tests

Fix all issues with Cursor

⚠️ Warnings

🧪 4 Tests failed

TestStackConfigurationDiagnostics from stack_configuration_integration_test.go   View in Datadog   (Fix with Cursor)
failed test
TestStackConfigurationDiagnostics/Diagnostics_with_valid_ID from stack_configuration_integration_test.go   View in Datadog   (Fix with Cursor)

	Error Trace:	/home/runner/work/go-tfe/go-tfe/stack_configuration_integration_test.go:173
	            				/home/runner/go/pkg/mod/github.com/!data!dog/dd-trace-go/v2@v2.8.2/internal/civisibility/integrations/gotesting/instrumentation_orchestrion.go:335
	            				/home/runner/go/pkg/mod/github.com/!data!dog/dd-trace-go/v2@v2.8.2/internal/civisibility/integrations/gotesting/instrumentation_orchestrion.go:339
	Error:      	Should NOT be empty, but was []
	Test:       	TestStackConfigurationDiagnostics/Diagnostics_with_valid_ID

❄️ Known flaky: TestStackDeploymentStepsList/List_without_options from stack_deployment_steps_integration_test.go   View in Datadog   (Fix with Cursor)

	Error Trace:	/home/runner/work/go-tfe/go-tfe/stack_deployment_steps_integration_test.go:72
	            				/home/runner/go/pkg/mod/github.com/!data!dog/dd-trace-go/v2@v2.8.2/internal/civisibility/integrations/gotesting/instrumentation_orchestrion.go:335
	            				/home/runner/go/pkg/mod/github.com/!data!dog/dd-trace-go/v2@v2.8.2/internal/civisibility/integrations/gotesting/instrumentation_orchestrion.go:339
	Error:      	Should NOT be empty, but was []
	Test:       	TestStackDeploymentStepsList/List_without_options

❄️ Known flaky: TestStackDeploymentStepsList/List_with_pagination from stack_deployment_steps_integration_test.go   View in Datadog   (Fix with Cursor)

	Error Trace:	/home/runner/work/go-tfe/go-tfe/stack_deployment_steps_integration_test.go:95
	            				/home/runner/go/pkg/mod/github.com/!data!dog/dd-trace-go/v2@v2.8.2/internal/civisibility/integrations/gotesting/instrumentation_orchestrion.go:335
	            				/home/runner/go/pkg/mod/github.com/!data!dog/dd-trace-go/v2@v2.8.2/internal/civisibility/integrations/gotesting/instrumentation_orchestrion.go:339
	Error:      	Should NOT be empty, but was []
	Test:       	TestStackDeploymentStepsList/List_with_pagination

View all

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 0aaab39 | Docs | Give us feedback!

@JadhavPoonam JadhavPoonam marked this pull request as ready for review June 1, 2026 20:54
@JadhavPoonam JadhavPoonam requested a review from a team as a code owner June 1, 2026 20:54
Copilot AI review requested due to automatic review settings June 1, 2026 20:54
Copy link
Copy Markdown
Contributor

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 extends the organization entitlements model to expose newly available Infragraph-related entitlement flags returned by the Terraform Enterprise/Cloud API.

Changes:

  • Adds Infragraph and InfragraphWithNRTU boolean fields to the Entitlements struct (mapping to infragraph and infragraph-with-nrtu API attributes).
  • Updates the organizations entitlements integration test to assert expected values for the new fields.
  • Documents the enhancement in the changelog.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
organization.go Extends Entitlements with new Infragraph-related JSON:API attributes.
organization_integration_test.go Validates new entitlement fields via ReadEntitlements integration test assertions.
CHANGELOG.md Adds an Unreleased enhancement entry describing the new entitlement fields.

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

Comment thread organization.go Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

2 participants