Auto: Plugin: Apply PR labels based on semantic-release style commit messages

Created on 19 Jan 2019  ·  14Comments  ·  Source: intuit/auto

Moved from https://github.com/intuit/auto-release/issues/176

@aleclarson said:

Here's a plugin I need right away:

It scans the commit messages of a PR for semantic-release style prefixes (eg: fix:, feat:, BREAKING) and automatically applies the appropriate patch/minor/major label to the PR.
Inspired by this Twitter thread.

Would you consider this as an officially supported plugin?

@hipstersmoothie said:

Yeah that sounds like a good plugin! I'm okay with it being official. All though we might need to add an extra hook or two for this behavior

A hook with the name parseCommit could enable this here

https://github.com/intuit/auto-release/blob/5220097f4ce075f4097d62492cd08b6e9551fca2/src/log-parse.ts#L141

@aleclarson said:

We could use parse-commit-message to extract metadata from commits (though its dependency on esm makes it a little heavy, but that will be removed once NodeJS supports ES modules natively). In the meantime, we could fork it and remove the esm dependency if it bothers us enough. Even if we don't fork, it's still ~6x smaller than what semantic-release uses.

enhancement

Most helpful comment

@aleclarson why the size I so much of a problem? Even in node land, our package managers are already smart enough to dedupe.

I never mentioned duplicate dependencies as a concern. I'm just wary of bloated tools in general. "The lighter the better" is my rule of thumb, but to each his own. I'm not really interested in debating this. :)

Btw, to join the party. git-commits-since and detect-next-version might be more helpful here?

I'd prefer using parse-commit-message since those packages seem to duplicate logic that already exists in auto-release, but maybe @hipstersmoothie would be up for replacing the existing logic with those packages to reduce burden of maintenance.

All 14 comments

That's pretty weird how it depends on ESM

It should probably be using esm for the build and not in production

its kinda like using babel-register instead of just building it and publishing the dist folder

I thought the same at first, but a look at the source code says otherwise.

edit: Oh nvm, you're saying esm can be used to compile before publishing. We should send a PR.

It looks like a good module otherwise. Nice and lean

Looks like esm isn't made for compilation: https://github.com/standard-things/esm/issues/13#issuecomment-321710199

I say we fork for now, and convert the import and export syntax to CommonJS.

hmm yeah i was just reading the readme. Looks like i misunderstood

I'll make a pr to switch to https://github.com/developit/microbundle and maybe he will add it.

You should consider using https://github.com/egoist/bili instead. It has half the install size, but it may have other tradeoffs. Not sure.

Btw, to join the party. git-commits-since and detect-next-version might be more helpful here?

I'm using esm because of guarantees and because it's behind the Node's esm feature flag. I easliy could used ascjs or similar like rewrite-imports, but esm supports a lot more than just the import/exports. And because I didn't won't _any_ build step or anything, for testing I just use it as a hook to my runner.

Which brings us to that, we can switch to ascjs or asbundle.

@aleclarson why the size I so much of a problem? Even in node land, our package managers are already smart enough to dedupe.

@aleclarson why the size I so much of a problem? Even in node land, our package managers are already smart enough to dedupe.

I never mentioned duplicate dependencies as a concern. I'm just wary of bloated tools in general. "The lighter the better" is my rule of thumb, but to each his own. I'm not really interested in debating this. :)

Btw, to join the party. git-commits-since and detect-next-version might be more helpful here?

I'd prefer using parse-commit-message since those packages seem to duplicate logic that already exists in auto-release, but maybe @hipstersmoothie would be up for replacing the existing logic with those packages to reduce burden of maintenance.


:rocket: Issue was released in 10.0.0 :rocket:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

reintroducing picture reintroducing  ·  15Comments

aleclarson picture aleclarson  ·  14Comments

hipstersmoothie picture hipstersmoothie  ·  13Comments

hipstersmoothie picture hipstersmoothie  ·  11Comments

brunobertoldi picture brunobertoldi  ·  8Comments