-
Notifications
You must be signed in to change notification settings - Fork 102
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
base: main
Are you sure you want to change the base?
Conversation
Datadog ReportBranch report: ✅ 0 Failed, 1421 Passed, 167 Skipped, 16m 1.88s Total Time 🔻 Code Coverage Decreases vs Default Branch (1)
|
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.
4716d65
to
2c834cb
Compare
@@ -51,7 +51,6 @@ type GHAInstallationListOptions struct { | |||
func (s *gHAInstallations) List(ctx context.Context, options *GHAInstallationListOptions) (*GHAInstallationList, error) { | |||
u := "github-app/installations" | |||
req, err := s.client.NewRequest("GET", u, options) | |||
fmt.Println(u) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Smoke tested, looks great! Thanks for doing this! ✨
This is cool, but might lock us into a path that we don't want to go down quite yet. One thing that we want to get to is an explorer discovery endpoint that could be used to look up type and field information, so that we don't have to hardcode all of the types and supported fields here and can instead read them from the backend and get some metadata around supported data types and operations. There's a decent amount that we could use in the future, but I'd like to hold off on this for the moment just so we don't have to undo things in the near future. Thank you for taking a first swipe at this! |
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.