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

switching latestReviews with reviews #30

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AymanBx
Copy link

@AymanBx AymanBx commented Oct 21, 2023

Professor @brownsarahm,
A few students in lab today along with me had issues with retrieving approved badges using the specified command.

While investigating the reason I found that my version of gh CLI on WSL didn't have the option "latestReviews" as a query option.

While I didn't have time during lab today to check whether other students were facing a similar issue or just failed to do the correct setup to use the tools. I'm certain that my setup was fine, because after applying this fix locally I was able to use the command "sysapprovedbadges"

So if the difference between "latestReview" and "reviews" doesn't affect the outcome, I though I'd suggest the change.

Copy link
Contributor

@brownsarahm brownsarahm left a comment

Choose a reason for hiding this comment

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

So tested on your KWL, AymanBx:main gives you credit for only 16 badges, where main gives you 23. I am not going to accept this change as it is currently.

reviews I think gives the reviews in order from first to last where latestReviews is the other order.

I recommend first that you update your gh to make sure it is current and then run gh pr list --json to see the list of fields.

If there are truly up to date installs of gh that do not have latestReviews then we can do one of the following:

  • check for both, use the one that exists and warn that reviews may undercount
  • advise that this is only used with the version of gh that allows the latestReviews version to work
  • update the json processing to dig deeper through the reviews to find the approval (right now it only reads the first one (which is the most recent one)

@brownsarahm
Copy link
Contributor

@AymanBx were you able to check the version/upgrade your version of gh?

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