-
-
Notifications
You must be signed in to change notification settings - Fork 111
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
chore(core): Add additional API checks 🎬 #9867
Conversation
User Test ResultsTest specification and instructions User tests are not required |
ff88242
to
7f166a6
Compare
This change adds additional checks for the symbols file: - if a line with a method name gets changed, the package version number in that line also needs to be updated - for major API changes (methods renamed or removed) the API version numbers needs to be incremented - the API version numbers in the .symbols file and in `CORE_API_VERSION.md` need to match
7f166a6
to
30250e3
Compare
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.
Given the changes to trigger-builds impacts all platforms and every build, I would like to split them out into a separate branch for discussion and review. The changes shouldn't be buried.
I haven't yet reviewed the other aspects of this PR
I split out the Core API version change into #9877. |
linux/scripts/deb-packaging.sh
Outdated
"--git-ref=GIT_REF The ref of the HEAD commit, e.g. HEAD of the PR branch (for verify action)" \ | ||
"--git-base=GIT_BASE The ref of the base commit, e.g. HEAD of the master branch (for verify action)" |
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.
Should these be SHAs or commitishes/refs, tag names, branch names or what? 😁
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.
"--git-ref=GIT_REF The ref of the HEAD commit, e.g. HEAD of the PR branch (for verify action)" \ | |
"--git-base=GIT_BASE The ref of the base commit, e.g. HEAD of the master branch (for verify action)" | |
"--git-ref=GIT_REF The SHA of the HEAD commit, e.g. of the PR branch (for verify action)" \ | |
"--git-base=GIT_BASE The ref of the base commit, usually the name of the base branch, e.g. master, stable-16.0 (for verify action)" |
cd "${REPO_ROOT}/linux" | ||
} | ||
|
||
is_symbols_file_changed() { |
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.
is_symbols_file_changed() { | |
# | |
# Compare the SHA of the base and head commits for changes to the .symbols file | |
# | |
is_symbols_file_changed() { |
|
||
check_api_not_changed() { | ||
# Checks that the API did not change compared to what's documented in the .symbols file | ||
tmpDir=$(mktemp -d) |
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.
Cleanup?
linux/scripts/deb-packaging.sh
Outdated
# .symbols file changed, now check if the package version got updated as well | ||
# Note: We don't check that ALL changes in that file have an updated package version - | ||
# we hope this gets flagged in code review. | ||
if ! git log -p -1 -- "debian/${PKG_NAME}.symbols" | grep -q "${PKG_VERSION}"; then |
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.
${PKG_VERSION}
could just be ${VERSION}
I think? And then we can eliminate all of that from this script?
# .symbols file changed, now check if the package version got updated as well | ||
# Note: We don't check that ALL changes in that file have an updated package version - | ||
# we hope this gets flagged in code review. |
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.
# .symbols file changed, now check if the package version got updated as well | |
# Note: We don't check that ALL changes in that file have an updated package version - | |
# we hope this gets flagged in code review. | |
# .symbols file changed, now check if the package version got updated as well | |
# Note: We don't check that ALL changes in that file have an updated package version - | |
# we hope this gets flagged in code review. | |
# Note: This version number check may not match the actual released version, if the branch | |
# is out of date when it is merged to the release branch (master/beta/stable-x.y). If this | |
# is considered important, then make sure the branch is up to date, and wait for test | |
# builds to complete, before merging. |
linux/scripts/deb-packaging.sh
Outdated
get_api_version_in_symbols_file() { | ||
# Extract 1 from "libkeymancore.so.1 libkeymancore #MINVER#" | ||
local firstline | ||
firstline=$(head -1 "debian/${PKG_NAME}.symbols") |
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.
firstline=$(head -1 "debian/${PKG_NAME}.symbols") | |
firstline="$(head -1 "debian/${PKG_NAME}.symbols")" |
linux/scripts/deb-packaging.sh
Outdated
git checkout "${GIT_SHA}" -- "debian/${PKG_NAME}.symbols" | ||
NEW_VERSION=$(get_api_version_in_symbols_file) | ||
git checkout "${GIT_BASE}" -- "debian/${PKG_NAME}.symbols" | ||
OLD_VERSION=$(get_api_version_in_symbols_file) | ||
git checkout "${GIT_SHA}" -- "debian/${PKG_NAME}.symbols" |
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.
We could reduce the number of checkouts by switching order of operations here, but it's not terribly important.
Addresses code review comment.
Changes in this pull request will be available for download in Keyman version 17.0.210-alpha |
numbers needs to be incremented
CORE_API_VERSION.md
need to matchCloses #9801
@keymanapp-test-bot skip