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

Respect amount when listing releases #63

Merged
merged 2 commits into from
Oct 25, 2024

Conversation

bosunski
Copy link
Contributor

@bosunski bosunski commented Oct 25, 2024

Summary

This PR updates ListReleases to respect the amount value.

Implementation

  • Before this change, ListReleases would keep looping until the EndCursor even when the amount was set to 1 and the release had already been found. I have now updated the conditional check that determines whether the loop should continue or break.
  • I also think the purpose of amount might be misinterpreted as it is used as the first parameter in the GraphQL release query. This means amount is the number of releases that GitHub should return per query (more like per page). Instead, the amount is the maximum number of releases that should be returned after filtering. To correct this, I have set a fixed value of 10 for the first variable. This also now makes finding a single release faster since GitHub will now return 10 release nodes per query.

@bosunski bosunski requested a review from lucasmdrs October 25, 2024 10:04
@bosunski bosunski marked this pull request as ready for review October 25, 2024 10:04
Copy link
Contributor

@lucasmdrs lucasmdrs left a comment

Choose a reason for hiding this comment

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

Looks good :shipit:

It's a bit hard to be sure since the behavior was not documented before, but from the examples I agree with your interpretation of the param amount.

@bosunski bosunski merged commit a47c9b3 into master Oct 25, 2024
6 checks passed
@bosunski bosunski deleted the respect-amount-in-list-realeases branch October 25, 2024 12:32
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.

2 participants