-
Notifications
You must be signed in to change notification settings - Fork 50
Add check-for-breaking-api-changes.sh script #21
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
Add check-for-breaking-api-changes.sh script #21
Conversation
Signed-off-by: Si Beaumont <[email protected]>
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.
Looks good! Is it intentional that this PR adds the script, but doesn't call it from docker-compose? Will that come in a subsequent PR or was it meant to be done here as well?
It looks to me like other projects don't have an explicit Compose service for this action. Instead the pipeline calls
We'll need something similar in CI—just that we'll environment variables so that we use named arguments. Based on this I didn't add an explicit Compose service. |
@yim-lee please could you set up a pipeline that runs the following command? docker-compose -f docker/docker-compose.yaml run \
-e BASELINE_REPO_URL=https://github.com/apple/swift-openapi-runtime \
-e BASELINE_TREEISH=main \
shell scripts/check-for-breaking-api-changes.sh We can use this PR as a canary. //cc @czechboy0 |
@swift-server-bot test this please |
@simonjbeaumont Added pipeline as requested: https://ci.swiftserver.group/job/swift-openapi-runtime-api-breakage-prb/1/ |
Great, thanks @yim-lee! @czechboy0 I'm going to add a commit to this PR to test it shows a break, then I'll revert and we can land this one. |
Great, with the canary commit above, the pipeline fails as we hoped:
— source: https://ci.swiftserver.group/job/swift-openapi-runtime-api-breakage-prb/2/console |
This reverts commit 0196ba7.
//cc @czechboy0 think we're good to merge this now (see above to see it in action). |
Great! Ship it |
Motivation
We want to know when we are making breaking changes to our public API.
Modifications
Add a script that wraps
swift package diagnose-api-breaking-changes
which we'll start to use in CI.Result
A script can be used to validate the current repo state against a baseline repo and treeish for breaking API changes.
Notes
Running this script produces the following output:
Then making the following local change...
...and rerunning the script, gives the following output...