intuit / intuit/auto

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

Open
#2,443 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
2.5k
Forks
221
PR merge metrics
No merged PRs in 30d

Description

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](https://intuit.github.io/auto/docs/generated/version), 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](https://intuit.github.io/auto/docs/generated/pr-check) 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](https://github.com/larrywest/auto/blob/main/packages/core/src/auto.ts#L1037-L1066), but I don't know enough Typescript to propose a usable PR.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.