GithubHelp home page GithubHelp logo

zeke / semantic-pull-requests Goto Github PK

View Code? Open in Web Editor NEW
1.2K 16.0 155.0 1.81 MB

:robot: Let the robots take care of the semantic versioning

Home Page: https://github.com/apps/semantic-pull-requests

License: Apache License 2.0

JavaScript 99.27% Shell 0.73%

semantic-pull-requests's Introduction

⚠️ THIS SERVICE IS NO LONGER MAINTAINED ⚠️

I maintained this project and kept the webservice running for several years, but it was often difficult, time-consuming, and generally low on my priority list compared to other things like work and family. The final blow was a Heroku incident in April 2022 in which all of Heroku's GitHub-related secrets were compromised, and Heroku invalidated existing secrets and disabled support for all GitHub-related integrations.

If you're looking for an alternative way of semantically checking your PRs, see the Alternatives section in the README below. GitHub Actions are the way to go!

Thanks for your understanding. I wish you luck on your journey to semantic englightenment.

Love, @zeke






Semantic Pull Requests

GitHub status check that ensures your pull requests follow the Conventional Commits spec

Using semantic-release and conventional commit messages? Install this Probot app on your repos to ensure your pull requests are semantic before you merge them.

✋ Wanna check your pull requests using a GitHub Actions workflow instead? See alternatives below.

How it works

👮 Note! The default behavior of this bot is not to police all commit messages, but rather to ensure that every PR has just enough semantic information to be able to trigger a release when appropriate. The goal is to gather this semantic information in a way that doesn't make life harder for project contributors, especially newcomers who may not know how to amend their git commit history.

By default, only the PR title OR at least one commit message needs to have semantic prefix. If you wish to change this behavior, see configuration section below.

Scenario Status Status Check Message
PR title is semantic 💚 ready to be squashed
any commit is semantic 💚 ready to be merged or rebased
nothing is semantic 💛 add a semantic commit or PR title

Example Scenario

Take this PR for example. None of the commit messages are semantic, nor is the PR title, so the status remains yellow:

screen shot 2018-07-14 at 6 22 58 pm

screen shot 2018-07-14 at 6 22 10 pm


Edit the PR title by adding a semantic prefix like fix: or feat: or any other conventional commit type. Now use Squash and Merge to squash the branch onto master and write a standardized commit message while doing so:


screen shot 2018-07-14 at 6 23 11 pm

screen shot 2018-07-14 at 6 23 23 pm

Installation

👉 github.com/apps/semantic-pull-requests

Configuration

By default, no configuration is necessary.

If you wish to override some behaviors, you can add a semantic.yml file to your .github directory with the following optional settings:

# Disable validation, and skip status check creation
enabled: false
# Always validate the PR title, and ignore the commits
titleOnly: true
# Always validate all commits, and ignore the PR title
commitsOnly: true
# Always validate the PR title AND all the commits
titleAndCommits: true
# Require at least one commit to be valid
# this is only relevant when using commitsOnly: true or titleAndCommits: true,
# which validate all commits by default
anyCommit: true
# You can define a list of valid scopes
scopes:
  - scope1
  - scope2
  ...
# By default types specified in commitizen/conventional-commit-types is used.
# See: https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json
# You can override the valid types
types:
  - feat
  - fix
  - docs
  - style
  - refactor
  - perf
  - test
  - build
  - ci
  - chore
  - revert
# Allow use of Merge commits (eg on github: "Merge branch 'master' into feature/ride-unicorns")
# this is only relevant when using commitsOnly: true (or titleAndCommits: true)
allowMergeCommits: true
# Allow use of Revert commits (eg on github: "Revert "feat: ride unicorns"")
# this is only relevant when using commitsOnly: true (or titleAndCommits: true)
allowRevertCommits: true

Alternatives

This project is a GitHub App that you can install on one or many repositories, making it a convenient choice if you want to use it on lots of different repos, or even an entire GitHub organization full of repos. Now that this GitHub App is no longer available, Semantic PRs can be used as a drop-in replacement GitHub App.

If, however, you want more control over exactly how and when your pull requests are semantically checked, consider writing your own custom Actions workflow using a GitHub Action like amannn/action-semantic-pull-request.

