Skip to content

Add doNotThank option to @changeset/changelog-github#460

Closed
beeequeue wants to merge 1 commit into
changesets:masterfrom
beeequeue:patch-1
Closed

Add doNotThank option to @changeset/changelog-github#460
beeequeue wants to merge 1 commit into
changesets:masterfrom
beeequeue:patch-1

Conversation

@beeequeue

Copy link
Copy Markdown
Member

Takes a boolean (to disable thanking) or an array of names (to exclude them from being thanked).

Useful for if thanking people in the changelog is not necessary, e.g. thanking the main developer/maintainer over and over again, or in a private repo for work.

{
  "changelog": [
    "@changesets/changelog-github",
    {
      "repo": "org/repo",
      "doNotThank": true // Will not thank anyone
    }
  ],
}
{
  "changelog": [
    "@changesets/changelog-github",
    {
      "repo": "org/repo",
      "doNotThank": ["BeeeQueue"] // Will not thank BeeeQueue, but will thank anyone else (😢)
    }
  ],
}

Was written directly on GitHub so might have style problems and has not been tested yet

  • Test locally

@atlassian-cla-bot

atlassian-cla-bot Bot commented Sep 22, 2020

Copy link
Copy Markdown

Hooray! All contributors have signed the CLA.

@changeset-bot

changeset-bot Bot commented Sep 22, 2020

Copy link
Copy Markdown

💥 No Changeset

Latest commit: 99353b3

Merging this PR will not cause any packages to be released. If these changes should not cause updates to packages in this repo, this is fine 🙂

If these changes should be published to npm, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Andarist Andarist left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if we'd like to proceed with this one, what are the benefits? What problems are caused by thanking all people? 🤔

});
return `\n\n- ${links.commit}${
links.pull === null ? "" : ` ${links.pull}`
links.pull == null ? "" : ` ${links.pull}`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO would be better to keep strong comparisons here - ===

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using strong comparisons on null is actually less safe, since using a weak one will catch both null and undefined, which you most often want to do.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand the difference - can undefined be even received here though?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know, but it's good practice to always use the weak one since it catches more potential branches with no downsides, so I did it here. 🤷

}

const shouldThank = (user: string) => {
// Handle an array of names to not thank

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

those comments here don't seem super useful - the code is rather simple and handles its job quite literally, so this seems repetitive for me

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added them since there is no documentation for the option yet, so if someone goes into the code they will see it quickly without having to read the code.

Speaking of documentation, where should that be added?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's first discuss the merit of this option - don't want you to put too much work into this one if we decide not to proceed with this one in the end (I'm not saying that we won't, yet).

@beeequeue

beeequeue commented Sep 22, 2020

Copy link
Copy Markdown
Member Author

The main issues I see occurring is for example if you're the sole developer on a project. It's very nice to get links to the PRs and commits in the changelog, but seeing Thanks @BeeeQueue! on all changes on every version gets a bit old... This is why having the exclusion array is nice since it can automatically thank any contributors, but skip yourself.

The other situation I've encountered is at work, where we don't really need to be thanking all the people working on the project, so it feels out of place

@Andarist

Copy link
Copy Markdown
Member

Isn't usually more information considered to be better than a lack of information? Those really seem quite harmless to me, even if a little bit excessive at times. You could rely on those to ask authors question regarding certain changes, rather than looking through git blame etc.

@beeequeue

beeequeue commented Sep 22, 2020

Copy link
Copy Markdown
Member Author

If you like it or use it you can just not disable it, it's an option and not forced on you. 😄

For example I realised that it's good that the PR authors get pinged on the release PR so they know it exists, so we're probably gonna keep it at work - but I still don't want it to endlessly thank myself on any personal projects I might use changelog-github for

@Andarist Andarist requested review from Noviny and emmatown September 22, 2020 17:04
@Noviny

Noviny commented Sep 23, 2020

Copy link
Copy Markdown
Contributor

@beeequeue Thanks for the PR! I'd probably actually recommend making your own functions, rather than using one of our defaults. Our goal was to make writing new generation functions easy and letting the community build lots to suit their needs, rather than having 1 or 2 canon ones that have a bunch of configuration options.

I thoroughly acknowledge that writing new changelog generators is not where we want it to be at the moment though.

I'd be more interested in this as its own package than as an option for the existing one.

@beeequeue

beeequeue commented Sep 23, 2020

Copy link
Copy Markdown
Member Author

It feels very overkill to copy-paste a whole generator, etc. just to add an option, but if that's what you prefer I'll do that instead. 😕

@Andarist

Copy link
Copy Markdown
Member

You probably could reuse our implementation and just strip away what u want with by manipulating the returned string.

We have to balance lean API and community demands, lean API doesnt only mean fewer options but also, more importantly, it means a reduced complexity of our implementation. If we add everything that is being asked for we’d end up with unmanageable code. If this issue arise again in the future we might reconsider stance on this particular option but for now i think it’s not needed as it has only been requested by you, so we cant really classify it as a popular demand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants