Skip to content

feat(update): let an up-to-date system read its own release notes (v1.38.4) - #68

Merged
iscarelli merged 1 commit into
mainfrom
feat/update-notes-current-version
Jul 28, 2026
Merged

feat(update): let an up-to-date system read its own release notes (v1.38.4)#68
iscarelli merged 1 commit into
mainfrom
feat/update-notes-current-version

Conversation

@iscarelli

Copy link
Copy Markdown
Owner

Why

The release-notes block on /admin/update lived entirely inside the update_available branch. 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

  • New current_release_notes() in app.py: fetches the raw CHANGELOG.md at the installed version's own tag and reuses _slice_changelog to keep just that version's section. No duplicated parser, no duplicated renderer. Cached per installed version; fail-open ("" on any error), like its neighbours.
  • Helper _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.
  • The up-to-date branch of the template gained a "Ver novidades desta versão" collapse (new #currentNotes id, styled like the existing block), degrading to a plain link to the releases page when the notes cannot be fetched.
  • New string translated in _EN and _ES; the block header reuses the already-translated Novidades da v{v} key.

Verify

.\run-tests.ps1183 passed. New coverage: the function isolates only the installed version's section; fail-open returns "" without raising; /admin/update renders 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

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>
@iscarelli
iscarelli merged commit 4cf0378 into main Jul 28, 2026
4 checks passed
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