Skip to content

Relocate entries-layout changelog date to changelogs/current/.date with current.yaml read fallback#4577

Closed
Copilot wants to merge 2 commits into
mainfrom
copilot/remove-current-yaml-release-date
Closed

Relocate entries-layout changelog date to changelogs/current/.date with current.yaml read fallback#4577
Copilot wants to merge 2 commits into
mainfrom
copilot/remove-current-yaml-release-date

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 20, 2026

This updates entries-layout changelog state so release date no longer depends on changelogs/current.yaml. In entries mode, date is now read/written from changelogs/current/.date, while keeping a compatibility read fallback to current.yaml when .date is absent.

  • New on-disk date source for entries layout

    • Added CHANGELOG_CURRENT_DATE_PATH = "changelogs/current/.date".
    • Added rel_current_date_path and current_date_path helpers on AChangelogs.
  • Entries-layout parse behavior

    • Updated AChangelog.get_data_from_entries(...) to:
      1. read date from .date when present,
      2. fall back to current.yaml date when .date is missing,
      3. raise ChangelogParseError when neither source exists.
  • Entries-layout write paths no longer touch current.yaml

    • write_current() now creates changelogs/current/ and writes Pending\n to .date.
    • write_date() now writes the formatted date to .date.
    • write_version() now freezes current data, recreates changelogs/current/, and resets .date to Pending\n (without writing current.yaml).
  • Commit change-set updates

    • changes_for_commit() now adds CHANGELOG_CURRENT_DATE_PATH (instead of CHANGELOG_CURRENT_PATH) for release/dev when _entries_layout is true.
    • Legacy single-yaml layout behavior is unchanged.
  • Test coverage updates

    • Updated existing AChangelogs tests for write_current, write_date, write_version, and changes_for_commit in entries mode.
    • Added get_data_from_entries tests for:
      • .date-first reads,
      • yaml fallback reads,
      • parse error when both date sources are missing.
    • Added an end-to-end-style entries-layout test covering .date-only repos (no current.yaml) across is_pending, write_date, and write_version.
if current_date_path.exists():
    date = current_date_path.read_text().strip()
elif yaml_path.exists():
    yaml_data = utils.from_yaml(yaml_path, typing.ChangelogSourceDict)
    date = yaml_data["date"]
else:
    raise exceptions.ChangelogParseError(
        f"Failed to parse changelog entries: neither {current_date_path} nor {yaml_path} exists")
Original prompt

Background

This is the second PR in a sequence to remove changelogs/current.yaml from envoyproxy/envoy and from the toolshed tooling that drives the changelog lifecycle.

  • PR 1 (separate, in flight): decouples discovery of the "current version" from current.yaml, making changelogs/current/ (the directory) the sentinel.
  • This PR (PR 2): relocates the release date (Pending / May 19, 2026) out of current.yaml so the yaml file has no remaining functional role in entries-layout mode.
  • PR 3 (later): drop the compatibility shim and any now-dead current.yaml references.

Context envoy PR: envoyproxy/envoy#45093
Context envoy issue: envoyproxy/envoy#45095

Goal

In entries-layout mode, store the release date in a small dedicated file inside changelogs/current/ instead of in changelogs/current.yaml. After this PR, an envoy checkout with only the changelogs/current/ directory (no current.yaml) MUST be fully usable end-to-end: parse, check date, write date on release, freeze on dev, etc.

For a transition window, support reading the date from changelogs/current.yaml if the new date file is missing (compatibility shim — to be removed in PR 3).

New on-disk format

  • Add CHANGELOG_CURRENT_DATE_PATH = "changelogs/current/.date".
  • File contents: a single line, either Pending or a formatted date string (same format as today — DATE_FORMAT = "%B %-d, %Y"). No yaml, no key prefix — just the value, optional trailing newline.
  • This file lives inside the entries directory so it travels with the rest of the per-entry files and shares their merge-conflict-resistance properties.

Scope (entries-layout only)

All behavioral changes MUST be gated on _entries_layout being true. The legacy single-yaml layout (no changelogs/current/ directory) MUST be completely unaffected — same reads, same writes, same commit set.

Required changes

py/envoy.base.utils/envoy/base/utils/abstract/project/changelog.py

Add the constant:

CHANGELOG_CURRENT_DATE_PATH = "changelogs/current/.date"

In AChangelogs, add helpers:

  • rel_current_date_path -> pathlib.Path(CHANGELOG_CURRENT_DATE_PATH)
  • current_date_path -> self.project.path.joinpath(self.rel_current_date_path)

Update the following methods. In every case, if _entries_layout is false, behavior is unchanged.

AChangelog.get_data_from_entries

Currently reads date from the yaml file at yaml_path. Change to:

  1. If current_date_path exists, read date from it (strip whitespace).
  2. Otherwise, fall back to the existing yaml read (compatibility shim).
  3. If neither exists, raise ChangelogParseError with a clear message.

The function's signature can stay the same (yaml_path, entry_dir); just consult the sibling date file first. Alternatively, refactor to take an AChangelogs reference — pick whichever is cleaner; the abstract method on AChangelogs already has both pieces of state available.

AChangelogs.write_current

In entries-layout branch, replace:

self.current_path.write_text("date: Pending\n")
self.current_dir_path.mkdir(parents=True, exist_ok=True)

with:

self.current_dir_path.mkdir(parents=True, exist_ok=True)
self.current_date_path.write_text("Pending\n")

Do NOT write to current_path anymore in entries mode.

AChangelogs.write_date

In entries-layout branch, replace:

self.current_path.write_text(f"date: {date}\n")

with:

self.current_date_path.write_text(f"{date}\n")

AChangelogs.write_version

In entries-layout branch, the current sequence is:

data = self.changelog_class.get_data_from_entries(
    self.current_path, self.current_dir_path)
version_file.write_text(self.dump_yaml(data))
self.current_path.write_text("date: Pending\n")
shutil.rmtree(self.current_dir_path)
self.current_dir_path.mkdir()

Change to:

data = self.changelog_class.get_data_from_entries(
    self.current_path, self.current_dir_path)  # may still read yaml as fallback
version_file.write_text(self.dump_yaml(data))
shutil.rmtree(self.current_dir_path)
self.current_dir_path.mkdir()
self.current_date_path.write_text("Pending\n")

Do NOT touch current_path in entries mode.

AChangelogs.is_pending

Currently:

return (
    await self[self.current].release_date
    == "Pending")

That goes through AChangelog.data -> get_data_from_entries, so once get_data_from_entries reads the new file, is_pending works automatically. No change needed unless you want to short-circuit by reading current_date_path directly (optional optimization — fine to leave).

AChangelogs.changes_for_commit

Currently adds CHANGELOG_CURRENT_PATH to the commit set on release/dev. In entries-layout mode, swap to the new date file:

if any(k in change for k in ["release", "dev"]):
    if self._entries_layout:
        changed.ad...

</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

*This pull request was created from Copilot chat.*
>

@netlify
Copy link
Copy Markdown

netlify Bot commented May 20, 2026

Deploy Preview for nifty-bassi-e26446 ready!

Name Link
🔨 Latest commit 03139cf
🔍 Latest deploy log https://app.netlify.com/projects/nifty-bassi-e26446/deploys/6a0da8cefe2c260008c9e574
😎 Deploy Preview https://deploy-preview-4577--nifty-bassi-e26446.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI changed the title [WIP] Remove release date from current.yaml in changelog Relocate entries-layout changelog date to changelogs/current/.date with current.yaml read fallback May 20, 2026
Copilot finished work on behalf of phlax May 20, 2026 12:30
Copilot AI requested a review from phlax May 20, 2026 12:30
@phlax phlax closed this May 20, 2026
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.

2 participants