Skip to content

Commit 59dc77a

Browse files
committed
ci: Simplify untar path list output
Currently the benchmark CI jobs prints multiple pages of paths from the extracted archive, since `tar` is run with `v`. This is a lot of output that is usually just noise in CI. Switch to printing the paths from python instead, limiting to a depth of three segments (and deduplicating). Removing it completely was an option, but it's still nice to have a hint about what gets updated.
1 parent c120564 commit 59dc77a

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

ci/ci-util.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ def locate_baseline(flags: list[str]) -> None:
390390

391391
artifact_glob = f"{ARTIFACT_PREFIX}{f"-{tag}" if tag else ""}*"
392392

393+
# Skip checking because this will fail if the file already exists, which is fine.
393394
sp.run(
394395
["gh", "run", "download", str(job_id), f"--pattern={artifact_glob}"],
395396
check=False,
@@ -409,7 +410,17 @@ def locate_baseline(flags: list[str]) -> None:
409410
candidate_baselines.sort(reverse=True)
410411
baseline_archive = candidate_baselines[0]
411412
eprint(f"extracting {baseline_archive}")
412-
sp.run(["tar", "xJvf", baseline_archive], check=True)
413+
414+
all_paths = sp.check_output(["tar", "tJf", baseline_archive], encoding="utf8")
415+
sp.run(["tar", "xJf", baseline_archive], check=True)
416+
417+
# Print a short summary of paths, we don't use `tar v` since the list is huge
418+
short_paths = re.findall(r"^(?:[^/\n]+/?){1,3}", all_paths, re.MULTILINE)
419+
420+
print("Extracted:")
421+
for path in sorted(set(short_paths)):
422+
print(f"* {path}")
423+
413424
eprint("baseline extracted successfully")
414425

415426

0 commit comments

Comments
 (0)