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
ensure publish.sh
uses the latest automodel
release
#15165
Conversation
publish.sh
to use the latest automodel
releasepublish.sh
uses the latest automodel
release
440e4d5
to
bacc87b
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.
Thanks! Looking good, just some minor comments
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) | ||
CURRENT_SHA=$(git rev-parse HEAD) | ||
|
||
if [ -z "${1:-}" ]; 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.
Wouldn't it be clearer to case on $#
?
== 0
: use the latest release of codeml-automodel== 1 and equal to "override-release"
: use the current head- anything else: error message, display help
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.
I think it's simpler to type:
./publish
only. Because only in exceptional cases do we want to override. And so, for those exceptional cases, you have to specify an extra parameter.
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.
Yes I agree - I was just making a comment on how to parse the presence/absence of that parameter
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.
Fixed.
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.
Not quite. There's still no check that at most 1 argument is supplied. My suggestion is the way to do it.
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.
Woops, sorry, rushing.
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.
OK, fixed now (and I tested it).
# ./src/change-notes/released/<version>.md | ||
|
||
if [ -z "${1:-}" ]; then | ||
# If we used the latest release of codeml-automodel, then we need to return to the current branch |
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.
Could we expand that comment to remind us it's fine to do so because we worked from the last commit that modified those files - and so our changes won't be conflicting with checking out the branch
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.
Here we're simply returning to our working branch (after publishing a different version of the repo specified by a release sha
). The script has already ensured that you do not have any locally modified and uncommitted files. So returning to the working branch will work fine -- but you will now have some modified files that need to be committed.
7c56967
to
2e0ab43
Compare
0193452
to
4530510
Compare
The
automodel
extraction queries (released as acodeql
query pack), andautomodel
Python CLI (released as part ofturbomodel
) are functionally coupled. They must be released "together". The official releases of thecodeml-automodel
repo (see https://github.com/github/codeml-automodel/releases) specify coupledsha
s.This PR upgrades the
publish.sh
script to default to publishing the version of theautomodel
extraction queries that correspond to the latest release ofcodeml-automodel
; specifically, invokingpublish.sh
will:codeql
distribution (needed to package and publish the query pack)codeql
code you wish to publish is later than the current published packcodeml-automodel
release, which specifies thesha
of thecodeql
repo that should be published, and checks out thissha
git add
s the local changes generated by the publication process, which the user must then commit and merge tocodeql
main
N.B. Users can override the default by specifying
publish.sh override-release
to publish theHEAD
of their local version of theautomodel
extraction queries. (This conforms to the previous behavior of the script).Addresses: https://github.com/github/codeql-team/issues/2467
See related PR: https://github.com/github/turbomodel/pull/208