GitXplorerGitXplorer
n

polly-merge

public
5 stars
3 forks
3 issues

Commits

List of commits on branch master.
Unverified
c2cf24fc8cd02c9da89941711dbb50acd9ef1c97

use WORKDIR to skip cd during test

nnoahp committed 5 years ago
Verified
70ead78c11faacfdfc8a72c552183cd73c86889c

Update README.md

nnoahp committed 5 years ago
Unverified
fc836a02370ddfc5bfeacb70094c659f4a75be56

emoji prefix for merge success

nnoahp committed 5 years ago
Unverified
1d928e88eca3ff5227da6d2bcaca77cfd009e02c

🧑 only trigger on comments from the current user

nnoahp committed 5 years ago
Unverified
fe1eecb23dace92d1e6c1f306c85c0db9553d550

Remove unnecessary regex change

kkesyog committed 5 years ago
Unverified
53f5538821be29dbd570141793dca717e4819a80

re-black

kkesyog committed 5 years ago

README

The README file for this repository.

🦜 polly-merge

License: Unlicense Code style: black GitHub Workflow Status LGTM

Polls your open pull requests on Bitbucket server, and attempts to merge any pull requests that have a comment/description containing @polly <COMMAND> (configurable).

NOTE: this is for use with the Bitbucket Server 1.0 REST API, it won't work with Bitbucket Cloud (which disabled the 1.0 API a while back).

You might for example run it as a cron job, to background merge your pr's instead of having to visit the bitbucket ui periodically.

It's kindof like a really bad version of one small piece of the bors-ng idea, running on a local machine and polling instead of a reasonable system design 😖 .

Commands

@polly merge

Attempts to merge the PR.

@polly merge-after <pr url>

Attempts to merge the PR only after the given PR has been merged, ex:

@polly merge-after https://bitbucket-server.com/projects/PROJ/repos/some-repo/pull-requests/1234

Usage

Requires python3 to be installed.

You might set this up to be run with cron, eg:

# grab this repo
git clone https://github.com/noahp/polly-merge.git ~/polly-merge

Then add the below entry to crontab, eg run crontab -e:

# set your token + url into the environment vars
POLLY_MERGE_BITBUCKET_API_TOKEN=<your token>
POLLY_MERGE_BITBUCKET_URL=<your url>
*/5 * * * * ~/polly-merge/polly-merge.py

See polly-merge.py for additional options.

Todo

Work in progress, remaining stuff:

  • maybe rework configuration to be a little less lame (list of params?)
  • add fake bitbucket server api 1.0

This should probably not be python but I'm reallllly lazy.

Keeping it dependency free at least so it has a chance of running on someone's system.

Developing

You can run whatever tests CI runs by executing the ./test.sh script (requires Docker; everything runs in a container).