Giter Site home page Giter Site logo

th3alphanerd / simple-bitbucket-commit-checker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tomasbjerre/simple-bitbucket-commit-checker

0.0 2.0 0.0 1.61 MB

Simple, and easy to use, commit checker for Atlassian Bitbucket Server

Home Page: https://marketplace.atlassian.com/plugins/se.bjurr.sscc.sscc

License: Other

Shell 0.18% Java 99.16% CSS 0.22% JavaScript 0.45%

simple-bitbucket-commit-checker's Introduction

Simple Bitbucket Commit Checker Build Status

Simple, and easy to use, commit checker for Atlassian Bitbucket. There are many commit checkers out there. This plugin aims at being simple and user friendly. The admin GUI (here and here) allows the Bitbucket administrator to add custom messages for each rejection reason. Here is a sample reject message and here is a sample accept message. This is a screenshot of a push being rejected.

Available in Atlassian Marketplace.

Features

  • Check author in commit
    • email is same as users email in Bitbucket.
    • email is same as any users email in Bitbucket.
    • name is same as users name in Bitbucket.
    • name is same as any users name in Bitbucket.
    • name is same as users user slug in Bitbucket.
    • name is same as any users user slug in Bitbucket.
  • Check that author name, slug, and/or email, in commit exists for any user in Bitbucket.
  • Check committer in commit.
    • email is same as users email in Bitbucket.
    • name is same as users name in Bitbucket.
    • name is same as users user slug in Bitbucket.
  • Optionally check author email against regular expression instead of equality to email in Bitbucket. Like:
    • ^${BITBUCKET_USER}@.*
    • ^[^@]*@company.domain$
  • Check JQL query. Can be used to check that any JIRA is in a specific state. There is an extra variable, ${REGEXP}, available for use in the query.
    • Example: issue = ${REGEXP} AND status = "In Progress" AND assignee in ("${BITBUCKET_USER}")
  • Simple configuration of rules that must apply to commit messages. Organized in groups.
    • A group can be used for matching, for example, issues. It can state that "at least one", "all of" or "none" of the issues can be mentioned in the commit messages.
    • Rules are added to the group. A rule can, for example, define Jira as a regular expression and the name "Jira".
    • If a group matches a commit, it can reject it or just show a message to the comitter.
  • Check only branches matching a regular expression.
  • Check that branch name matches specific regexp.
    • You may use variables here to make sure user tomas can only commit to dev/tomas/.+ with a regexp like refs/heads/dev/${BITBUCKET_USER_SLUG}/.+.
  • Exclude merge commits.
  • Exclude tag commits.
  • Check commits in pull requests
  • Show a general reject message.
  • Show a general accept message.
  • Optionally accept all commits from service users.
  • Optionally accept all commits if pattern matches the username. Checks will be ignored for user if pattern matches its name, like ^BATCH.* will ignore users with name starting with BATCH.
  • Dry run mode, where all commits are accepted. But verification results are shown.
  • Supporting variables to be used in error messages and checks.
    • BITBUCKET_EMAIL, Email of user in Bitbucket.
    • BITBUCKET_NAME Name of user in Bitbucket.
    • BITBUCKET_USER, User display name of user in Bitbucket.
    • BITBUCKET_USER_SLUG, User slug (username) of user in Bitbucket.
    • COMMITTER_EMAIL, Email of committer name.
    • COMMITTER_NAME, Name of committer email.
    • AUTHOR_EMAIL, Email of author email.
    • AUTHOR_NAME, Name of author name.

The plugin is configured on repository level, where all hooks are configured. If you want to configure it once for all repos, have a look at Settings Synchronizer for Bitbucket.

Design goals

The included features should:

  • Be easy to configure as an administrator of Bitbucket. Any rejection reason delivered to the committer should be configurable.
  • Be easy to use as a committer. With user friendly rejection messages, that clearly explains what was wrong and how to fix it.

Developer instructions

You will need Atlas SDK to compile the code.

https://developer.atlassian.com/docs/getting-started/set-up-the-atlassian-plugin-sdk-and-build-a-project

You can generate Eclipse project:

atlas-compile eclipse:eclipse

Package the plugin:

atlas-package

Run Bitbucket, with the plugin, on localhost:

export MAVEN_OPTS=-Dplugin.resource.directories=`pwd`/src/main/resources
mvn bitbucket:run

You can also remote debug on port 5005 with:

atlas-debug

Make a release:

https://developer.atlassian.com/docs/common-coding-tasks/development-cycle/packaging-and-releasing-your-plugin

mvn release:prepare
mvn release:perform

simple-bitbucket-commit-checker's People

Contributors

jwarlander avatar tomasbjerre avatar

Watchers

 avatar  avatar

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.