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

Handle API pagination #426

Merged
merged 2 commits into from
Jul 17, 2024
Merged

Handle API pagination #426

merged 2 commits into from
Jul 17, 2024

Conversation

jtdoepke
Copy link
Contributor

@jtdoepke jtdoepke commented Jun 6, 2024

Description

We encountered a bug where some workspaces that should have had run triggers added by the operator did not have them. We suspected it was due to the controller not handling pagination. I'm no longer sure that's the source of our bug, but it still seems reasonable that any calls to a Terraform Cloud API endpoint that is paginated should handle that pagination.

Usage Example

N/A

References

N/A

Community Note

  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

@jtdoepke jtdoepke requested a review from a team as a code owner June 6, 2024 23:45
@jtdoepke jtdoepke force-pushed the paginate-lists branch 3 times, most recently from e780a15 to 4edee4d Compare June 7, 2024 13:51
@arybolovlev
Copy link
Contributor

Hi @jtdoepke,

This is indeed a thing that we have missed. Could you please rebase your PR? I will then review it and we could add this fix to the 2.6.0 release(ETA this month).

Thanks!

Calls to Terraform Cloud API endpoints that are paginated should handle
that pagination.
@jtdoepke
Copy link
Contributor Author

@arybolovlev done.

Copy link
Contributor

@arybolovlev arybolovlev left a comment

Choose a reason for hiding this comment

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

Hi @jtdoepke,

All in all, everything looks good. Could you please add PageSize: maxPageSize, to the option list?

Thanks!

Set the page size to 100 to speed up pagination.
Copy link
Contributor

@arybolovlev arybolovlev left a comment

Choose a reason for hiding this comment

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

Thank you for this fix, @jtdoepke! 🚀 It will be available in 2.6.0 release. ETA end of July.

@arybolovlev arybolovlev merged commit 96b5ded into hashicorp:main Jul 17, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants