zeke / semantic-pull-requests

:robot: Let the robots take care of the semantic versioning
https://github.com/apps/semantic-pull-requests
Apache License 2.0
1.24k stars 122 forks source link

feature: commitOnly #31

Closed stefanbuck closed 5 years ago

stefanbuck commented 5 years ago

Would you accept a Pull Request which adds a commitOnly option similar to titleOnly?

zeke commented 5 years ago

Hi @stefanbuck 👋

Sure, but would that mean "any commit" or "all commits"?

stefanbuck commented 5 years ago

Mhhh ... in my opinion it should be "all commits" to keep it simple.

zeke commented 5 years ago

That sounds fine to me. Let's just make sure to use a name that is clear.

cilindrox commented 5 years ago

was just about to propose the same, this or here is causing some sneaky messages to appear upstream :P

zeke commented 5 years ago

some sneaky messages

@cilindrox can you clarify what you mean by this. Wanna make sure I understand you.

cilindrox commented 5 years ago

@stefanbuck eg - someone creates a pr with the following commit list:

chore: update role
build: bump dockerfile
Merge remote-tracking branch 'upstream/master'
build: update tag

That should fail with a pending status, but instead, it passes due to the [].some() filter.

zeke commented 5 years ago

☝️ That actually shouldn't fail. The default behavior of the bot is not to police all commits, but to ensure the PR has just enough semantic information to be able to trigger a new release if needed.

It seems this is a common misconception. I will update the README to make this more clear.

zeke commented 5 years ago

Opened https://github.com/probot/semantic-pull-requests/pull/32

cilindrox commented 5 years ago

Thanks for clarifying, appreciate it @zeke Guess I'll need to deploy a fork then

zeke commented 5 years ago

@cilindrox I wouldn't want anyone to have to maintain a fork. If you want to support another behavior, let's talk about it and see if we can enable it with configuration.

cilindrox commented 5 years ago

@zeke glad to hear :)

I'm thinking about adding a strict setting, which could work by auditing either some or every commit message.

eg:

// semantic.yaml
strict: "allCommits" || "anyCommits"

Invalid syntax, but guess it conveys the point. That should take care of this original issue's premise and tackle a strict mode (sorry for hijacking it btw)

Thoughts?

nathanielc commented 5 years ago

I would similarly support a commitsOnly: true option. I want to validate all commits and do not care about the PR title, this is because we primarily use the Rebase+Merge method in github.

I don't have an opinion on the name of the configuration option so long as it is clear.

zeke commented 5 years ago

Okay. Let's do commitsOnly. When enabled, the bot will ignore the PR title and require all commits to be semantic.

zeke commented 5 years ago

Anyone want to take a shot at implementing this?

stefanbuck commented 5 years ago

I'm close to raise a Pull Request soon