Assisted Workflow (aw)
AW is a CLI tool to automate software development workflows based on github pull requests.
Here in Inaka we have the following workflow steps:
- Start a pivotal/jira/github story, moving to a new git branch for the new feature/bug fix
- Commit the changes, pushing to a new remote branch
- Submit a pull-request, allowing other team member to review the code, and merge into master if everything is ok
- Finish the story, removing both local and remote feature branches
- Deploy master branch.
For more details, please read more about the Inaka's Development Workflow.
This gem provides a command line tool to automate tasks related with start
, submit
and finish
steps.
Contact Us
For questions or general comments regarding the use of this library, please use our public hipchat room.
If you find any bugs or have a problem while using this library, please open an issue in this repo (or a pull request :)).
And you can check all of our open-source projects at inaka.github.io
Installation
On OS X, use homebrew:
$ brew tap inaka/formulas
$ brew install assisted_workflow
You can also install it as a ruby gem, adding this line to your application's Gemfile:
gem 'assisted_workflow'
And then executing:
$ bundle
Or installing it yourself as:
$ gem install assisted_workflow
Initial Setup
assisted_worflow
uses .awconfig
files to store your credentials and settings. When running the setup
command, it will create a global config file placed in your home folder, and one config file specific for a project, inside the project folder. In order to start using it, go to your project folder and run:
$ aw setup
You need to run this command for all projects you want to use assisted_worflow
.
If this is your initial setup, you need to inform your pivotal and github keys to allow api access. Do this using the config command:
$ aw config pivotal.fullname='Flavio Granero' --global
$ aw config pivotal.username='flavio' --global
$ aw config pivotal.token=MYPIVOTALTOKEN --global
$ aw config github.token=MYGITHUBOAUTHTOKEN --global
$ aw config branch_username='Username for branch names' --global
Note we're using the --global flag, to store this info in the global config file, valid for all projects. You can get your pivotal Api Token in your profile page and the github api key following the instructions to generate an oauth token.
Make sure to create the github token with the following permissions:
After the global setup, you need to inform the pivotal project_id, storing it in the project .awconfig file:
$ aw config pivotal.project_id=00001
You may want to store the local .awconfig file into the project repository, preventing other users to run this setup step for every project.
Usage
Having the setup step done, you are able to use the following commands to automate your workflow:
- $ aw start
List your next 5 pending stories in pivotal, showing a table with each story id, estimate and title. In order to include the already started stories in the list, run it with the -a
flag.
- $ aw start STORY_ID
Find and mark a pivotal story as started
, moving to a new git branch named with your pivotal username, story id and title. If the story is not estimated yet, you'll see an error message. You can set the estimate before starting it using the option -e 3
, for instance.
- $ aw submit
Submit the current story branch, creating a new github pull request. Once you're done with the story changes and everything is commited, run submit command to rebase the feature branch with master and submit it, creating a new pull request. The pull request url will be added as a note in the pivotal story, marking it as finished
.
- $ aw finish
Run finish command from a feature branch to check if the pull request has been merged into master, and to remove the local and remote branches safety.
There are shortcuts for these 3 main commands. Use $ aw s to start, $ aw u to submit and $ aw f to finish a story.
##Requirements
assisted_workflow
assumes you're using an 'origin' remote. If you are not,
either add an 'origin' remote that points to the GitHub repository you want to submit pull requests.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request