-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
fix!: Refactor the repository ruleset code #3430
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Steve Hipwell <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3430 +/- ##
==========================================
- Coverage 97.72% 90.49% -7.24%
==========================================
Files 153 175 +22
Lines 13390 15282 +1892
==========================================
+ Hits 13085 13829 +744
- Misses 215 1300 +1085
- Partials 90 153 +63 ☔ View full report in Codecov by Sentry. |
Thank you, @stevehipwell ! |
Signed-off-by: Steve Hipwell <[email protected]>
@gmlewis sorry I thought I had run it, but I was making change while reviewing the PR diff so I guess I missed running it for one of the changes. Should be right now. |
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 for doing this, @stevehipwell - this cleanup is looking really nice!
Please remember to not force-push, as that will save me a huge amount of time after you address my comments... thanks again!
Signed-off-by: Steve Hipwell <[email protected]>
@gmlewis I've pushed the changes you requested, and remembered to not force push! 🥳 |
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, @stevehipwell !
Just a few more minor concerns, please, if you don't mind.
Signed-off-by: Steve Hipwell <[email protected]>
@gmlewis is there a reason why we're not making the update functions (e.g. |
I'm betting that the original endpoints were poorly named and I didn't catch it. Since this is a fairly significant breaking change, I would say that now is the time in this PR to make the method names actually describe what they are doing. So feel free to make them consistent in your renaming. |
Would this be better as a separate but linked PR? I expect to change the behaviour of the update functions and add patch functions. The standard struct would lose the |
Signed-off-by: Steve Hipwell <[email protected]>
Signed-off-by: Steve Hipwell <[email protected]>
Absolutely, if you don't mind... that sounds great. Thank you, @stevehipwell ! |
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, @stevehipwell and thanks also for your patience with my requests for changes... I really appreciate it!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.
Signed-off-by: Steve Hipwell <[email protected]>
This PR refactors the repository ruleset functionality to make is consistent, the following items are the big picture changes.
RepositoryRuleset
type in both the REST API and eventsjson.RawMessage
field when the actual type is knownRepositoryRulesetRules
to represent the ruleset rules in a strongly typed way (this could be swapped to[]RepositoryRulesetRule
with the type data still present behind anany
)BranchRules
to represent the rules for a branch in a strongly typed way (this could be swapped to[]BranchRule
with the type data still present behind anany
)BREAKING CHANGES: The following types have been renamed:
Ruleset
->RepositoryRuleset
RulesetLink
->RepositoryRulesetLink
RulesetLinks
->RepositoryRulesetLinks
RulesetRefConditionParameters
->RepositoryRulesetRefConditionParameters
RulesetRepositoryNamesConditionParameters
->RepositoryRulesetRepositoryNamesConditionParameters
RulesetRepositoryIDsConditionParameters
->RepositoryRulesetRepositoryIDsConditionParameters
RulesetRepositoryPropertyTargetParameters
->Repository
RulesetRepositoryPropertyConditionParameters
->RepositoryRulesetRepositoryPropertyConditionParameters
RulesetOrganizationNamesConditionParameters
->RepositoryRulesetOrganizationNamesConditionParameters
RulesetOrganizationIDsConditionParameters
->RepositoryRulesetOrganizationIDsConditionParameters
RulesetConditions
->RepositoryRulesetConditions
RepositoryRulesetEditedChanges
->RepositoryRulesetChanges
RepositoryRulesetEditedSource
->RepositoryRulesetChangeSource
RepositoryRulesetEditedSources
->RepositoryRulesetChangeSources
RepositoryRulesetEditedConditions
->RepositoryRulesetUpdatedConditions
RepositoryRulesetUpdatedConditionsEdited
->RepositoryRulesetUpdatedCondition
RepositoryRulesetEditedRules
->RepositoryRulesetChangedRules
RepositoryRulesetUpdatedRules
->RepositoryRulesetUpdatedRules
RepositoryRulesetEditedRuleChanges
->RepositoryRulesetChangedRule
Fixes: #3429.
@gmlewis this PR adds the the breaking changes in #3417. The event changes have been tested with real world data. I'm happy to discuss any of the changes.