Stop entries-layout changelog date IO on changelogs/current.yaml#4578
Draft
Copilot wants to merge 2 commits into
Draft
Stop entries-layout changelog date IO on changelogs/current.yaml#4578Copilot wants to merge 2 commits into
changelogs/current.yaml#4578Copilot wants to merge 2 commits into
Conversation
✅ Deploy Preview for nifty-bassi-e26446 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Agent-Logs-Url: https://github.com/envoyproxy/toolshed/sessions/6826fdbe-392c-433b-92f4-db254068f755 Co-authored-by: phlax <454682+phlax@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Migrate changelog layout to per-entry directory structure
Stop entries-layout changelog date IO on May 20, 2026
changelogs/current.yaml
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.
Envoy is moving to per-entry changelogs under
changelogs/current/<section>/<area>__<slug>.rst; in that mode,current.yamlshould no longer be read or written for in-flight changelog state. This change removes entries-layout dependence onchangelogs/current.yamldate persistence while keeping legacy single-yaml layout behavior intact.Entries-layout parsing now derives date in-memory
AChangelog.get_data_from_entriesno longer accepts/reads a yaml path.date: "Pending"for in-flight entries changelogs.Entries-layout pending state now follows project dev mode
AChangelogs.is_pendingnow returnsself.project.is_devwhen_entries_layoutis true.release_date == "Pending".No more
current.yamlwrites in entries-layout lifecyclewrite_current: only ensurescurrent_dir_pathexists.write_date: remains precondition-guarded, then no-ops in entries-layout.write_version: reads entries-only data, stampsdata["date"] = self.datestamp, writes frozen<version>.yaml, then resetschangelogs/current/directory.Commit path set corrected for entries-layout
changes_for_commitno longer addsCHANGELOG_CURRENT_PATHforrelease/devwhen_entries_layoutis true.CHANGELOG_CURRENT_DIR_PATHremains included for entries-layout.Test updates
get_data_from_entriessignature and semantics (date == "Pending").is_pending,write_current,write_date,write_version, andchanges_for_commit.changelogs/current.yaml: parse current changelog, derive pending from dev mode, no-opwrite_date, and freeze<old>.yamlwithdatestamp.Original prompt
Background
In
envoyproxy/envoywe're migrating the changelog layout from a singlechangelogs/current.yamlto a per-entry directory layout underchangelogs/current/<section>/<area>__<slug>.rst(context: envoyproxy/envoy#45093 and envoyproxy/envoy#45095).The medium-term goal is to remove
changelogs/current.yamlentirely. Today, the toolshed changelog code inpy/envoy.base.utils/envoy/base/utils/abstract/project/changelog.pyusescurrent.yamlfor two things:datefield (Pendingor a formatted date).There is a previous attempt at the date relocation in #4577 which introduced a new
changelogs/current/.datefile. That approach is being abandoned in favour of this PR. Do not build on or rebase against that PR. It should be closed after this lands.Insight motivating this PR
The on-disk
datefield doesn't need to exist as a persisted in-flight value at all:Pendingis just a synonym for "the project is in dev mode" — andVERSION.txtalready tells us that viaself.project.is_dev.changelogs/<version>.yamlduring thedev()lifecycle step. At that moment we can compute it (self.datestamp) and inject it into the dumped yaml.release()and the nextdev()there's no need to persist the date anywhere —release()already returns it in its result dict for logging/commit purposes.So we can drop the date persistence entirely in entries-layout mode. No
.datefile. Nocurrent.yamlwrites.current.yamlbecomes immediately removable on the envoy side after this lands.Goal
In entries-layout mode (
_entries_layouttrue), the toolshed code MUST NOT read or writechangelogs/current.yamlfor any purpose. The date is derived from project state at use time, never persisted in-flight, and stamped into the frozen<version>.yamlonly at freeze time.The legacy single-yaml layout (no
changelogs/current/directory) MUST be completely unaffected — same reads, writes, and commit set as today.Required changes
py/envoy.base.utils/envoy/base/utils/abstract/project/changelog.pyAChangelog.get_data_from_entriesCurrently reads
datefrom a yaml file atyaml_path. Change to:yaml_pathargument entirely (or default it toNoneand ignore it — pick whichever is cleanest given call sites).ChangelogDictis always"Pending". This is correct by construction: this method is only called for the in-flight changelog, and the in-flight changelog is by definition pending..rstfiles fromentry_diras today.Update the signature and adjust all call sites (notably
AChangelog.datainAChangelog).AChangelogs.is_pendingCurrently routes through
await self[self.current].release_date == "Pending". Replace with a direct check in entries-layout mode:AChangelogs.write_currentCurrently in entries-layout branch:
Change to:
No yaml write. Non-entries branch unchanged.
AChangelogs.write_dateCurrently in entries-layout branch:
Change to: in entries-layout mode, this is a no-op (the method body returns immediately). The date is not persisted in-flight; it will be stamped into the frozen file by
write_version.Important: keep the
is_pendingprecondition check at the top of the method. In entries-layout mode that check now consultsself.project.is_devvia the updatedis_pending. We still want it to error if called inappropriately. (In practicerelease()callswrite_datebeforewrite_version, while still in dev mode, sois_pendingis true. Good.)Non-entries branch unchanged.
AChangelogs.write_versionCurrently in entries-layout branch:
Change to: