Skip to content

render-release-notes: fix the release-notes cache check - #731

Open
PtJade-Ceramic wants to merge 1 commit into
git-for-windows:mainfrom
PtJade-Ceramic:render-release-notes-cache-fix
Open

render-release-notes: fix the release-notes cache check#731
PtJade-Ceramic wants to merge 1 commit into
git-for-windows:mainfrom
PtJade-Ceramic:render-release-notes-cache-fix

Conversation

@PtJade-Ceramic

Copy link
Copy Markdown

Fixes the broken release-notes cache check in render-release-notes.sh.

Problem

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.

Change

Replace the stale mtime check with a content fingerprint: hash
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.

Also ignore the .release-notes.stamp state 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 deleting ReleaseNotes.html all
trigger a re-render.

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`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant