Skip to content

Consolidate sections.yaml + areas.yaml into single changelogs/changelogs.yaml#4561

Closed
Copilot wants to merge 2 commits into
copilot/add-areas-yaml-validationfrom
copilot/consolidate-changelogs-yaml
Closed

Consolidate sections.yaml + areas.yaml into single changelogs/changelogs.yaml#4561
Copilot wants to merge 2 commits into
copilot/add-areas-yaml-validationfrom
copilot/consolidate-changelogs-yaml

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 18, 2026

Replaces the two separate changelogs/sections.yaml and changelogs/areas.yaml config files with a single changelogs/changelogs.yaml. Clean cutover — no fallback, no legacy file support, no deprecation path.

New file shape:

sections:
  bug_fixes:
    title: Bug Fixes
    description: |
      *Changes expected to improve the state of the world...*
areas:
  router:
    title: router
  tls:
    title: tls

envoy.base.utils

  • typing.py: adds ChangelogConfigDict (total=False, keys sections: ChangelogSectionsDict, areas: ChangelogAreasDict)
  • changelog.py:
    • CHANGELOG_SECTIONS_PATH + CHANGELOG_AREAS_PATHCHANGELOG_CONFIG_PATH = "changelogs/changelogs.yaml"
    • New config cached property loads the combined file; raises ChangelogError on ReaderError, logs warning and returns partial value on TypeCastingError
    • sections / areas become thin views: config["sections"] and cast(..., config.get("areas", {})) — missing areas section is silently empty, missing sections surfaces naturally as KeyError
    • sections_path / areas_path → single config_path
    • validate_sections error message updated to reference changelogs/changelogs.yaml

envoy.code.check

  • Import fallback updated: CHANGELOG_AREAS_PATHCHANGELOG_CONFIG_PATH
  • CHANGELOG_AREAS_FILECHANGELOG_CONFIG_FILE
  • Error messages in check_entry_filename and check_areas_file now cite changelogs/changelogs.yaml

Tests

  • Old sections / areas unit tests (which patched from_yaml directly) replaced with: one config property test covering all error paths + thin-view tests for sections and areas
  • sections_path / areas_path tests replaced by config_path
  • Integration fixture updated to write changelogs/changelogs.yaml with sections: top-level key
  • check_areas_file expected strings updated from changelogs/areas.yamlchangelogs/changelogs.yaml
Original prompt

Background

Stacked on PR #4560 (branch copilot/add-areas-yaml-validation), which adds validation for changelogs/areas.yaml.

We want to consolidate changelogs/sections.yaml and changelogs/areas.yaml into a single config file: changelogs/changelogs.yaml.

This is an in-tree managed config consumed only by toolshed + envoy. No external consumers. The plan PR (envoy#45093) introducing areas.yaml hasn't merged yet, and sections.yaml only lives in envoy. So we do a clean cutover — no back-compat, no fallback to legacy paths, no deprecation warnings, no migration period. After this PR lands, sections.yaml and areas.yaml are simply no longer read by toolshed.

Scope (this PR — stacked on copilot/add-areas-yaml-validation)

File format

New file changelogs/changelogs.yaml with two top-level keys, each a mapping of registry-key → entry-with-title (and optional description for sections):

sections:
  bug_fixes:
    title: Bug Fixes
    description: |
      *Changes expected to improve the state of the world and are unlikely to have negative effects.*
  new_features:
    title: New Features
  # ...

areas:
  router:
    title: router
  tls:
    title: tls
  # ...

Toolshed changes — py/envoy.base.utils/envoy/base/utils/abstract/project/changelog.py

  • Replace CHANGELOG_SECTIONS_PATH = "changelogs/sections.yaml" with CHANGELOG_CONFIG_PATH = "changelogs/changelogs.yaml".
  • Delete the CHANGELOG_AREAS_PATH constant added in PR Add areas.yaml validation to changelog checker (file integrity + entry prefix mapping) #4560 (since the base branch this PR stacks on adds it).
  • Add a config cached property on AChangelogs that reads changelogs/changelogs.yaml and returns a typed dict with sections and areas keys.
    • On ReaderError → raise ChangelogError (same as the existing sections property does).
    • On TypeCastingError → log a warning and return the partial value (same as existing sections behaviour).
  • Rewrite sections and areas cached properties to be thin views: return self.config["sections"] and return self.config.get("areas", {}) respectively. (Areas-section absent in config → empty dict is fine; sections must be present, otherwise validation downstream will fail naturally.)
  • Replace sections_path property with a config_path property pointing at the new file. Delete the areas_path property added in PR Add areas.yaml validation to changelog checker (file integrity + entry prefix mapping) #4560.
  • Error messages that referenced changelogs/sections.yaml or changelogs/areas.yaml (in validate_sections, and in the new area checks from Add areas.yaml validation to changelog checker (file integrity + entry prefix mapping) #4560) should now reference changelogs/changelogs.yaml.

Toolshed changes — py/envoy.base.utils/envoy/base/utils/typing.py

  • Add a ChangelogConfigDict typing entry (a TypedDict with sections: ChangelogSectionsDict and areas: ChangelogAreasDict keys; both can stay defined as they are).

Toolshed changes — py/envoy.code.check/envoy/code/check/abstract/changelog.py

Tests

  • Update all tests in py/envoy.base.utils/tests/test_abstract_project_changelogs.py and py/envoy.code.check/tests/test_abstract_changelog.py that reference sections.yaml, areas.yaml, CHANGELOG_SECTIONS_PATH, CHANGELOG_AREAS_PATH, sections_path, areas_path to use the new changelogs.yaml / CHANGELOG_CONFIG_PATH / config_path.
  • Update integration test fixtures (e.g. anything writing a sections.yaml to tmp_path like test_abstract_changelog_data_unknown_section) to write the consolidated changelogs.yaml instead.
  • Add tests for the new config cached property: missing file → ChangelogError (NOT silent — it's a required config now); valid file → parsed dict; unparseable → ChangelogError; type-cast warning path → returns partial value.
  • Test sections and areas are correctly extracted from config.

Out of scope (do NOT do in this PR)

  • Do NOT add fallback to legacy sections.yaml or areas.yaml.
  • Do NOT log deprecation warnings.
  • Do NOT add area validation to the parse path (get_data_from_entries).
  • Do NOT touch envoy repo. The envoy-side migration (creating changelogs/changelogs.yaml, deleting changelogs/sections.yaml, updating docs/BUILD genrule tools list, dropping areas.yaml from in-flight envoy#45093) is a coordinated follow-up that happens once this toolshed PR is published in a wheel.

Base branch

This PR is stacked on copilot/add-areas-yaml-validation (PR #4560). Base it on that branch. The diff this PR introduces sho...

This pull request was created from Copilot chat.

Copilot AI changed the title [WIP] Consolidate sections.yaml and areas.yaml into changelogs.yaml Consolidate sections.yaml + areas.yaml into single changelogs/changelogs.yaml May 18, 2026
Copilot finished work on behalf of phlax May 18, 2026 10:38
Copilot AI requested a review from phlax May 18, 2026 10:38
@phlax phlax closed this May 18, 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