feat(update): let an up-to-date system read its own release notes (v1.38.4) - #68
Merged
Merged
Conversation
The update page only rendered release notes while an update was pending, so anyone already on the latest version saw just "Sistema atualizado" with no way to re-read what changed — not even a link to GitHub. The up-to-date state now offers "Ver novidades desta versão", collapsing open the installed version's own CHANGELOG section (fetched from the raw CHANGELOG at its own tag, reusing the existing slicer and renderer, cached per version). It falls back to a plain link to the releases page when the notes cannot be fetched, so the way out to GitHub always exists. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Why
The release-notes block on
/admin/updatelived entirely inside theupdate_availablebranch. Someone already on the latest version saw only "Sistema atualizado" — no notes, and not even the GitHub link that the update-available state offers. That is exactly what made it impossible to inspect the cumulative history right after production reached the latest version.What changed
current_release_notes()inapp.py: fetches the rawCHANGELOG.mdat the installed version's own tag and reuses_slice_changelogto keep just that version's section. No duplicated parser, no duplicated renderer. Cached per installed version; fail-open (""on any error), like its neighbours._version_just_below()derives the strict lower bound the slicer needs to isolate a single section (borrow-safe, never negative).admin_update()now computes the cumulative notes only when an update is actually available, and the installed version's notes only when it is not — so neither state pays for a fetch it does not use.#currentNotesid, styled like the existing block), degrading to a plain link to the releases page when the notes cannot be fetched._ENand_ES; the block header reuses the already-translatedNovidades da v{v}key.Verify
.\run-tests.ps1→ 183 passed. New coverage: the function isolates only the installed version's section; fail-open returns""without raising;/admin/updaterenders those notes in the up-to-date state; and falls back to the GitHub link (200, no traceback) when the fetch fails.🤖 Generated with Claude Code