Skip to content

fix(ci): reject deleted package changelogs - #3946

Merged
Yeachan-Heo merged 1 commit into
devfrom
fix/changelog-history-guard-deletion
Aug 6, 2026
Merged

fix(ci): reject deleted package changelogs#3946
Yeachan-Heo merged 1 commit into
devfrom
fix/changelog-history-guard-deletion

Conversation

@Yeachan-Heo

@Yeachan-Heo Yeachan-Heo commented Aug 6, 2026

Copy link
Copy Markdown
Owner

What

Makes the released CHANGELOG history guard fail closed when a package CHANGELOG existed at the base but is deleted at the PR head. Files absent at the base remain exempt.

Why

#3941 catches emptied CHANGELOGs but its headText === undefined exemption allows complete deletion to bypass the same append-only history contract.

Verification

  • bun test scripts/changelog-history-guard.test.ts (12 pass)

Follow-up to #3941 and #3942.

The released-heading guard caught emptied files but treated a deleted head file as exempt. A deleted package changelog loses the same released history and must fail through the existing violation contract.

Tested: bun test scripts/changelog-history-guard.test.ts
@Yeachan-Heo
Yeachan-Heo force-pushed the fix/changelog-history-guard-deletion branch from 1600040 to 96a1e80 Compare August 6, 2026 12:16

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1600040c7d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +75 to +77
if (headText === undefined) {
if (before.length === 0) return undefined;
return { file, removed: before, baseHeadingCount: before.length, headHeadingCount: 0 };

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Disable rename detection while enumerating changelogs

When a package changelog is moved and edited but remains similar enough for Git to classify it as a rename, this deletion branch is never reached. In the dev-ci.yml guard, Git 2.43 reports such a change as R072 packages/a/CHANGELOG.md packages/b/CHANGELOG.md, while the current git diff --name-only returns only the destination; collectViolations then finds no file at that destination in the base and exempts it, allowing removed released headings to pass CI. Enumerate with --no-renames or process both sides of rename records so the source deletion is checked.

AGENTS.md reference: AGENTS.md:L178-L178

Useful? React with 👍 / 👎.

@Yeachan-Heo
Yeachan-Heo merged commit 3765d84 into dev Aug 6, 2026
25 checks passed
@Yeachan-Heo
Yeachan-Heo deleted the fix/changelog-history-guard-deletion branch August 6, 2026 12:30
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.

1 participant