intuit / auto

Generate releases based on semantic version labels on pull requests.
https://intuit.github.io/auto/
MIT License
2.25k stars 203 forks source link

"pr-check" behavior differs from "version" when no labels defined #2443

Open larrywest opened 7 months ago

larrywest commented 7 months ago

All of our projects start off suffering from "No semver label!" failures in their PRs (and a GitHub "Detail" link that just points to the (Jenkins) build).

The "auto version" documentation, however, says:

If a PR does not have a label associated with it, it will default to patch or whatever you configure the default label to.

And that is the behavior I observe: without patch (or major or minor) being defined in the repo, auto version says:

Semantic versioning label for release is patch

The "auto pr-check" documentation says its function is to:

Check that a pull request has a SemVer label...

but doesn't warn that it doesn't follow the same logic as auto version.

Side effect of current behavior

We are unintentionally training developers to ignore "errors" from the "pr-check".

To reproduce

  1. New repo, no SemVer labels defined
  2. Make a PR
  3. Run auto version in the pipeline
  4. Run auto pr-check in the pipeline

Expected behavior

IMHO the auto version behavior is correct: auto pr-check should NOT consider it an error to lack a SemVer label.

After all, why cause breakage when the default of assuming patch is essentially zero risk, and demonstrates useful behavior of auto.

When users have worked long enough on a repo that they want to make a major or minor release, that's when they'll care.

An informative, non-error, message from auto pr-check would still be valuable, but should be something like:

Note: No SemVer label was found; default is "patch". See https://intuit.github.io/auto/docs

Postscript

For external readers, the relevant code section (for prCheck) is in core/src/auto.ts, but I don't know enough Typescript to propose a usable PR.