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

initial base work for implementing sorting and filter across API endpoints #12076

Merged
merged 2 commits into from
Feb 16, 2022

Conversation

lgfa29
Copy link
Contributor

@lgfa29 lgfa29 commented Feb 16, 2022

This PR adds two main changes that are require to add filter, pagination, and sort to API list endpoints:

  • move OrderAscending into QueryOptions so it's available to all endpoints. It also renames it just Ascending to match the name in api.
  • allow the paginator appendFunc to return an error, which will halt pagination. Some endpoints require additional data to construct the result, so they may return an error when fetching it.

This is an internal change, so no CHANGELOG required.

Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

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

LGTM once the tests are fixed up.

nomad/structs/structs.go Show resolved Hide resolved
Copy link
Member

@shoenig shoenig left a comment

Choose a reason for hiding this comment

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

LGTM

@lgfa29 lgfa29 merged commit 36e31c5 into main Feb 16, 2022
@lgfa29 lgfa29 deleted the api-sort-filter-base branch February 16, 2022 19:34
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants