lerna-changelog icon indicating copy to clipboard operation
lerna-changelog copied to clipboard

flag unlabeled PRs with wildcard label

Open NathanPJF opened this issue 5 years ago • 4 comments

Fixes https://github.com/lerna/lerna-changelog/issues/74

👋 Hi there, I'm working on a project with a distributed team and we were looking for a way to generate changelogs/releases easier. The challenge we ran up against is essentially the problem identified in https://github.com/lerna/lerna-changelog/issues/74.

To address this, I made a change to identify any commits that didn't have a label from the config with a "wildcard label" (name taken from the linked issue). I have details on how it works in the README.md. I wanted to share my approach to see if it is something you feel is useful before I go forward with writing test and whatnot 😃

Result

Example from my testing:

  "changelog": {
    "labels": {
      "breaking change": "💥 Breaking Change",
      "enhancement": "🚀 Enhancement",
      "bug fix": "🐛 Bug fixes",
      "unlabeled": "🤔 Unlabeled"
    },
    "wildcardLabel": "unlabeled",
    "cacheDir": ".changelog"
  }
## Unreleased (2019-05-04)

#### 🚀 Enhancement
* [#838](https://github.com/foo/bar/pull/838) Update search results layout ([@NathanPJF](https://github.com/nathanpjf))

#### 🤔 Unlabeled
* [#903](https://github.com/foo/bar/pull/903) Unhide mute button ([@somePerson](https://github.com/somePerson))
* [#923](https://github.com/foo/bar/pull/923) Convert hardcoded values ([@somePerson](https://github.com/somePerson))

Approach

I have details on my thought process in my fork, but essentially I felt the following was a good workflow:

  1. wildcardLabel is optional and by default it has no value.
  2. When there is a value, a default changelog heading is provided. Figured a default heading was fine as the tool already provides a number of defaults.
  3. If you want a custom heading, you need to write the same label in the configuration labels along with a heading.

^ At first writing it in labels felt like duplication of effort. However, I realized the value for wildcardLabel could match a real label being used on GitHub to act as a safeguard for workflows where people are identifying PRs that need labeling. e.g. You have a typical workflow to label things on GitHub with unlabeled or for triage until you know whether the change is going to be a breaking one. Incase that PR never gets "properly labeled" before merging, you'd want a warning in place before you make that next release.

NathanPJF avatar Jun 28 '19 03:06 NathanPJF

This seems neat to me, would definitely be useful in some projects I work in.

rwjblue avatar Sep 24 '19 00:09 rwjblue

This is awesome! Exactly what I was missing.

Exelord avatar Dec 16 '19 20:12 Exelord

I love this PR ❤️

shrkw avatar Mar 24 '21 11:03 shrkw

Hey 👋 has there been any movement on this PR? I'm particularly interested in it because I'm working on something that makes use of these changes and I would love an official release 🙏

mansona avatar Nov 27 '23 21:11 mansona