See also https://github.com/squash-commit-app/squash-commit-app, a GitHub App which adds an empty commit to an open pull request with a single commit when the title was changed

License

Apache 2.0

semantic-pull-requests's People

Contributors

angaziz avatar aniketroy avatar anshumanv avatar binarymuse avatar bkeepers avatar bleggbeard avatar clacan avatar clakech avatar davidcelis avatar dependabot[bot] avatar ezard avatar felipecrs avatar fofr avatar gr2m avatar greenkeeper[bot] avatar greenkeeperio-bot avatar guyfedwards avatar heel avatar levithomason avatar limaneto avatar locona avatar macklinu avatar pablosichert avatar rarneson avatar raul6469 avatar smasala avatar stefanbuck avatar tysonkamp avatar wojtekmach avatar zeke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

semantic-pull-requests's Issues

Plugin is not working at all

Following the documentation it should be "zero" configuration plugin. After the add to our organization (with a first test on only some repositories) the plugin is present but it taking no action at all.
image

The actual configuration we have:
image

But when we want to activate the check on the branch it is not visible:
image

We even try to activate the plugin forcing the configuration into the .github folder
image

Is there anything we are missing?

Adapt checks to fit repo's merge strategy

GitHub PR can be merged in three ways. Let's call them merge, squash, and rebase.

image

This bot should check the repo's merge button configuration and change its behavior accordingly:

  • If merge or rebase, then a semantic PR title is not adequate, as it won't become a commit message. In this case, at least one semantic commit is required in the PR.
  • If squash, then a semantic PR title is required, as any semantic commits in the PR will be squashed.

Custom types in PR aren't respected

I have the following .github/semantic.yml file, but the custom types are not being respected in the PR title:

titleOnly: true

types:
- major
- minor
- patch
- feat
- fix
- docs
- ci
- build
- test

Are the custom types only applicable to commits, but not PRs?

titleOnly option is being ignored?

I have a PR with an invalid PR title and the titleOnly: true option in my .github/semantic.yml file. I still get the status "ready to be merged or rebased". It doesn't seem to matter what I do, this will always be the status. The PR does have many commits that meet the conventional commit standard, but those should be ignored per the titleOnly option, right?

Screen Shot 2019-09-15 at 2 20 39 PM

Config file:

Screen Shot 2019-09-15 at 2 24 10 PM

This repo is a private one within an org, so I'm not sure if that has anything to do with it. I know it has been an issue with other apps I've tried.

feature: custom types

Would a PR to add configuration for accepting additional commit types be accepted?

Something along the lines of:

additionalTypes: 
    - foo
    - bar
    - baz

This would validate the message type is one of these types https://github.com/commitizen/conventional-commit-types/blob/master/index.json or one of the additional types.

According to the SPEC other types may be added. https://www.conventionalcommits.org/en/v1.0.0-beta.2/#specification I would like to explicitly configure those types.

Maybe semantic PR titles won't work

I was thinking pull request titles were used as the default merge and squash commit message, but I was wrong. They are the default body of the commit, not the subject 🤔

So, it seems a semantic PR title will not suffice for a triggering a semantic release:

screen shot 2018-02-27 at 4 53 50 pm

Thoughts on working around this, @groundwater and @gr2m?

Discrepancy between listed semantic PR titles and those approved by PR bot

Hi. We use the Semantic Pull Request bot on our project pyhf. However, we've noticed that the bot doesn't recognize PRs that start with the improvement keyword as being semantic (examples: pyhf PR 596 and PR 541) though it is listed in the link off of the README to commitizen/conventional-commit-types

PR title is semantic

I see that this is because improvement was added to commitizen/conventional-commit-types less than 2 weeks ago in their PR 13 and the Semantic Pull Request bot uses v2.2.0 of commitizen/conventional-commit-types — which was released in 2017.

I just wanted to report this, but I guess I should also ask if you plan on only supporting the types that are in releases of commitizen/conventional-commit-types. If so, I guess I should bug them RE: the possibility of a new release in 2019.

cc @kratsg @lukasheinrich

Support gitmoji as valid semantic prefix

Just a suggestion, but would it be possible to support Gitmoji as a valid semantic prefix ?

