Development Process (Git and JIRA) hebinbin.herokuapp.com
Background Agile development 1. Using Git as software version manage ment tool 2. Using JIRA On Demand as our project management tool 3. Ticket Driven Process. Before you beg in to program, create ticket. 4. No Ticket, No Commit 5. Using Pull Request to do code review.
Entire workflow -1 When you get a ticket with ticket numbe r like WEB-1234, normally it belongs to one of the following two types: feature o r bugfix. Since, we use pull request, before write down code, we need to checkout a new branch.
Entire Workflow - 2 We decided our branch name should be type-ticketnumber-destinationbranch ex: feature-WEB-1234-1.1 bugfix-WEB-2345-2.1
Entire Workflow -3 Example: we need to add a new feature to 1.1 bra nch and our ticket number is BB-1234
(1) git checkout –b feature-BB-1234-1.1 origin/1.1 (2) git push –u origin feature-BB-1234- 1.1 (3) Go to JIRA, change status from Open to In Progress.
Entire Workflow - 4 (4) Begin to commit the code
git add modified_file git commit -m “BB-1234: message” At here, we should put ticket number in commit m essage. The merit is that in the future, if we go bac k to see commit history, it is easily to understand w hy we changed this code.
Entire workflow -5 (5) git push (6) Go to stash/github/bitbucket to open a pu ll request, ask some guys to review your code. (7) Go to JIRA to log your worked time. (8) Begin to solve other ticket when waiting fo r code review result.
Entire workflow -6 (9) Once you get feedback, you should repeat step (4) to step (8) until you get permission to merge the code. (10) Delete local and remote feature branch. (10) Deploy the code to dev/qa server, Go to JIRA to ch ange status from In Progress to Ready for Verify (11) Assign ticket to reporter to ask him/her to confirm.
Entire workflow -7 (12) When everything goes well, reporter will close the ticket. Otherwise, reporter will reopen the ticket and you should repe at step (1) to step(11) again.
Problems 1. Easily forget to log work time. 2. Easily forget to change status. 3. Easily forget to put ticket number in co mmit message. 4. Easily forget to push branch to remote s erver.
Solution -1 Using git hooks and JIRA rest API post-checkout hook: 1. Automatically change JIRA ticket status from Open to In progress 2. Automatically push local branch to rem ote server
Solution - 2 Prepare-commit-msg hook: 1. Automatically get ticket number from b ranch name, and put it into commit me ssage.
Solution -3 Add worked time in commit message.
Solution -4 Commit-msg hook: 1. Check commit message has ticket num ber or not 2. Check commit message has right worke d time or not
Solution -5 Post-commit hook: 1. Automatically update worked time in JI RA. 2. Automatically add branch name and c ommit message as comment.