-
Notifications
You must be signed in to change notification settings - Fork 194
CI: Add ability to skip CI run in fast-return script #2915
CI: Add ability to skip CI run in fast-return script #2915
Conversation
Optimise `install_jq()` to return immediately if `jq(1)` is already available, which can speed up the function significantly. Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
Refactor to simplify `check_force_label()`. That function now calls a generic `check_label()` function, which in turn calls `is_label_set()` to handle the GitHub API call. Added tests for new functions. Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
Allow the CI to be skipped if the magic `force-skip-ci` label is set for a PR. Added test for new function. Fixes: kata-containers#2914. Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
fwiw, the |
Even if this passes all the CI checks and gets approved, let's not land this until Monday "just in case" ;-) Note the new tests, plus I have tested the functionality on a real repo, but... Warsaw's Second Law 😄 |
Note the description of the
|
/test |
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.
@jodh-intel I really tried to find any problem, but I didn't :)
|
||
install_jq | ||
local_info "label '$label' not found" |
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.
@wainersm - is this the line you meant? This is correct because is_label_set()
"returns" 1
if the label is found. I've quoted returns because all the functions actually return zero but echo a string to stdout as the actual return value. That was the original design to work within the confines of set -e
so I've retained that to keep the diff minimal.
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.
hi @jodh-intel - I made a comment about that line but later and quickly I noticed I said something wrong. I deleted the comment, so never mind. You change looks good to me.
Allow the CI to be skipped if the magic
force-skip-ci
label is set for a PR.Added test for new function.
Fixes: #2914.
Signed-off-by: James O. D. Hunt james.o.hunt@intel.com