semversioner icon indicating copy to clipboard operation
semversioner copied to clipboard

`semversioner check` should assert that the current branch contains a change document

Open darthtrevino opened this issue 9 months ago • 1 comments

Currently semversioner check asserts that a change document has been created. And initially it works great for that, but imagine this flow:

In PR 1, Cyril makes low-impact changes. semversioner check catches that he needs a change document. Cyril uses semversioner add-change -t patch -d ...

In PR2, Pat makes a higher-impact change. They forget to commit a change document, but semversioner check will pass, because a change document exists from Cyril's PR.

Ideally, semversioner check would cause Pat's PR to fail as well because their changes have semver impact that should be documented independently.

darthtrevino avatar May 02 '24 20:05 darthtrevino

Here's how the Yarn Version Plugin is doing this:

Determining Git Changes: https://github.com/yarnpkg/berry/blob/578d8961358503ec04705d15f89284664fe1be61/packages/plugin-git/sources/gitUtils.ts#L313

Determine Version File for Branch: https://github.com/yarnpkg/berry/blob/578d8961358503ec04705d15f89284664fe1be61/packages/plugin-version/sources/versionUtils.ts#L165

Version Check Command: https://github.com/yarnpkg/berry/blob/578d8961358503ec04705d15f89284664fe1be61/packages/plugin-version/sources/commands/version/check.tsx#L351

darthtrevino avatar May 03 '24 16:05 darthtrevino