Developer¶
The Developer processes Work Cards, develops them and deploys them to production.
Those live on the Work Board.
Those are the task Developer may want to perform.
Development as usual¶
Move on to the next task¶
Move on to the next (Trello) card with:
bb t next
This:
- Inspects
To Do
on the Work Board for the highest ticket assigned to you - Creates a new local git branch inferred from ticket name and prefixed with your github prefix
- (It is always forked from master and ensures master is up to date)
- Moves the card to
Doing
- Opens the card in browser for review
Issuing Pull Request¶
Code review¶
Code review ensures the quality of the code and disperses the knowledge about the code and features through the team.
-
blackbelt.commands.gh.
status_command
(pr_url, branch)[source]¶ Usage:
bb gh status https://github.com/apiaryio/apiary/pull/1234 bb gh status my_branch_name Applicable for PRs and branches
-
blackbelt.handle_github.
check_status
(pr_url=None, branch_name=None, error_on_failure=False)[source]¶ Returns status and required checks status of a given PR or branch.
This can be used to determine if a PR/branch can be merged without issues. Required checks might involve a status of a CI build, status of code reviews, etc. (see https://help.github.com/articles/about-required-status-checks/)
Pull requests
- Checks for Pull Request current state (open/closed)
- Retrieves required checks status (success/failure/pending)
Branches
- Retrieves required checks status (success/failure/pending)
Merging Pull Request¶
-
blackbelt.commands.gh.
merge_command
(pr_url)[source]¶ Usage:
bb gh merge https://github.com/apiaryio/apiary/pull/1234
-
blackbelt.handle_github.
merge
(pr_url)[source]¶ This merges PR on Github into master:
- Inspects the current repository and the pull request
- Switches to master and brings it up to date
- Merges the PR locally and pushes to master
- Deletes the merged branch from the remote repository/github
TODO:
- Comment the associated Trello card
Deploying Pull Requests¶
-
blackbelt.commands.gh.
deploy_command
(pr_url)[source]¶ Usage:
bb gh deploy https://github.com/apiaryio/apiary/pull/1234
-
blackbelt.handle_github.
deploy
(pr_url)[source]¶ Deploys PR to production
- Does Merging Pull Request
- Inform people on Slack about the merge and the deployment intent
- Prepares Heroku deploy slugs using
grunt create-slug
- Waits for CircleCI tests to pass
- TODO: If they fail, asks for retry
- Asks for deploy confirmation
- Notify others on Slack about deploy
- Deploys
- Creates a release on GitHub, using merged branch name as ‘ref’.
- If it can figure out related Trello card (looks for “Pull request for <link>”), moves it to “Deployed by” column
- Does not bring beer yet, unfortunately
Deploying master¶
Deploy current branch to production with:
bb production
This:
- Informs others on Slack
- Deploys master to production using
grunt deploy
- Deploys master to production using
grunt deploy --app=apiary-staging-qa
- Deploys master to production using
grunt deploy --app=apiary-staging-pre
Rollback production¶
Rollback production to previous version with:
bb rollback
This:
- Informs others on Slack
- Rollback production using
grunt rollback
- Rollback staging-qa using
grunt rollback --app=apiary-staging-qa
- Rollback staging-pre using
grunt rollback --app=apiary-staging-pre
Testing¶
Deploy current branch to staging with:
bb stage
This:
- Discovers what the current branch is
- Informs others on Slack
- Deploys the branch to staging using
grunt deploy