Skip to content
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

Add support for the Explorer API #1018

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

sebasslash
Copy link
Contributor

@sebasslash sebasslash commented Dec 5, 2024

Description

Adds support for the two current GA endpoints of the Explorer API:

Testing plan

To run the tests, you will need an organization available with enough activity to test several different types of queries. The organization must be specified using the EXPLORER_TEST_ORGANIZATION environment variable; otherwise, the tests will be skipped. Test assertions rely on the current state of the specified organization, and failures may occur if the organization does not meet the required query conditions enumerated in the integration tests. For guidance on writing custom queries to smoke test on your own, refer to the code examples provided in the ./examples/explorer directory.

External links

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://example" TFE_TOKEN="example" go test ./... -v -run TestFunctionsAffectedByChange

...

@sebasslash sebasslash requested a review from a team as a code owner December 5, 2024 22:10
@datadog-terraform-cloud-hashicorp
Copy link

datadog-terraform-cloud-hashicorp bot commented Dec 5, 2024

Datadog Report

Branch report: sebasslash/add-explorer-api
Commit report: 3181cda
Test service: hashicorp/go-tfe

✅ 0 Failed, 1420 Passed, 154 Skipped, 14m 21.79s Total Time
🔻 Test Sessions change in coverage: 1 decreased (-0.6%)

🔻 Code Coverage Decreases vs Default Branch (1)

  • datadog-ci junit upload 58.9% (-0.6%) - Details

This commit adds support for the two generally available endpoints in
the Explorer API: execute a query, export data to CSV. Since the jsonapi
decoder does not support unmarshalling polymorphic slices, each view type has been
assigned its own query function returning the appropriate data type.
@sebasslash sebasslash force-pushed the sebasslash/add-explorer-api branch from 4716d65 to 2c834cb Compare December 5, 2024 22:30
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.

1 participant