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

Commit message format #260

Closed
sobolevn opened this issue Apr 20, 2019 · 4 comments
Closed

Commit message format #260

sobolevn opened this issue Apr 20, 2019 · 4 comments

Comments

@sobolevn
Copy link

Is it possible to set commit message format?

We use commitezen and conventional-changelog.
We also have this regex /^(revert: )?(feat|fix|docs|refactor|chore)(\(.+\))?:.{1,50}refs #\d+/ as a push-rule.

@greysteil
Copy link
Contributor

Dependabot should figure this out automatically based on the repo it's working on, using the logic in this class. Are you having trouble with a particular repo?

@sobolevn
Copy link
Author

@greysteil I am actually not able to reach this point yet 😄
Please, see #262

@sobolevn
Copy link
Author

sobolevn commented Apr 20, 2019

And now I able to reproduce this:

  - Updating dependabot-omnibus (from 0.105.6)…/builds/wemake.services/kira-dependencies/vendor/ruby/2.6.0/gems/gitlab-4.10.0/lib/gitlab/request.rb:67:in `validate': Server responded with code 400, message: Commit message does not follow the pattern '^(revert: )?(feat|fix|docs|refactor|chore)(\(.+\))?:.{1,50}refs #\d+'. Request URI: https://gitlab.com/api/v4/projects/wemake%2Eservices%2Fkira%2Ddependencies/repository/commits (Gitlab::Error::BadRequest)
	from /builds/wemake.services/kira-dependencies/vendor/ruby/2.6.0/gems/gitlab-4.10.0/lib/gitlab/request.rb:46:in `block (2 levels) in <class:Request>'
	from /builds/wemake.services/kira-dependencies/vendor/ruby/2.6.0/gems/gitlab-4.10.0/lib/gitlab/client/commits.rb:158:in `create_commit'
	from /builds/wemake.services/kira-dependencies/vendor/ruby/2.6.0/gems/dependabot-common-0.105.6/lib/dependabot/clients/gitlab_with_retries.rb:67:in `public_send'
	from /builds/wemake.services/kira-dependencies/vendor/ruby/2.6.0/gems/dependabot-common-0.105.6/lib/dependabot/clients/gitlab_with_retries.rb:67:in `block in method_missing'
	from /builds/wemake.services/kira-dependencies/vendor/ruby/2.6.0/gems/dependabot-common-0.105.6/lib/dependabot/clients/gitlab_with_retries.rb:83:in `retry_connection_failures'
	from /builds/wemake.services/kira-dependencies/vendor/ruby/2.6.0/gems/dependabot-common-0.105.6/lib/dependabot/clients/gitlab_with_retries.rb:64:in `method_missing'
	from /builds/wemake.services/kira-dependencies/vendor/ruby/2.6.0/gems/dependabot-common-0.105.6/lib/dependabot/pull_request_creator/gitlab.rb:107:in `create_commit'
	from /builds/wemake.services/kira-dependencies/vendor/ruby/2.6.0/gems/dependabot-common-0.105.6/lib/dependabot/pull_request_creator/gitlab.rb:41:in `create'
	from /builds/wemake.services/kira-dependencies/vendor/ruby/2.6.0/gems/dependabot-common-0.105.6/lib/dependabot/pull_request_creator.rb:59:in `create'
	from ./generic-update-script.rb:143:in `block in <main>'
	from ./generic-update-script.rb:92:in `each'
	from ./generic-update-script.rb:92:in `<main>'
ERROR: Job failed: exit code 1

@sobolevn
Copy link
Author

I have switched my push rule check for commit messages. That's the commit message I got: build(deps): bump dependabot-omnibus from 0.105.6 to 0.105.8

The repository consists of just three commits:
Снимок экрана 2019-04-20 в 16 37 07

Now I know that I have to refactor my push rule to: ^(revert: )?(feat|fix|docs|build|refactor|chore)(\(.+\))?:.{1,50}(refs #\d+)?

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