summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorEd Santiago <santiago@redhat.com>2022-07-11 12:54:16 -0600
committerMatthew Heon <matthew.heon@pm.me>2022-07-26 13:01:40 -0400
commitb2f3b28c6a4548e0982f2ead9cc4f3acc8f27f82 (patch)
tree5a5dddab1eb8cc64598a184438715e47e274ff12 /contrib
parentcfb768a36d91a68c0e8fbbdf2b6f2ee175485e88 (diff)
downloadpodman-b2f3b28c6a4548e0982f2ead9cc4f3acc8f27f82.tar.gz
podman-b2f3b28c6a4548e0982f2ead9cc4f3acc8f27f82.tar.bz2
podman-b2f3b28c6a4548e0982f2ead9cc4f3acc8f27f82.zip
logformatter: link by *task ID*, not build ID
Reason: task IDs are unique and permanent; linking by build ID and task name is non-unique, because Re-run. Fixes: #14863 Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/cirrus/logformatter20
1 files changed, 8 insertions, 12 deletions
diff --git a/contrib/cirrus/logformatter b/contrib/cirrus/logformatter
index 59969c3e7..1dc618768 100755
--- a/contrib/cirrus/logformatter
+++ b/contrib/cirrus/logformatter
@@ -560,18 +560,14 @@ END_HTML
# See #14569 for more info.
#
# [1] https://cirrus-ci.org/guide/writing-tasks/#latest-build-artifacts
- if ($have_formatted_log && $ENV{CIRRUS_BUILD_ID} && $ENV{CIRRUS_TASK_NAME}) {
- my $URL_BASE = "https://api.cirrus-ci.com";
- my $build_id = $ENV{CIRRUS_BUILD_ID};
- my $task_name = $ENV{CIRRUS_TASK_NAME};
-
- # Escape spaces in task names ("int fedora 35 podman root etc")
- $task_name =~ s/\s/%20/g;
-
- # URL is long and cumbersome and duplicaty. The task name cannot be
- # reduced; the file name could, but I choose to leave it because I
- # sometimes download HTML logs and oh how I hate "log.html" filenames.
- my $URL = "${URL_BASE}/v1/artifact/build/$build_id/$task_name/html/${outfile}";
+ if ($have_formatted_log && $ENV{CIRRUS_TASK_ID}) {
+ my $URL_BASE = "https://api.cirrus-ci.com";
+ my $task_id = $ENV{CIRRUS_TASK_ID};
+
+ # Link by *taskID*, not buildID + taskname. First, this is shorter
+ # and less duplicaty. Second, and more important, buildID + taskname
+ # is non-unique, and a link to a flake log will be clobbered.
+ my $URL = "${URL_BASE}/v1/artifact/task/$task_id/html/${outfile}";
print "\n\nAnnotated results:\n $URL\n";
}