render-release-notes: fix the release-notes cache check - #731
Open
PtJade-Ceramic wants to merge 1 commit into
Open
render-release-notes: fix the release-notes cache check#731PtJade-Ceramic wants to merge 1 commit into
render-release-notes: fix the release-notes cache check#731PtJade-Ceramic wants to merge 1 commit into
Conversation
The incremental cache check in `render-release-notes.sh` referenced a `Release.html` file that is never produced (the script writes `ReleaseNotes.html`), so the cache never hit and the release notes were always re-rendered. Worse, the check compared mtimes, which are unreliable in clean CI checkouts and could have skipped rendering. Replace the stale mtime check with a content fingerprint: hash the source `ReleaseNotes.md`, the rendering script itself, and the generated `ReleaseNotes.html`, and store the fingerprint in a `.release-notes.stamp` file next to the output. Rendering is skipped only when the fingerprint is unchanged and the output exists; a missing or clobbered `ReleaseNotes.html` is regenerated. The `--copy-css` and `--preview` behavior is unchanged. Ignore the `.release-notes.stamp` state file in `.gitignore`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the broken release-notes cache check in
render-release-notes.sh.Problem
The incremental cache check in
render-release-notes.shreferenced aRelease.htmlfile that is never produced (the script writesReleaseNotes.html), so the cache never hit and the release notes werealways re-rendered. Worse, the check compared mtimes, which are
unreliable in clean CI checkouts and could have skipped rendering.
Change
Replace the stale mtime check with a content fingerprint: hash
ReleaseNotes.md, the rendering script itself, and the generatedReleaseNotes.html, and store the fingerprint in a.release-notes.stampfile next to the output. Rendering is skipped only when the fingerprint
is unchanged and the output exists; a missing or clobbered
ReleaseNotes.htmlis regenerated. The--copy-cssand--previewbehavior is unchanged.
Also ignore the
.release-notes.stampstate file in.gitignore.Validation
Verified end-to-end in the Git for Windows SDK: first render generates
the HTML plus stamp; unchanged input is cached (skip); editing
ReleaseNotes.md, clobbering, or deletingReleaseNotes.htmlalltrigger a re-render.