Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/check-script-cache-drift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
# (tools/ci/check_cache_drift.py). On drift the job fails, uploads the
# evidence, saves the cold cache over the stale one, and the report job opens
# or updates the `cache-drift` issue.
#
# Pull requests do not run this workflow (too slow, and drift depends on the
# cache's history). tools/tests/test_check_cache_drift.py in
# verify-scripts.yml unit-tests the driver instead, with the generator, the
# audit and git mocked: which generator exits count as a result, the diffs,
# affected libraries and evidence, status.json, the GITHUB_OUTPUT flags and
# the issue body. Not covered there: real generator runs, the driver's
# --out handling, and this file's step conditions, artifacts and report job;
# those still need a workflow_dispatch run to check.
name: Check Script Cache Drift

env:
Expand Down
7 changes: 6 additions & 1 deletion tools/ci/check_cache_drift.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,12 @@ def summarize(src, run_url):
continue
lines = report.read_text(encoding="utf-8").splitlines()
if len(lines) > ISSUE_DIFF_LINES:
lines = lines[:ISSUE_DIFF_LINES] + ["```", "(truncated)"]
lines = lines[:ISSUE_DIFF_LINES]
# Close the ```diff block only when the cut falls inside one:
# an unpaired fence would turn the rest of the issue into code.
if sum(l.startswith("```") for l in lines) % 2:
lines.append("```")
lines.append("(truncated)")
block = ["", "<details><summary>{}: diff excerpt</summary>".format(
s["os"]), ""] + lines + ["", "</details>"]
text = "\n".join(block)
Expand Down
7 changes: 5 additions & 2 deletions tools/gen_exports.py
Original file line number Diff line number Diff line change
Expand Up @@ -2083,8 +2083,11 @@ def main() -> int:
for line in problems:
print("facade: " + line)
if problems:
print("error: {} facade problem(s)".format(len(problems)),
file=sys.stderr)
# stdout, not stderr: tools/ci/check_cache_drift.py reads this as
# the last line of the merged output to tell a facade-only failure
# from a crash. Piped stdout is block-buffered and flushed at exit,
# so on stderr this line would come out before the facade: lines.
print("error: {} facade problem(s)".format(len(problems)))
return 1
return rc

Expand Down
Loading
Loading