-
Notifications
You must be signed in to change notification settings - Fork 2.2k
fix!: Change copilot_code_review field names to match GitHub API
#3874
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3874 +/- ##
=======================================
Coverage 92.44% 92.44%
=======================================
Files 200 200
Lines 14494 14500 +6
=======================================
+ Hits 13399 13405 +6
Misses 895 895
Partials 200 200 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
copilot_code_review field names to match GitHub API
gmlewis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @JiayangZhou!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.
cc: @stevehipwell - @alexandear - @zyfy29
stevehipwell
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Thank you, @stevehipwell! |
@JiayangZhou It is not your fault. GitHub just changed payload params for Copilot Code Review to move it from Pull Request property boolean to Rules root object without bumping API version last week. We encountered same issue. And since this field was in Preview, they didn't even bother to announce breaking change API. |
|
It's a good job they added API versioning... 👀 |
BREAKING CHANGE:
CopilotCodeReviewRuleParameters.ReviewNewPushesis nowReviewOnPush.Rename ReviewNewPushes to ReviewOnPush with json tag review_on_push
Hey sorry when I reviewed the github API doc https://docs.github.com/en/rest/repos/rules?apiVersion=2022-11-28 I noticed that the payload parameter we previously used was incorrect, thus I am creating this PR to correct it, sorry for the innocence!
Edit: also added MarshalJSON tests under
func TestRepositoryRule.currently only forcopilot_code_review'creation' i guess others can add if they wantEdit2:
I think you are right from the beginning, i was too naive, so for this API
go-github/github/repos_rules.go
Line 41 in 1830689
i verified it from here too https://docs.github.com/en/rest/repos/rules?apiVersion=2022-11-28#get-rules-for-a-branch