Wiplock - Protect main branch from in-progress branches
TL;DR
I released Wiplock that protects main branch from pull requests that contains WIP
in the title or incompleted tasks.
Wiplock is an OSS built with Go and React + Redux. Please take a look if you’re interested in.
https://github.com/ngs/wiplock
Motivation
In our daily development flow, we send WIP pull requests on GitHub before implementation was done.
Sometimes we mistakenly merge these pull requests before the tasks are completed or forget removing WIP
in the title that may confuse collaborators.
To prevent these kind of mis-operations, I’ve built an tiny web application called Wiplock.
How it works
1. Sign in with GitHub
After visiting Wiplock, you’ll see the black Sign in with GitHub button.
Hit it and Authorize this app on the next screen.
Make sure that organizations are granted that you want introducing Wiplock.
2. Find repository and turn the switch on
After you signed in with GitHub, your repositories will be listed in Wiplock.
Find repositories to introduce and turn the switch on.
3. Check that works
Go to your repository and edit or create pull request to contain WIP
in the title.
Once you edit the title, Pull Request status would become Pending.
4. Turn on protect branch
Go to Settings > Branches
of your repo, turn Require branches to be up to date before merging checkbox on.
Launch your own Wiplock
If you won’t like to give permission to applications managed by someone else, you can launch your own Wiplock on Heroku or Docker hosts.
Pre-requirements
You need to create your OAuth Application on GitHub.
https://github.com/settings/applications/new
Heroku
Just hit the Heroku Button on README of the repository.
https://github.com/ngs/wiplock#heroku
Docker
Redis server is required to launch on your host.
If you don’t have it yet, the Official Docker image will help you bootstrapping.
docker pull redis
docker run --name wiplock-redis -d redis
Pull Wiplock Docker image.
docker pull atsnngs/wiplock
And run Wiplock by passing REDIS_URL
with running container name.
docker run --name wiplock -p 8000:8000 -d --rm \
--link wiplock-redis:redis \
-e GITHUB_CLIENT_ID=${GITHUB_CLIENT_ID} \
-e GITHUB_CLIENT_SECRET=${GITHUB_CLIENT_SECRET} \
-e SECRET=${SECRET} \
-e REDIS_URL="redis://redis:6379" \
atsnngs/wiplock
Then you can see your Wiplock on your localhost.
Milestones
- Support locking pull requests labeled
in progress
- Support customizing locking conditions using
.wiplock.yml
on the repository root
I wish this could help your workflow safe, happy locking!