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

Fixes audit trail pagination data within list endpoint #586

Merged
merged 2 commits into from Nov 14, 2022

Conversation

brandonc
Copy link
Collaborator

Closes #585

Description

The Audit Trails endpoint is a bit of a snowflake and uses different keys than what was conventional. Added test coverage.

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.

go test ./... -v -run TestAuditTrailsList
=== RUN   TestAuditTrailsList
=== RUN   TestAuditTrailsList/with_no_specified_timeframe
=== RUN   TestAuditTrailsList/with_no_specified_timeframe/pagination_parameters
=== RUN   TestAuditTrailsList/with_no_specified_timeframe/with_resource_deserialized_correctly
=== RUN   TestAuditTrailsList/with_no_specified_timeframe/with_auth_deserialized_correctly
=== RUN   TestAuditTrailsList/with_no_specified_timeframe/with_request_deserialized_correctly
=== RUN   TestAuditTrailsList/using_since_query_param
--- PASS: TestAuditTrailsList (12.45s)
    --- PASS: TestAuditTrailsList/with_no_specified_timeframe (1.32s)
        --- PASS: TestAuditTrailsList/with_no_specified_timeframe/pagination_parameters (0.76s)
        --- PASS: TestAuditTrailsList/with_no_specified_timeframe/with_resource_deserialized_correctly (0.00s)
        --- PASS: TestAuditTrailsList/with_no_specified_timeframe/with_auth_deserialized_correctly (0.00s)
        --- PASS: TestAuditTrailsList/with_no_specified_timeframe/with_request_deserialized_correctly (0.00s)
    --- PASS: TestAuditTrailsList/using_since_query_param (2.60s)
PASS
ok  	github.com/hashicorp/go-tfe	13.245s
?   	github.com/hashicorp/go-tfe/examples/organizations	[no test files]
?   	github.com/hashicorp/go-tfe/examples/workspaces	[no test files]
?   	github.com/hashicorp/go-tfe/internal/testsetup	[no test files]
?   	github.com/hashicorp/go-tfe/mocks	[no test files]
...

@brandonc brandonc requested a review from a team as a code owner November 11, 2022 17:13
@brandonc brandonc force-pushed the brandonc/audit_trail_pagination branch from 5bef32e to 6aee364 Compare November 14, 2022 16:36
Copy link
Contributor

@sebasslash sebasslash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Subtle catch, thanks for this fix 🔥

@brandonc brandonc merged commit 7a3cfda into main Nov 14, 2022
@brandonc brandonc deleted the brandonc/audit_trail_pagination branch November 14, 2022 21:56
@github-actions
Copy link

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.

Audit Trails API pagination doesn't work
2 participants