From 3922f589ab98b50295674d01287ed7fc693bbb47 Mon Sep 17 00:00:00 2001 From: Maxim Kuvyrkov Date: Tue, 20 Jul 2021 17:56:41 +0000 Subject: round-robin scripts: Merge _url and _branch into _git Merge git "_url" and "_branch" specification into a single "_git" argument that's constructed from "URL#BRANCH". This argument also has a special value "baseline", which before was a special value of "branch". This rework makes handling of git references simpler and cleaner, especially on the jenkins side. Change-Id: I1c1c07629728c693b8350dfa1b61fe767d5b0a0b --- round-robin-bisect.sh | 51 +++++++++++++++++++++++++-------------------------- round-robin.sh | 26 +++++++++----------------- tcwg_bmk-build.sh | 5 +---- tcwg_gnu-build.sh | 5 +---- tcwg_kernel-build.sh | 5 +---- 5 files changed, 37 insertions(+), 55 deletions(-) diff --git a/round-robin-bisect.sh b/round-robin-bisect.sh index 2328da64..8ded4ea6 100755 --- a/round-robin-bisect.sh +++ b/round-robin-bisect.sh @@ -17,8 +17,8 @@ fresh_dir $artifacts "$artifacts/manifests/*" "$artifacts/jenkins/*" convert_args_to_variables "$@" shift "$SHIFT_CONVERTED_ARGS" -obligatory_variables bad_url bad_branch build_script current_project -declare bad_url bad_branch build_script current_project +obligatory_variables bad_git build_script current_project +declare bad_git build_script current_project BUILD_URL="${BUILD_URL:-$(pwd)}" replay_log="${replay_log-}" @@ -42,6 +42,9 @@ touch $artifacts/jenkins/build-name trap print_traceback EXIT +bad_url="${bad_git%#*}" +bad_branch="${bad_git#*#}" + rebase_workaround=false rebase_workaround_opts=() @@ -51,7 +54,7 @@ case "${rr[ci_project]}/${rr[ci_config]}:$current_project" in # Search for regressions against linux-mainline:master (aka linux-next:stable). clone_or_update_repo $current_project stable $bad_url # Just in case linux-next:stable has advanced between the build and bisect jobs, - # use merge base between linux-next:stable and $bad_branch. + # use merge base between linux-next:stable and $bad_git. bad_rev="${bad_rev-$(git_rev_parse_long $current_project $bad_branch)}" linux_next_stable="${linux_next_stable-$(git -C $current_project merge-base HEAD $bad_rev)}" cat < $artifacts/trigger-build-rebase < $artifacts/trigger-build-rebase <> $artifacts/trigger-build-rebase < $artifacts/trigger-build-reset < $artifacts/trigger-build-reset < $artifacts/trigger-bisect < $artifacts/trigger-build-1-advance <> $artifacts/jenkins/mail-body.txt < diff --git a/round-robin.sh b/round-robin.sh index a0e7d21d..feeafae3 100644 --- a/round-robin.sh +++ b/round-robin.sh @@ -6,19 +6,13 @@ # Round-Robin associative array. declare -gA rr -# Pretty name for PROJECT's version -#rr[PROJECT_version] - -# PROJECT's git url -#rr[PROJECT_url] - -# PROJECT's git branch or SHA1 revision parsable by git rev-parse. +# PROJECT's git url#branch or url#SHA1 revision parsable by git rev-parse. # A special value "baseline" means that PROJECT is not being updated # in this build, and its baseline branch should be used. # In a successful build "update_baseline" step will update baseline # branches of all PROJECTs to the current values, thus setting # a baseline for the next build. -#rr[PROJECT_branch] +#rr[PROJECT_git] # PROJECT's git SHA1 revision. These are mostly used in manifests. #rr[PROJECT_rev] @@ -72,7 +66,7 @@ print_updated_components () local delim="" local c for c in ${rr[components]}; do - if [ x"${rr[${c}_branch]}" != x"baseline" ]; then + if [ x"${rr[${c}_git]}" != x"baseline" ]; then echo -ne "$delim$c" delim=${1- } fi @@ -156,10 +150,10 @@ clone_repo () local url branch - if [ x"${rr[${project}_branch]}" != x"baseline" ]; then + if [ x"${rr[${project}_git]}" != x"baseline" ]; then # Fetch and checkout from the specified repo. - url="${rr[${project}_url]}" - branch="${rr[${project}_branch]}" + url="${rr[${project}_git]%#*}" + branch="${rr[${project}_git]#*#}" else # Fetch and checkout from baseline repo. url=$(print_baseline_repo "$project" true) @@ -633,10 +627,9 @@ No reason to rebase base-artifacts." for c in ${rr[components]}; do if echo "${update_components[@]}" | tr ' ' '\n' | grep -q "^$c\$"; then - echo "${c}_url=${rr[${c}_url]}" - echo "${c}_branch=${rr[${c}_branch]}" + echo "${c}_git=${rr[${c}_git]}" else - echo "${c}_branch=baseline" + echo "${c}_git=baseline" fi done > $trigger_dest/trigger-build-$update_components2 done < <(${rr[breakup_updated_components]}) @@ -647,8 +640,7 @@ No reason to rebase base-artifacts." cat > $trigger_dest/trigger-bisect <> $trigger_dest/trigger-bisect diff --git a/tcwg_bmk-build.sh b/tcwg_bmk-build.sh index b58e3fc2..87263a59 100755 --- a/tcwg_bmk-build.sh +++ b/tcwg_bmk-build.sh @@ -128,10 +128,7 @@ esac # Use baseline branches by default. for c in ${rr[components]}; do - rr[${c}_branch]=${rr[${c}_branch]-baseline} - if [ x"${rr[${c}_branch]}" != x"baseline" ]; then - obligatory_variables rr[${c}_url] - fi + rr[${c}_git]=${rr[${c}_git]-baseline} done start_at="${start_at-default}" diff --git a/tcwg_gnu-build.sh b/tcwg_gnu-build.sh index 88106d0a..421f06e5 100755 --- a/tcwg_gnu-build.sh +++ b/tcwg_gnu-build.sh @@ -64,10 +64,7 @@ fi # Use baseline branches by default. for c in ${rr[components]}; do - rr[${c}_branch]=${rr[${c}_branch]-baseline} - if [ x"${rr[${c}_branch]}" != x"baseline" ]; then - obligatory_variables rr[${c}_url] - fi + rr[${c}_git]=${rr[${c}_git]-baseline} done start_at="${start_at-default}" diff --git a/tcwg_kernel-build.sh b/tcwg_kernel-build.sh index 2d5fc933..bb923767 100755 --- a/tcwg_kernel-build.sh +++ b/tcwg_kernel-build.sh @@ -51,10 +51,7 @@ esac # Use baseline branches by default. for c in ${rr[components]}; do - rr[${c}_branch]=${rr[${c}_branch]-baseline} - if [ x"${rr[${c}_branch]}" != x"baseline" ]; then - obligatory_variables rr[${c}_url] - fi + rr[${c}_git]=${rr[${c}_git]-baseline} done start_at="${start_at-default}" -- cgit v1.2.3