-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Fail PR if it has a structural schema change in a released version #2864
Merged
balopat
merged 9 commits into
GoogleContainerTools:master
from
balopat:check_ast_change
Sep 13, 2019
Merged
Fail PR if it has a structural schema change in a released version #2864
balopat
merged 9 commits into
GoogleContainerTools:master
from
balopat:check_ast_change
Sep 13, 2019
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
584a881
to
8d2736e
Compare
hack/check-schema-changes.sh checks whether the PR compared to master contains any changes in the config.go files under pkg/skaffold/schema. If yes, it checks if those changes are structural changes or not. If they are and the package is not "latest", then we'll fail the PR as we assume anything else than latest is already released and shouldn't be changed. If the change is latest and it is released, we fail the PR for the same reason. If the change is in latest and it is not released yet, it is fine to make changes.
1501dd2
to
a7a5970
Compare
tejal29
reviewed
Sep 12, 2019
b6e604b
to
6a6418d
Compare
tejal29
suggested changes
Sep 13, 2019
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.
Let me know what you think for changing this script to just check for latest/config.go.
Lets try to get this in today, we can test it against an incoming PR #2871
tejal29
approved these changes
Sep 13, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The most important part of #2775.
I broke it up to 2 PRs - this one is going to be the second one, should be rebased and merged AFTER the refactoring one: #2867
It checks whether the PR compared to master contains any changes in the
config.go
files underpkg/skaffold/schema
. If yes, it checks if those changes are structural changes or not. If they are and the package is not "latest", then we'll fail the PR as we assume anything else thanlatest
is already released and shouldn't be changed. If the change islatest
and it is released, we fail the PR for the same reason. If the change is inlatest
and it is not released yet, it is fine to make changes.I decided to compare against master. This enables to override this check in case it gets in the way (some kind of historical refactoring that this check recognizes as a structural change incorrectly, or in case we do want to introduce a structural change historically) - if a maintainer has Admin rights they can merge it still.
detected structural change in released version:
Example Travis Build on this PR: https://travis-ci.com/GoogleContainerTools/skaffold/jobs/234305164
detected structural changes in unreleased
latest
:Example Travis Build on this PR: https://travis-ci.com/GoogleContainerTools/skaffold/jobs/234305550
structural change in
latest
that is also released (i.e. on a PR that tries to modify config after a release):Example Travis Build on this PR (simulated by temporarily switching the released logic):
https://travis-ci.com/GoogleContainerTools/skaffold/jobs/234306518
Error handling when failed to list Github repos: