Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow customization of commit messages & pull requests #153

Closed
2 tasks done
tusbar opened this issue Mar 16, 2016 · 5 comments · Fixed by #612
Closed
2 tasks done

Allow customization of commit messages & pull requests #153

tusbar opened this issue Mar 16, 2016 · 5 comments · Fixed by #612

Comments

@tusbar
Copy link

tusbar commented Mar 16, 2016

Hi,

It would be nice to have a way to customize a few things:

  • commit messages / pull requests names (through templating maybe)
  • pull requests labels (I use a dependency label for all that stuff)
@finnp
Copy link
Member

finnp commented Jul 14, 2016

Hey @tusbar,

your second request is actually already possible. Just add this to the package.json of your project and we will use your dependency label instead of greenkeeper:

"greenkeeper": {
   "label": "dependency"
}

We are probably also going to add support for commit message / pull request name customisation.

@danielnbarbosa
Copy link

any thoughts on whether this feature will be added? would be very helpful for us as we need to track all changes through pivotal tracker and customizing the commit message would allow us to automate this process instead of manually updating the merge message.

@finnp
Copy link
Member

finnp commented Aug 23, 2016

@danielnbarbosa Hey, it might still need some time, but I'm fairly sure we will be adding this feature. ☺️

@danielnbarbosa
Copy link

thanks @finnp. looking forward to it!

alrra added a commit to webhintio/hint that referenced this issue Jul 13, 2017
* Change `check-commit-message.js` script so that when it's executed
  as part of the tests it gets all the commits since the last release
  and validates their commit messages.

* Make `check-commit-message.js` script exclude commits made by
  `@greenkeeperio`, as their commit messages cannot currently be
  configured.

  See also: greenkeeperio/greenkeeper#153.

* Make other minor improvements to the `check-commit-message.js` script.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Fix: #375
alrra added a commit to webhintio/hint that referenced this issue Jul 13, 2017
* Change `check-commit-message.js` script so that when it's executed
  as part of the tests it gets all the commits since the last release
  and validates their commit messages.

* Make `check-commit-message.js` script exclude commits made by
  `@greenkeeperio`, as their commit messages cannot currently be
  configured.

  See also: greenkeeperio/greenkeeper#153.

* Make other minor improvements to the `check-commit-message.js` script.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Fix: #375
alrra added a commit to webhintio/hint that referenced this issue Jul 13, 2017
* Change `check-commit-message.js` script so that when it's executed
  as part of the tests it gets all the commits since the last release
  and validates their commit messages.

* Make `check-commit-message.js` script exclude commits made by
  `@greenkeeperio`, as their commit messages cannot currently be
  configured.

  See also: greenkeeperio/greenkeeper#153.

* Make other minor improvements to the `check-commit-message.js` script.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Fix: #375
@Arcanemagus
Copy link
Contributor

Arcanemagus commented Jan 20, 2018

I was looking into this and here's what I found. I'm sure I've probably missed a location where commit messages are created, but I wanted to get the conversation started here.

From what I found there are five locations where commit messages are created.

This is where a "pin" commit is created when a build has failed and GK is attempting to pin a previous version.

message: `${dependencyType === 'devDependencies' ? 'chore' : 'fix'}: pin ${dependency} to ${oldVersionResolved}`

Here is where the normal upgrade commits are created.

const commitMessageScope = !satisfies && type === 'dependencies'
? 'fix'
: 'chore'
let commitMessage = `${commitMessageScope}(package): update ${dependency} to version ${version}`
if (!satisfies && openPR) {
await upsert(repositories, openPR._id, {
comments: [...(openPR.comments || []), version]
})
commitMessage += `\n\nCloses #${openPR.number}`
}

As well as 3 potential commits within the initial branch creation.

message: 'chore(package): update dependencies',

message: 'chore(travis): whitelist greenkeeper branches',

message: 'docs(readme): add Greenkeeper badge',

