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

fix(3163): Add sort and sortby query params for pipeline list events #3169

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

tkyi
Copy link
Member

@tkyi tkyi commented Aug 11, 2024

Context

We need to be able to sort in a different order than descending.

Objective

This PR adds sort and sortBy to pipeline list events endpoint. Also updates joi schema for event ID query param for Swagger.

References

Related to #3163

License

I confirm that this contribution is made under a BSD license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

@coveralls
Copy link

coveralls commented Aug 11, 2024

Coverage Status

coverage: 95.258% (+0.003%) from 95.255%
when pulling c8253cb on fixPipelineEvents
into c3888a7 on master.

@@ -44,7 +44,7 @@ module.exports = () => ({
}

const eventType = request.query.type || 'pipeline';
const config = { params: { type: eventType } };
const config = { params: { type: eventType }, sort };
Copy link
Member

Choose a reason for hiding this comment

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

What happens when sort is not specified in the request.query?
i.e. when config.sort: undefined

Should we add sort to config only when it is explicitly specified?

Copy link
Member Author

Choose a reason for hiding this comment

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

Comment on lines 118 to 120
`GET /pipelines/{id}/events?id=gt:{eventId}&count={countNumber}` (greater than eventId)
`GET /pipelines/{id}/events?id=lt:{eventId}&count={countNumber}` (less than eventId)
`GET /pipelines/{id}/events?id=lt:{eventId}&count={countNumber}&sort=ascending` (less than eventId)
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: put a line break between line 118 and 119.

@tkyi tkyi force-pushed the fixPipelineEvents branch from dff9168 to c8253cb Compare August 12, 2024 17:26
@tkyi tkyi merged commit f446885 into master Aug 13, 2024
2 checks passed
@tkyi tkyi deleted the fixPipelineEvents branch August 13, 2024 05:46
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.

4 participants