Skip to content

feat: expose infragraph entitlement fields from API#1351

Merged
JadhavPoonam merged 4 commits into
mainfrom
IG-2129/expose-infragraph-entitlements
Jun 2, 2026
Merged

feat: expose infragraph entitlement fields from API#1351
JadhavPoonam merged 4 commits into
mainfrom
IG-2129/expose-infragraph-entitlements

Conversation

@JadhavPoonam
Copy link
Copy Markdown
Contributor

@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

🧪 1 Test failed

❄️ Known flaky: TestWorkspacesReadWithHistory_RunDependent from workspace_integration_test.go   View in Datadog   (Fix with Cursor)
Could not read run "run-RawUwpz8irnwEWmo": context deadline exceeded

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 8c9e542 | 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>
@JadhavPoonam JadhavPoonam merged commit 66f4154 into main Jun 2, 2026
15 checks passed
@JadhavPoonam JadhavPoonam deleted the IG-2129/expose-infragraph-entitlements branch June 2, 2026 20:55
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

Reminder to the contributor that merged this PR: if your changes have added important functionality or fixed a relevant bug, open a follow-up PR to update CHANGELOG.md with a note on your changes.

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