In order to support commit message formats other than Angular, I'm currently thinking of something along these lines in package.json:

{
  "greenkeeper": {
    "commitMessages": {
      "initialBadge": "docs(readme): add Greenkeeper badge",
      "initialDependencies": "chore(package): update dependencies",
      "initialBranches": "chore(travis): whitelist greenkeeper branches",
      "dependencyUpdate": "fix(package): update ${dependency} to version ${version}",
      "devDependencyUpdate": "chore(package): update ${dependency} to version ${version}",
      "dependencyPin" : "fix: pin ${dependency} to ${oldVersionResolved}",
      "devDependencyPin": "chore: pin ${dependency} to ${oldVersionResolved}",
      "closes": "\n\nCloses #${number}"
  }
}

There are a couple of different ways this could be done, since the last 5 require some form of templating already it might be possible to combine the two dependency types together, but that might limit some commit message styles. The templating style also of course can be changed, right now it is a direct clone of the JS strings.

Am I missing some strings?
Is there a better way to accomplish this?

Arcanemagus added a commit to Arcanemagus/greenkeeper that referenced this issue Feb 7, 2018
Add configuration options allowing Greenkeeper's commit message format
to be customized as the user desires. These are handled exactly like
other configuration options, as a `commitMessages` key in
`package.json`. Some messages support data coming in, the format for
this follows JavaScript's template literals.

This will allow Greenkeeper to fit in with any custom commit message
format that a project requires, instead of forcing the
conventional-commit style.

Fixes greenkeeperio#153.
Arcanemagus added a commit to Arcanemagus/greenkeeper that referenced this issue Feb 7, 2018
Add configuration options allowing Greenkeeper's commit message format
to be customized as the user desires. These are handled exactly like
other configuration options, as a `commitMessages` key in
`package.json`. Some messages support data coming in, the format for
this follows JavaScript's template literals.

This will allow Greenkeeper to fit in with any custom commit message
format that a project requires, instead of forcing the
conventional-commit style.

Fixes greenkeeperio#153.
Arcanemagus added a commit to Arcanemagus/greenkeeper that referenced this issue Feb 7, 2018
Add configuration options allowing Greenkeeper's commit message format
to be customized as the user desires. These are handled exactly like
other configuration options, as a `commitMessages` key in
`package.json`. Some messages support data coming in, the format for
this follows JavaScript's template literals.

This will allow Greenkeeper to fit in with any custom commit message
format that a project requires, instead of forcing the
conventional-commit style.

Fixes greenkeeperio#153.
Realtin pushed a commit that referenced this issue Feb 9, 2018
Add configuration options allowing Greenkeeper's commit message format
to be customized as the user desires. These are handled exactly like
other configuration options, as a `commitMessages` key in
`package.json`. Some messages support data coming in, the format for
this follows JavaScript's template literals.

This will allow Greenkeeper to fit in with any custom commit message
format that a project requires, instead of forcing the
conventional-commit style.

Fixes #153.
ericcornelissen added a commit to dsseng/vue-simpleicons that referenced this issue Jul 13, 2019
...to "dependecies". As per (no official documentation as far as I know):
greenkeeperio/greenkeeper#153 (comment)

This brings it in line with the PRs generated by dependabot for security
fixes (e.g. #79). It is also just clearer in my opinion, especially for
people that don't know Greenkeeper.
dsseng pushed a commit to dsseng/vue-simpleicons that referenced this issue Aug 27, 2019
* chore(greenkeeper): update the label used by Greenkeeper

...to "dependecies". As per (no official documentation as far as I know):
greenkeeperio/greenkeeper#153 (comment)

This brings it in line with the PRs generated by dependabot for security
fixes (e.g. #79). It is also just clearer in my opinion, especially for
people that don't know Greenkeeper.

* chore(greenkeeper): update label used by Greenkeeper from package.json

Tested the previous solution on one of my own repo's and it didn't work.
Let's hope this does work...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants