馃懛 Require a changelog entry when a package's lib changes - #2596
Open
dylanpulver wants to merge 2 commits into
Open
馃懛 Require a changelog entry when a package's lib changes#2596dylanpulver wants to merge 2 commits into
lib changes#2596dylanpulver wants to merge 2 commits into
Conversation
Closes cfug#1662 Co-Authored-By: Claude <noreply@anthropic.com>
AlexV525
reviewed
Sep 3, 2026
Comment on lines
+8
to
+10
| on: | ||
| pull_request: | ||
| types: [ opened, reopened, synchronize, labeled, unlabeled ] |
Member
There was a problem hiding this comment.
Would a path glob filter be more effective here?
A pull request that changes no package `lib/` can never need an entry, so filtering on paths keeps it from starting a job at all. Across the last 45 merged pull requests this skips 30 of them. `paths` is matched against the whole pull request rather than the newest push, so a pull request that touches `lib/` stays in scope while its changelog entry is added and the check re-runs to pass. Co-Authored-By: Claude <noreply@anthropic.com>
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.
Closes #1662
The only guard today is the manual checkbox from #1679, which that PR called a temporary solution. It misses things: of the last 200 commits on
main, 14 changed a package'slibwithout adding a line to that package'sCHANGELOG.md, including #2464 and #2534.This adds a
Check changelog entryworkflow andscripts/check_changelog_entry.sh. The script diffs the PR against its base, takes every changed path under<package>/lib/, and requires<package>/CHANGELOG.mdto have gained at least one line; a changelog edit that only removes lines does not count. The package root comes from the path rather than a hardcoded list, so a new package is covered the day it is created, and a package with noCHANGELOG.mdis exempt, which keepsdio_testand the example apps out of the way. Only paths underlib/trigger it, so tests, docs, workflows andpubspec.yamlnever do.The escape hatch is a
skip-changeloglabel rather than a magic string in the commit message, because only someone with write access can apply one, so the waiver stays a maintainer decision. The workflow listens tolabeled/unlabeled, so applying it re-runs the check without a new push. The label does not exist in this repo yet; its name lives only inSKIP_CHANGELOG_LABEL.Trigger is
pull_request, notpull_request_target, so a fork PR runs in the fork's context with a read-only token: no secret is read, the job requestscontents: readand nothing else, and nothing is posted back. Nopathsfilter, on purpose, so it always reports a result and can be made a required check without blocking docs-only PRs.I ran the script over the last 200 commits of
main, treating each as a PR, against an independently written Python implementation of the same rule. The two agreed on all 200: 186 pass, 14 fail. #2591 (changeddio/lib, added a changelog line) passes; #2464 (changeddio/lib/src/options.dart, added only tests) fails; #2534, which changed bothdio/libandplugins/web_adapter/libbut updated only the web adapter changelog, fails namingdioalone. I reproduced a GitHub merge ref locally withgit merge --no-ffand confirmed it fails on a missing entry, passes once added, passes with the label in the payload, and still fails when the changelog is touched but only loses a line. A label payload with shell metacharacters is parsed as JSON and stays inert.shellcheckclean;zizmor1.29.0 with the repo's config and--persona=pedanticreports nothing for the new workflow or for.githubas a whole.Unverified: the workflow has never executed on GitHub Actions. Only a real run exercises the event payload, the merge commit
actions/checkoutleaves atHEAD, the sparse checkout ofscripts, and the re-run on a label change; I emulated each locally. The first real evidence is this PR, which changes no packageliband should pass by finding nothing to require. I did not runmelos run testormelos run analyze, since no Dart source is touched.No
CHANGELOG.mdhere, since AGENTS.md scopes that to packages the change touches and this touches none, matching workflow-only PRs such as #2587.Claude (Opus) was used to design and implement this change and to run the local verification described above. I reviewed the result and own it.