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

Please allow us to modify the commit message format #406

Closed
greysteil opened this issue Apr 27, 2018 · 14 comments
Closed

Please allow us to modify the commit message format #406

greysteil opened this issue Apr 27, 2018 · 14 comments

Comments

@greysteil
Copy link
Contributor

From @StephanBijzitter on February 1, 2018 9:58

After this pull request: #244

Our commitlint started to fail, since we do have it set up to expect chore(dependencies): . It's nice that you cater to the Angular project, but this is a breaking change for us. Now we can modify the commit message when squash merging, but that still leaves every pull request with a red cross.

To take a piece of code from the pull request, we would expect the message to be: "chore(dependencies): bump business from 1.4.0 to 1.5.0" (notice the b in bump, not B)

So, please allow us to configure this message to our liking. I'd open up a pull request myself, but I have no experience with Ruby. If you agree this is a wanted feature, but you don't have time for it, I'd love to give it a shot though!

input: build: Bump commander from 2.12.2 to 2.13.0
   subject must not be sentence-case, start-case, pascal-case, upper-case [subject-case]
   found 1 problems, 0 warnings

Copied from original issue: dependabot/feedback#82

@greysteil
Copy link
Contributor Author

From @StephanBijzitter on February 1, 2018 11:20

I think the following config to package.json would be good:

  "dependabot": {
    "conventional": {
      "type": "chore",
      "scope": "dependencies",
      "case": "lower-case"
    }
  }

This way the config can differ on a per-branch basis, which makes sure that changes to commit(lint) settings and the config will be kept in sync.

@greysteil
Copy link
Contributor Author

Totally agree this is a wanted feature. I’m on holiday with limited time for the next two weeks, but would love a PR.

I think the right approach here would be to edit this file to detect if “chore(dep...” was previously being used, and use that instead of build if so.

@greysteil
Copy link
Contributor Author

(Adding a config file would need a lot more work, and I’m not convinced it’s a better approach.)

@greysteil
Copy link
Contributor Author

From @deivid-rodriguez on February 4, 2018 16:13

I know this would be definitely more work but projects use lots of different commit message conventions, it'd be nice if dependabot played nice with everyone via configuration.

Ideally I'd like to be able to tell dependabot specifically the template for the commit message I want, like:

Bump %{library} from %{original_version} to %{final_version}.

@greysteil
Copy link
Contributor Author

From @StephanBijzitter on February 5, 2018 0:13

A template would also suit our needs. Haven't had time to look much into this yet, running into a bit of a deadline myself... :-)

@greysteil
Copy link
Contributor Author

Just coming back to this.

@deivid-rodriguez - I've updated the logic in Dependabot core so it won't get confused about whether or not you're using semantic commit prefixes anymore (commit here). That should mean that you get the commit message you want (which looks like it's the format Dependabot was already using). Are you all good?

@StephanBijzitter - I've updated Dependabot's commit messages the follow the correct sentence case structure (commit here). How important is using chore(dependencies) to you, rather than build? I can add some logic to do that if you feel strongly about it :-)

I'm going to hold off on adding config files (we can's just use the package.json because we need to support multiple languages) or a setting for this for now.

@greysteil
Copy link
Contributor Author

From @StephanBijzitter on February 16, 2018 10:55

It's not important, build will pass our linter just fine. It's just the semantics of the word that's a bit iffy for me.

@greysteil
Copy link
Contributor Author

From @deivid-rodriguez on February 16, 2018 10:57

@greysteil That's great. If dependabot is smart enough to figure out the style I use, that's of course good enough! 👍. Thanks so much.

@greysteil
Copy link
Contributor Author

Cool, thanks guys. In that case I'm going to close this for now, but I'm happy to revisit later.

@StephanBijzitter - I know what you mean about the semantics, but build is what Angular are using themselves, so think it's the one to go for. (AngularJS is still using chore, but I'm going to put in a PR to see whether that's deliberate.)

@gabemeola
Copy link

From @deivid-rodriguez on February 4, 2018 16:13

I know this would be definitely more work but projects use lots of different commit message conventions, it'd be nice if dependabot played nice with everyone via configuration.

Ideally I'd like to be able to tell dependabot specifically the template for the commit message I want, like:

Bump %{library} from %{original_version} to %{final_version}.

From @deivid-rodriguez on February 4, 2018 16:13

I know this would be definitely more work but projects use lots of different commit message conventions, it'd be nice if dependabot played nice with everyone via configuration.

Ideally I'd like to be able to tell dependabot specifically the template for the commit message I want, like:

Bump %{library} from %{original_version} to %{final_version}.

@greysteil Are there any plans to support custom commit messages in the future?

My specific use case is including [ci skip] in the commit message.
https://gitlab.com/help/ci/yaml/README#skipping-jobs

@greysteil
Copy link
Contributor Author

It's come up quite a few times, so we almost certainly will in future. It's not imminent, though - won't be before the end of the month.

@greysteil
Copy link
Contributor Author

With dependabot-script you might be able to hack it and overwrite the branch namer...

@gabemeola
Copy link

gabemeola commented May 8, 2019

@greysteil Thanks for the quick response!

Pardon my ruby inexperience, should I be able to pass pr_message_footer to pull_request_creator class.

@pr_message_footer = pr_message_footer

As far as Gitlab is concern this string can be included anywhere in the commit message

Update: That worked well for me :)

@greysteil
Copy link
Contributor Author

Great to hear! Yep, we use that footer when passing through all the Dependabot-specific PR text from main Dependabot (commands, compatibility scores, etc.). It's perfect for your use case here 🙂

LucasLarson pushed a commit to LucasLarson/ConnectTheDots that referenced this issue Jul 25, 2022
“Bump” → “bump”:
dependabot/dependabot-core#1666
dependabot/dependabot-core#406

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
LucasLarson pushed a commit to LucasLarson/ConnectTheDots that referenced this issue Jul 26, 2022
“Bump” → “bump”:
dependabot/dependabot-core#1666
dependabot/dependabot-core#406

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
LucasLarson pushed a commit to LucasLarson/HQ9 that referenced this issue Jul 26, 2022
“Bump” → “bump”:
dependabot/dependabot-core#1666
dependabot/dependabot-core#406

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
LucasLarson pushed a commit to LucasLarson/dotfiles that referenced this issue Jul 27, 2022
“Bump” → “bump”:
dependabot/dependabot-core#1666
dependabot/dependabot-core#406

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
LucasLarson pushed a commit to LucasLarson/dotfiles that referenced this issue Jul 30, 2022
“Bump” → “bump”:
dependabot/dependabot-core#1666
dependabot/dependabot-core#406

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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

No branches or pull requests

2 participants