Skip to content

Commit

Permalink
Merge pull request #20054 from MrKevinWeiss/pr/merge_groups_mirgration
Browse files Browse the repository at this point in the history
.murdock: Switch to github merge queue
  • Loading branch information
MrKevinWeiss authored Nov 8, 2023
2 parents 9ba6eb2 + 4b6eb91 commit c0dbc03
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions .murdock
Original file line number Diff line number Diff line change
Expand Up @@ -178,19 +178,27 @@ check_label() {
return $?
}

# this function returns 0 when this is build is building one of the two bors
# branches ("staging" or "trying", 1 otherwise.
is_bors_build() {
test "${CI_BUILD_BRANCH}" = "staging" || test "${CI_BUILD_BRANCH}" = "trying"
# true if "$2" starts with "$1", false otherwise
startswith() {
case "${2}" in
${1}*) true ;;
*) false ;;
esac
}

# this function returns 0 when this is build is building one of the two merge
# queue branches ("staging" or "trying", 1 otherwise.
is_merge_queue_build() {
startswith "gh-readonly-queue/" "${CI_BUILD_BRANCH}"
}

# Set CI_BASE_COMMIT in case of a bors build.
# This assumes that bors always adds a single merge commit (possibly itself
# Set CI_BASE_COMMIT in case of a merge queue build.
# This assumes that merge queue always adds a single merge commit (possibly itself
# including multiple merges for PRs) on the base branch.
# That git command outputs the hash of the second merge commit (the one before
# the topmost merge), which should be the base branch HEAD.
# (CI_BASE_COMMIT is used by `can_fast_ci_run.py` to only build changes.)
if test -z "${CI_BASE_COMMIT}" && is_bors_build ; then
if test -z "${CI_BASE_COMMIT}" && is_merge_queue_build; then
previous_merge="$(git log --merges --max-count 1 --skip 1 --pretty=format:%H)"
export CI_BASE_COMMIT="${previous_merge}"
fi
Expand All @@ -216,8 +224,8 @@ fi
# configurations.
if [ -z "${QUICK_BUILD}" ]; then
export QUICK_BUILD=0
if is_bors_build ; then
# always do full build for bors' branches
if is_merge_queue_build; then
# always do full build for merge queue' branches
true
elif [ ${FULL_BUILD} -eq 1 ]; then
# full build if building nightly or full build requested by label
Expand Down Expand Up @@ -323,14 +331,6 @@ error() {
exit 1
}

# true if "$2" starts with "$1", false otherwise
startswith() {
case "${2}" in
${1}*) true ;;
*) false ;;
esac
}

# if MURDOCK_HOOK is set, this function will execute it and pass on all it's
# parameters. should the hook script exit with negative exit code, hook() makes
# this script exit with error, too.
Expand Down

0 comments on commit c0dbc03

Please sign in to comment.