For instance, if I have a commit with message "✨ Bla bla bla" the ✨ (:sparkles:) might be enough to consider the commit to be about a new feature.
Same goes with 🐛 :bug:, ⚡ :zap:, 📝 :pencil:, 👷 :construction_worker:, etc...

What do you think ?

Scopes aren't being respected

The plugin doesn't seem to be blocking incorrect scopes. The project is in a monorepo so would like to limit the scopes to the packages available 😄

Here is my config:

titleOnly: true
allowMergeCommits: false
scopes:
  - core-repo
  - admin-frontend
  - api
  - constants
  - logger
  - mailer
  - splash-page

And this is the output:

Screenshot 2020-02-16 at 16 56 05

Screenshot 2020-02-16 at 16 56 10

Only squash commits are allowed in the repository, if that makes a difference.

feature: commitOnly

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

Add tests

There's an existing test harness from when this was forked from wip-bot, but they don't pass yet.

GitHub Actions would be better than this GitHub App

This thing is currently a GitHub App, but it might better serve the community if it was rewritten as a GitHub Action. This would allow more flexibility:

  • The configuration would live right inside the workflow file
  • I wouldn't have to host the app any more.
  • The on trigger in the workflow file could be configured to only run the action when certain files are changed (useful for monorepos, see #89)
  • People could fork the action and customize it to suit their needs. This is not easy with GitHub Apps.

add a config option to support case insensitivity

electron/electronjs.org-old#1639 has a title Build(deps): bump electron-i18n from 1.860.0 to 1.886.0 #1639 and this bot is setting a status of Pending — add a semantic commit or PR title.

I'm guessing this is a capitalization issue... The conventional commits spec doesn't appear to have a stance on case requirements. We can either update this bot to accept prefixes like this, or maybe ask @dependabot folks to use lowercase prefixes?

cc @BinaryMuse

app icon

What iconography could be used to represent "semantic pull requests"? 🤔

Here's what the current icon looks like:

icon

Add Docker support for use with GitHub Enterprise

Love the app, but it'd be awesome if you could update the semantic-release config and push a new version to docker hub every release, and tag the latest as latest, I want to use this app with enterprise github, if you do the docker build part, I'd be be able to add semantic-release part.

Deploy it.

We don't have a probot service registry yet, so this needs to be deployed somewhere. Probably Heroku if Electron or GitHub folks will be maintaining it 🤔

Status check stuck in pending status

Yesterday I enabled this status check for my team's repo. I rebased a couple of PRs and got passing checks for those with conventional commits.

However, the status check got stuck in the Pending state on a PR that I expected to simply fail the check — it's an open PR that's being reworked and has various WIP commits, some simply with a commit message of .. I don't expect there is anything to be done about it, and the PR is going to be closed and replaced in any case, but I thought it might be helpful to point it out as potentially being a bug in Semantic Pull Requests.

Is there a way to include Jira style prefix at the front of the message?

We are using the following commit structure with an optional bracket at the front of our commit message title:
For example the following would both work:
[ENG-123] feat(cool_thing): Amazing new feature release
chore(build_cleanup): Cleaning Jenkinsfile to include new logic

Is there a way to allow/configure for this on our PR title check?

Optionally allow failing the check

Context

When validation fails, it should be optionally allowed (via a config param) to fail the check instead of leaving it in a pending state.

Motivation

Sometimes, we'd like to have things a little stricter and disable merge entirely if the validation fails instead of suggesting the user to fix the PR title or commit message name whilst still allowing the PR to be merged

Add configuration options based on 'commitlint' rules

I usually configure my projects with commitlint and husky to lint the commit messages before they are pushed to the repository and personally I use @commitlint/config-conventional rules.

It would be nice if we could configure semantic-pull-requests with the same rules as commitlint. For instance, if I have a PR title like chore: Title subject, this is invalid with my commitlint configuration above (everything should be lower case) but semantic-pull-requests won't care and say it's fine.

The commitlint reference rules can be seen here: https://github.com/conventional-changelog/commitlint/blob/master/docs/reference-rules.md

I understand that implementing all these options could be a big task so maybe we could just start off with the simple and easier rules like casing, for instance.

beware of squashing single-commit PRs

Also, an edge case for squash commits (via @francisfuzz):

I was reminded of something I learned about how we treat squash merges recently and would like to share it here in the case it hasn’t been considered by the Electron team.

Squashing a pull request with one commit would use that commit’s message, but squashing a pull request with more than one commit will use the pull request’s title for the commit message.

[Bug Report]: allowMergeCommits is not working while merging

hi !

I have setup this app for docsify. And Added the following config.


titleAndCommits: true
allowMergeCommits: true
allowRevertCommits: true
anyCommit: true

It is working fine when pushing a commit with a custom commit message. But for merged commits, it is failing.

docsifyjs/docsify@6026357
docsifyjs/docsify@4514cfb

I have set the allowMergeCommits option to true.

I wonder if there is leading whitespace for merge commits that might be passing negative for this check 🤔

const isMergeCommit = message && message.startsWith('Merge')

Cannot use allowMergeCommits: true

When I setup allowMergeCommits: true the bot still complains when a PR contains Merge commits. Is the latest version (master) of the code deployed yet ?

PR #48 was merged 2 days ago and I don't know which version is deployed on production ;)

Service down?

Hello,

Ever since yesterday (May 17th), all my PR's are stuck waiting for the Semantic Pull Request status to be reported.

I've tried opening a new PR today and the same thing happens.

See https://github.com/aws/aws-cdk/pulls
See aws/aws-cdk#8048

Is it possible the service is down? How can i get to the bottom of this? I can't seem to find any incidents page for your service.

Thanks

commitsOnly being ignored

Similar issue to #70 when setting commitsOnly: true in a .github/semantic.yml the check incorrectly passes so long as the PR title is semantic. This is in a private repo.

File change:

Screen Shot 2020-04-20 at 11 20 13 AM

Semantic title, non-semantic commit
Screen Shot 2020-04-20 at 11 19 13 AM

Passes check when it should not
Screen Shot 2020-04-20 at 11 18 57 AM

CI

Set it up!

Seems confused by messages containing backticks

We saw the bot claim that this PR was invalid, but the corresponding PR for another branch was not.

Just hypothesizing, but is seems that the difference is:

  • The failing PR is on a branch with titleAndCommits set to true.
  • The succeeding PR has no config, so uses the default requirement of "By default, only the PR title OR at least one commit message needs to have semantic prefix."
  • On both PRs, the PR title looks fine.
  • Which means that the reason the bot didn't like the failing PR was probably because of the content in one of the commits: notably it has backticks in the title.

If this hypothesis is correct, it may actually be that the bug lies in the parse-commit-message package and not the bot code, but I thought I'd start here by asking if the above hypothesis sounds correct.

org-level commit types

I would like to augment the supported semantic version types at the org level. It is currently only possible at the repo level via config file, correct?

Document commit hooks as an alternative to `commitsOnly`

#33 landed a new commitsOnly configuration option which requires every single commit in a PR to have a semantic prefix. Trouble is, it can be difficult to amend your git history post-facto.

I think it would be useful to call out alternative ways of enforcing commit messages, like a husky precommit hook which prevents invalid messages before the author makes the git commit on their local machine.

Bot is approving incorrect PR title

Not sure if I'm missing the purpose of this bot, but I was under the impression it is essentially linting PR titles to match conventional-commit format.

This PR has an incorrect title yet the semantic-pull-request check has passed.
guyfedwards/emojo#18

Exclamation (breaking change) is not recognized

PR titles following the ! BREAKING CHANGE syntax are not recognized as valid. For example, we have a PR title like so:

fix(config)!: ...

This does not pass validation (the PR check remains pending) even though it is valid according to the spec:

BREAKING CHANGE: a commit that has a footer BREAKING CHANGE:, or appends a ! after the type/scope

The actual PR being referenced is vectordotdev/vector#1033.

feature request: honor commitlint config

a commitlint config can be used to inform commitlint about which commit convention should be used for a project. it would be great if this bot could recognize the presence of a config and use it to support more conventions.

personally i use a config to extend the conventional commit convention by adding a wip type for changes that are ready for integration but don't yet complete a feat or fix (for projects that prefer continuous integration over atomic changesets). not a huge deal if this bot doesn't recognize that extra type, but it seems like the additional ability to define a custom convention would make this bot very useful for others.

Why not both?

This plugin seems to only do title, commit message, or (title or commit message), but not (title and commit message). Can it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.