fix!: Change copilot_code_review field names to match GitHub API#3874
fix!: Change copilot_code_review field names to match GitHub API#3874gmlewis merged 5 commits intogoogle:masterfrom
copilot_code_review field names to match GitHub API#3874Conversation
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.
Thank you, @JiayangZhou!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.
cc: @stevehipwell - @alexandear - @zyfy29
|
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... 👀 |
|
Hey @gmlewis would you mind creating a new release that includes this change? Thanks a lot! |
Done: |
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