Use changelogs/current/ as entries-layout current sentinel (without dropping current.yaml parsing)#4570
Draft
Copilot wants to merge 4 commits into
Draft
Use changelogs/current/ as entries-layout current sentinel (without dropping current.yaml parsing)#4570Copilot wants to merge 4 commits into
changelogs/current/ as entries-layout current sentinel (without dropping current.yaml parsing)#4570Copilot wants to merge 4 commits into
Conversation
Agent-Logs-Url: https://github.com/envoyproxy/toolshed/sessions/77330e05-f689-47e3-92fc-89612b89f5e5 Co-authored-by: phlax <454682+phlax@users.noreply.github.com>
Agent-Logs-Url: https://github.com/envoyproxy/toolshed/sessions/77330e05-f689-47e3-92fc-89612b89f5e5 Co-authored-by: phlax <454682+phlax@users.noreply.github.com>
Agent-Logs-Url: https://github.com/envoyproxy/toolshed/sessions/77330e05-f689-47e3-92fc-89612b89f5e5 Co-authored-by: phlax <454682+phlax@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update changelog sentinel to use directory layout
Use May 19, 2026
changelogs/current/ as entries-layout current sentinel (without dropping current.yaml parsing)
✅ Deploy Preview for nifty-bassi-e26446 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for nifty-bassi-e26446 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for nifty-bassi-e26446 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for nifty-bassi-e26446 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
In entries-layout repos, changelog discovery still depended on
changelogs/current.yamlto identify the in-flight version. This change switches current-version discovery tochangelogs/current/while intentionally preservingcurrent.yamlas the current changelog parse path (for date handling in the follow-up PR).AChangelogscurrent discovery (entries-layout only)pathsnow usescurrent_dir_pathinstead of appendingcurrent_pathwhen_entries_layoutis true.changelog_pathsnow derives current directly fromproject.version.base_versionand maps it tocurrent_dir_path, while still loading historical versions fromchangelogs/*.*.*.yaml.Preserve current changelog parse path
current.yaml.AChangelogstill receivescurrent_path(changelogs/current.yaml) as its_path, so existingget_data_from_entries(..., yaml_path=...)behavior remains intact.envoy.code.checkmessaging updatecurrent.yamlis the sole current representation.changelogs/<version>.yamlcoexisting withchangelogs/current/for the in-flight changelog.Test updates
pathsandchangelog_pathsbehavior.Original prompt
Background
In
envoyproxy/envoywe are migrating the changelog layout from a singlechangelogs/current.yamlto a per-entry directory layout underchangelogs/current/<section>/<area>__<slug>.rst(see envoyproxy/envoy#45093 and envoyproxy/envoy#45095).The medium-term goal is to remove
changelogs/current.yamlentirely. Right now the toolshed changelog code inpy/envoy.base.utils/envoy/base/utils/abstract/project/changelog.pystill depends oncurrent.yamlin two distinct ways:paths, and_version_from_pathspecial-casespath.stem == "current"to mean "use the project version".date(Pending/May 19, 2026).This PR addresses (1) only. The
daterelocation is a follow-up PR.Goal
Make
changelogs/current/(the directory) the sole sentinel for the in-flight version in entries-layout mode, so the yaml file is no longer required to identify which version is "current". The yaml file may still be read fordate— that's PR 2's problem.Scope (entries-layout only)
All behavioral changes below MUST be gated on
_entries_layoutbeing true. Repos still on the single-yaml layout (nochangelogs/current/directory) MUST be completely unaffected.Required changes
py/envoy.base.utils/envoy/base/utils/abstract/project/changelog.pyIn
AChangelogs:paths(currently appendsself.current_pathunconditionally): when_entries_layoutis true, do NOT appendself.current_path. The current version's "path" should be represented byself.current_dir_pathinstead. Non-entries layout: unchanged.changelog_paths/_version_from_path: in entries-layout mode, derive the current version directly fromself.project.version.base_versionrather than parsing it frompath.stem == "current". One way:changelog_pathsas{historical versions from *.*.*.yaml glob} ∪ {current_version: current_dir_path}when_entries_layout.path.stem == "current"keeps working there._version_from_pathcan keep its current behavior; the entries-layout branch just doesn't need it for the current entry.AChangelog.path(used byget_data/get_data_from_entries): for the current changelog in entries-layout mode,pathshould still point atcurrent.yamlfor now (so date reading inget_data_from_entrieskeeps working until PR 2). Only the discovery of "which version is current" stops depending on the yaml file's existence. Concretely:_pathpassed to the currentChangeloginstance in entries mode should remaincurrent_path(the yaml), even though it was discovered via the directory. This keeps PR 1 a pure refactor of discovery.py/envoy.code.check/envoy/code/check/abstract/changelog.pyThe
check_versionerror message currently reads:Update wording so it does not assume
current.yamlis the sole representation. Suggested:The underlying
duplicate_currentdetection logic does not need to change — it just compares the changelog's version against the project version. Only the user-facing string needs updating.Tests
Update / add tests as needed. Key spots:
py/envoy.base.utils/tests/test_abstract_project_changelogs.pypathsincludescurrent_pathunconditionally needs an entries-layout variant where it instead includescurrent_dir_path.changelog_paths/_version_from_pathshould cover the entries-layout branch.py/envoy.code.check/tests/test_abstract_changelog.pytest_changelogstatus_check_versionasserts the exact error string — update to match the new wording.Add at least one new test exercising the entries-layout discovery path so it doesn't regress.
Non-goals (explicitly out of scope)
dateout ofcurrent.yaml.get_data_from_entriesshould keep readingdatefromyaml_pathfor now.write_current/write_date/write_version/is_pending/changes_for_commitbehavior. They still touchcurrent.yaml. PR 2 will address those.CHANGELOG_CURRENT_PATH,current_path, orrel_current_path. Still in use.CHANGELOG_URL_TPL— historical synced changelogs continue to live atcurrent.yamlon tagged refs.changelogs/current/directory.Acceptance criteria
changelogs/current.yamlfrom an envoy checkout that has achangelogs/current/directory still allows toolshed to:This pull request was created from Copilot chat.