-
-
Notifications
You must be signed in to change notification settings - Fork 4
Add a way to verify that each changelog entry has an associated PR #150
Description
Currently, auto-changelog treats the PR reference at the end of a changelog entry as optional. That means that although we usually see changelog entries such as:
- Upgrade `@metamask/foo` from `^1.0.0` to `^1.1.0` ([#123](https://github.com/MetaMask/foo/pull/123))
the following entry would also be valid:
- Upgrade `@metamask/foo` from `^1.0.0` to `^1.1.0`
This was likely done intentionally so as not to break existing changelogs for older libraries that were created before adopting Keep a Changelog. However, most changelogs for frequently maintained repos probably use this spec by now.
With that said, we are moving to a new process where we ask contributors to the core monorepo to update changelogs as they are making new changes. To do this, we need to ensure that changelog entries include PR numbers. This requirement introduces a bit of a chicken-and-egg situation where a PR number cannot be added if no PR has been created yet. Therefore, we could ask contributors to push their branch without PR references, then go back and update their changelogs once they've created the PR.
To enforce this workflow, we need to add a verification step to auto-changelog which ensures that all entries in a changelog have PR links or fails. We could also make this opt-in by adding a new option to the validate method so that existing projects that use auto-changelog validate during their lint step do not fail (we can add that option when we like). This would allow us to run this validation step in core, thereby forcing the developer to add PR links to changelogs before they can merge their PR.
References
This blocks MetaMask/core#4385.
Acceptance Criteria
- It is possible to run
auto-changelog validatepassing an option that enables verifying the presence of PR links in changelogs. - This command passes if all of the entries in the changelog have PR links associated with them, and fails if any entry does not.