-
Notifications
You must be signed in to change notification settings - Fork 79
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
Check cedar-policy
SemVer compatibility on pull requests
#168
Check cedar-policy
SemVer compatibility on pull requests
#168
Conversation
cedar-policy
SemVer compatibility on pull requestscedar-policy
SemVer compatibility on pull requests (feedback wanted)
Is this blocking for a merge into |
I think you can change which status checks are required to pass for merging in the repository settings? I figure it's better to surface this information at the individual PR level rather than in bulk on preparing to cut a release. At code review time, the results are more actionable: unintended API breakage can be immediately corrected by the PR author in the course of their normal workflow; intended breakage can be allowed through. Then each merge ends up annotated with whether it breaks SemVer, which could be used for deciding what's safe to cherry-pick into a release. If the checks are put off until it's time to actually cut a release, then fixing detected breakage would involve tracking down the origin of each incompatibility, looping in the responsible parties, and pulling them away from whatever they were doing to make corrections to work they already 'completed'. Scheduling and other pressures at release-time could make it tempting to take shortcuts or allow things through that we otherwise wouldn't. This was my takeaway from the Google paper on successfully implementing static analysis tools in developer workflows. |
Checking semver for each PR is good, but I would not want to be a position where we are regularly overriding an otherwise blocking CI failure due to an expected semver break. If there's an option to treat this one check as a warning, then that's good by me. |
Looks like we could set |
8b3edb1
to
1148343
Compare
I set |
eb4685a
to
ecd3cc9
Compare
I tacked on sample commit that breaks SemVer compatibility. How does that look? |
LGTM |
As I understand it, this will check for symver breaks just for this PR's change. So I don't think we'd have to override the merge continually (as we would if it checked for symver against e.g. the latest tagged commit starting with "v"). Personally I'm fine with this. It's similar to our process for overriding changes that will break cedar-spec. I view this as a sanity check where the failing action reminds you to check that the changelog is modified in this PR before overriding. |
I think it's at least worth trying. It's not hard to undo if we end up not liking the process. |
3264193
to
aa88d0e
Compare
I've made the check optional for normal PRs and mandatory for PRs into This PR should currently be showing up with a failed SemVer check that doesn't block merging. I submitted #172 against @andrewmwells-amazon @john-h-kastner-aws If this looks good to y'all (I can't confirm from my end whether the checks are properly requiring/not-requiring overrides), then I'll remove the breakage-inducing commit and this'll be ready to merge. |
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.
Seems alright to me.
Two comments the CI script.
Seems good to me (modulo comments) |
6d3d479
to
5708c35
Compare
This should be good to go! |
cedar-policy
SemVer compatibility on pull requests (feedback wanted)cedar-policy
SemVer compatibility on pull requests
5708c35
to
3d779d1
Compare
Resolved a merge conflict. |
(cherry picked from commit 7f1a004)
) (#228) Co-authored-by: Michael Smith <[email protected]>
Description of changes
This adds a GItHub Actions workflow to check changes to
cedar-policy
's public API against the base branch for SemVer compatibility, using cargo semver-checks.Currently this depends on my fork of
cargo-semver-checks-action
, with changes I'll send upstream if this is deemed worth merging.Issue #, if available
N/A
Checklist for requesting a review
The change in this PR is (choose one, and delete the other options):
cedar-policy-core
,cedar-validator
, etc.)I confirm that this PR (choose one, and delete the other options):
I confirm that
cedar-spec
(choose one, and delete the other options):Disclaimer
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.