Skip to content

feat!: Fix source property on Repo Custom Properties #3333

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

Merged
merged 2 commits into from
Oct 27, 2024

Conversation

claystation
Copy link
Contributor

@claystation claystation commented Oct 24, 2024

BREAKING CHANGE: Change RulesetRepositoryPropertyTargetParameters.Source from string to *string.

Our application was failing to apply or update Github Rulesets because of the following error:

Invalid property /conditions: data matches no possible input. See `documentation_url`. []

Following the release of Go Github v65. Digging into this we saw a change in the following PR #3250.
Looking into the Github REST API the source attribute is not listed as required. Thus we also did not implement this on our side. The problem that surfaced was the fact that the property was still being sent to the Github API even though it was empty.

With this PR we make it optional, a pointer, and i adapted test cases to verify that it is indeed missing when empty.
I tested this with our own fork of Go Github and it works for our case again.

Let me know what you think!

@gmlewis gmlewis added NeedsReview PR is awaiting a review before merging. Breaking API Change PR will require a bump to the major version num in next release. Look here to see the change(s). labels Oct 24, 2024
@gmlewis gmlewis changed the title Fix source property on Repo Custom Properties feat!: Fix source property on Repo Custom Properties Oct 24, 2024
Copy link

codecov bot commented Oct 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.01%. Comparing base (2b8c7fa) to head (06d5a72).
Report is 158 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3333      +/-   ##
==========================================
- Coverage   97.72%   93.01%   -4.71%     
==========================================
  Files         153      172      +19     
  Lines       13390    14848    +1458     
==========================================
+ Hits        13085    13811     +726     
- Misses        215      944     +729     
- Partials       90       93       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

Thank you, @claystation, and I apologize for the breakage, as I should have caught that.
LGTM.

Awaiting second LGTM+Approval from any other contributor to this repo before merging.

@gmlewis gmlewis removed the NeedsReview PR is awaiting a review before merging. label Oct 27, 2024
@gmlewis
Copy link
Collaborator

gmlewis commented Oct 27, 2024

Thank you, @tomfeigin !
Merging.

(The test breakage appears to be unrelated to this PR - I will investigate and fix in a separate PR.)

@gmlewis gmlewis merged commit 9f20524 into google:master Oct 27, 2024
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking API Change PR will require a bump to the major version num in next release. Look here to see the change(s).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants