diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2021-04-09 19:03:54 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2021-04-09 19:06:58 +0000 |
commit | 4b3f91861b3647b62436e07447fff0a46cf797c6 (patch) | |
tree | 951c06ab8c3aa1ba3d5a9e12cc2b08f8b672b58f /tcwg-report-stale-rr-jobs.sh | |
parent | 68c1980e0ec6a57484a21b2767f7723d934464cf (diff) |
tcwg-report-stale-rr-jobs.sh: Add tracking of all toolchain/ci repos
... not just base-artifacts.git. Tracking all repos will notify us
when we need to switch to newer release branches, or when failure
happens only for a particular component of a round-robin job.
Change-Id: Id3a2f3f8f08134b8b0549ca090465f0ddf54d132
Diffstat (limited to 'tcwg-report-stale-rr-jobs.sh')
-rwxr-xr-x | tcwg-report-stale-rr-jobs.sh | 61 |
1 files changed, 39 insertions, 22 deletions
diff --git a/tcwg-report-stale-rr-jobs.sh b/tcwg-report-stale-rr-jobs.sh index 64ec246e..2e440d0b 100755 --- a/tcwg-report-stale-rr-jobs.sh +++ b/tcwg-report-stale-rr-jobs.sh @@ -11,32 +11,49 @@ convert_args_to_variables "$@" days="${days-10}" human="${human-true}" refs_prefix="${refs_prefix-refs/heads/linaro-local/ci/}" -refs_url="${refs_url-https://git.linaro.org/toolchain/ci/base-artifacts}" +refs_url_prefix="${refs_url-https://git.linaro.org/toolchain/ci}" +repos=("${repos[@]-default}") verbose="${verbose-false}" if $verbose; then set -x fi -# Initialize base-artifacts repo (by cloning its "empty" branch). -refs_repo=$(basename "$refs_url" .git) -clone_or_update_repo_no_checkout "$refs_repo" "$refs_url" none empty origin \ - >/dev/null 2>&1 -git -C "$refs_repo" reset --hard >/dev/null 2>&1 - -# Walk through all commits of all tcwg_bmk* branches and mark results -# referenced in those results with "used_by" file. -while IFS= read -r ref; do - git -C "$refs_repo" fetch -q origin "$ref" - commit_stamp=$(git -C "$refs_repo" show --no-patch --pretty=%ct FETCH_HEAD) - days_ago=$((($(date +%s) - $commit_stamp) / (24 * 3600))) - if [ $days_ago -gt $days ]; then - if $human; then - job=$(echo "${ref#$refs_prefix}" | sed -e "s#/#-build-#") - job="https://ci.linaro.org/job/$job" - echo "$job : last updated $days_ago days ago" - else - echo "$ref" +if [ x"${repos[*]}" = x"default" ]; then + repos=(base-artifacts binutils-gdb gcc glibc linux llvm-project newlib qemu) +fi + +process_git_url () +{ + ( + set -euf -o pipefail + local refs_url="$1" + + # Initialize base-artifacts repo (by cloning its "empty" branch). + refs_repo=$(basename "$refs_url" .git) + clone_or_update_repo_no_checkout "$refs_repo" "$refs_url" auto empty origin \ + >/dev/null 2>&1 + git -C "$refs_repo" reset --hard >/dev/null 2>&1 + + # Walk through all commits of all tcwg_bmk* branches and mark results + # referenced in those results with "used_by" file. + while IFS= read -r ref; do + git -C "$refs_repo" fetch -q origin "$ref" >/dev/null 2>&1 + commit_stamp=$(git -C "$refs_repo" show --no-patch --pretty=%ct FETCH_HEAD) + days_ago=$((($(date +%s) - $commit_stamp) / (24 * 3600))) + if [ $days_ago -gt $days ]; then + if $human; then + echo "${ref#$refs_prefix}: $refs_repo: last updated $days_ago days ago" + else + echo "$refs_repo:$ref" + fi fi - fi -done < <(git ls-remote "$refs_url" "${refs_prefix}*" | awk '{ print $2 }') + done < <(git ls-remote "$refs_url" "${refs_prefix}*" | awk '{ print $2 }') + ) +} + +for repo in "${repos[@]}"; do + process_git_url "$refs_url_prefix/$repo" & +done | sort + +wait |