chore(CI): keep the previous Lean declarations diff visible while a new build runs#40486
chore(CI): keep the previous Lean declarations diff visible while a new build runs#40486adomani wants to merge 2 commits into
Conversation
…ew build runs The pre-build `PR_summary.yml` rewrites the whole `### PR summary` comment on every push, which reset the Lean-aware declarations-diff region to the `(Lean -- pending)` placeholder and discarded the diff that the post-build `decls-diff.yml` had spliced in. Instead of hard-coding the placeholder, `PR_summary.yml` now asks `updateDeclsDiffSection.py` (`MODE=emit`) to carry an existing real diff forward, relabelled `(Lean -- stale, waiting for the new build)`, so it stays visible until the new build lands; on the first run (or no prior diff) it prints the pending placeholder, and a `|| printf` fallback keeps the step safe. `decls-diff.yml` gains a `NEW_HEADING` env var so a cache miss after a good diff keeps that diff under a `(Lean -- cache miss, showing previous diff)` heading rather than blanking it to `(Lean -- unavailable)`. Requires the companion mathlib-ci change (MODE=emit / carry-forward); the pinned `get-mathlib-ci` ref must point at a commit that contains it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
PR summary 0d9bc04b2aImport changes for modified filesNo significant changes to the import graph Import changes for all files
|
ReferenceInformation-oriented. What changed, no rationale. Files
Heading states: The post-build success path is unchanged. |
ExplanationUnderstanding-oriented. Why, not how. The PR-summary comment holds a Lean-aware declarations-diff region that only the post-build workflow can fill — it needs the build's Rather than recompute (impossible pre-build), the pre-build step now reuses what is already on the comment: if a real diff is present it is carried forward verbatim with only its heading relabelled stale. So the content a reader sees is always the last truly-computed diff, never a blank — only a newer successful build replaces it. The fallback exists because the carry-forward reads the live comment via |
How-to: merge this safelyProblem-oriented. The steps to land it without breaking the summary comment. mathlib4 CI runs the script at the pinned
If this merges while the pinned ref still points at the old script, |
|
Which of the two |
|
The intent is that as soon as one Lean-aware diff has been shown, there will always be one visible in the message. What changes is the header.
Does this answer your question? |
Almost, but the code does not contain the string If the answer is that the former will be shown, then:
|
|
I spoke too quickly! Here are the actual options:
Having said that, if you think that using |
|
I think we should avoid the term "cache-miss" entirely but I might be misunderstanding what it means here. |
|
The name originally came from the fact that not every commit to master comes with a cache: (as far as I understand) when bors merges a batch, it creates a commit for each PR in the batch, but only runs CI on the combination of the commits. The "intermediate" commits do not have a cache. When I was writing the first version of the script, I was worried of a situation where the merge-base was a "cache-less" commit and hence referred to the situation as "cache miss". However, it turns out that, unless you explicitly try to aim for a cache-less commit, the merge-base is a cache-full commit! At that point, the concern became that the artifact containing the names of the declarations on master was present. By continuity, this case kept the name of "cache miss", even though, at this point, maybe "missing master declaration data" would have been more appropriate. So, if you prefer to use a different name for this situation, then I am happy to take suggestions! |
|
How about "please merge master"? |
…sage Replace the jargon `(Lean -- cache miss, showing previous diff)` with `(Lean -- stale; merge master and push to refresh)`: it keeps the "this diff is stale" cue and folds in the actionable remedy, which previously only appeared in the step summary when a prior diff was carried forward. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Ok, let's go with |
|
✌️ adomani can now approve this pull request until 2026-06-25 01:49 UTC (in 2 weeks). To approve and merge, reply with
|
|
⏳ @adomani, your delegation on this PR expires in less than a week (approximately 6 days, 23 hours, at 2026-06-25 01:49 UTC). |
|
⏳ @adomani, your delegation on this PR expires in less than 24 hours (approximately 23 hours, 59 minutes, at 2026-06-25 01:49 UTC). |
|
⌛ Delegation for @adomani on this PR has expired (at 2026-06-25 01:49 UTC). Reply with |
Keep the previous Lean declarations diff visible (relabelled stale) while a new build runs, instead of resetting the PR-summary comment to pending on every push.
Companion: leanprover-community/mathlib-ci#56 · details in the Reference / Explanation / How-to comments below.