Skip to content

Re-enable current changelog entry-file validation by fixing entry_dir resolution - #5225

Draft
phlax with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-entry-dir-for-changelog
Draft

Re-enable current changelog entry-file validation by fixing entry_dir resolution#5225
phlax with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-entry-dir-for-changelog

Conversation

Copilot AI commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

AChangelogStatus.entry_dir resolved current entries to changelogs/<version> (derived from <version>.yaml), so check_entry_files exited early and never ran filename/content validation for current changelogs. This change points entry discovery at changelogs/current and turns a missing current entries directory into an explicit error instead of a silent no-op.

  • Entry directory resolution (current changelog)

    • AChangelogStatus.entry_dir now returns self.project.changelogs.current_dir_path when is_current, else None.
    • Removed dependence on changelog_path(version).with_suffix("").
  • Missing-directory behavior

    • check_entry_files now distinguishes:
      • entry_dir is None (non-current): return ()
      • current entry_dir missing: return "{version}: Missing changelog entries directory ({entry_dir})"
      • current entry_dir exists but no */*.rst entries: return ()
  • Test updates

    • Updated test_changelogstatus_entry_dir to assert current_dir_path is used and changelog_path/with_suffix/version are not used in current mode.
    • Extended test_changelogstatus_check_entry_files to cover missing-directory error and empty-directory no-op.
    • Added tmp-path end-to-end coverage that builds a minimal changelog layout and verifies an unknown area in current/<section>/<area>__<slug>.rst surfaces via AChangelogStatus.errors as Invalid area.
@property
def entry_dir(self) -> pathlib.Path | None:
    if not self.is_current:
        return None
    return self.project.changelogs.current_dir_path

async def check_entry_files(self) -> tuple[str, ...]:
    entry_dir = self.entry_dir
    if entry_dir is None:
        return ()
    if not entry_dir.exists():
        return (f"{self.version}: Missing changelog entries directory ({entry_dir})", )

This re-enables validation that had been silently skipped; downstream consumers (notably Envoy) may surface pre-existing Invalid area / filename errors once this version is adopted.

@netlify

netlify Bot commented Sep 11, 2026

Copy link
Copy Markdown

Deploy Preview for nifty-bassi-e26446 ready!

Name Link
🔨 Latest commit 46da6c6
🔍 Latest deploy log https://app.netlify.com/projects/nifty-bassi-e26446/deploys/6aa3da2d4d322f00087bb9b5
😎 Deploy Preview https://deploy-preview-5225--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.

Co-authored-by: phlax <454682+phlax@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix entry directory computation for current changelog Re-enable current changelog entry-file validation by fixing entry_dir resolution Sep 11, 2026
Copilot AI requested a review from phlax September 11, 2026 10:40
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