Development Process
To have a fluid workflow, it's necessary to follow a well-defined process. In this bootcamp, we will introduce basic practices commonly used in the market.
Starting the development of a story
In the planning meeting, the epic will be presented, then all the stories that make up this epic will be planned. Each story will be divided into tasks (technical tasks to complete the story), and each task will be assigned to a team member. After the planning, the day-to-day development begins. It's important to follow these steps to succeed in development:
1. Story Opening
Before starting the sprint activities, it's important for all members who will be performing tasks for that story to join a call to discuss how each one will solve their task. It's important to go through the following steps:
- Create the story branch following the pattern described below
- Review the architecture and engineering documentation for the sprint
- Make agreements on how to integrate the parts that depend on each other
- Try to identify the dependencies that one task has on another
- Decide on the best way to manage task branches to avoid code conflicts
2. Developing a task
- Go to Jira and move the task card to "In Progress"
- Create the task branch based on the pattern described below
- Develop the code for the task
- Open a Pull Request in Bitbucket from the task to the feature
task/123456-activity-xyz -> feature/123456-registration-xyz - Wait for the code review from your Tutor Tech Lead and at least one of your teammates
- Check if the branch passed the deployment pipeline
- Finalize the PR by merging your branch into the feature, don't forget to delete your branch to avoid accumulating dead branches in the repository
3. Story Closing (Finalizing the story)
When all the tasks of the story are finally merged, hold a new call with all the members who performed tasks within the story to perform the following steps:
- Create the Pull Request from the feature branch to the main branch
feature/123456-registration-xyz -> main - Do a collective code review and check if everything is correct
- Resolve conflicts if there are any
- Validate and fix pipeline errors if there are any
- Test the functionality to see if it's working correctly
- Merge the feature into main and delete the feature branch
- Create the tag that represents the system version increment using semantic versioning
4. Bug Fixing (Bugfix)
When a problem (bug) or incorrect implementation of business rules is found while the feature's pull request is open (for example, during feature testing in the Story Closing), it is necessary to open a bugfix branch bugfix/123456-fix-wrong-button, fix the problem, and merge it into the feature. If the feature in question has already been merged into master, a hotfix branch needs to be created hotfix/123456-fix-wrong-button. Only a hotfix can be merged directly into main; this is a case that in real projects is a quick fix for something that is disrupting the system's operation in production.
Git Branching Model
Here is a diagram that represents the flow and lifecycle of the branches.
2. Branch Naming Structure
2.1 Branch Naming
- User Stories: Branches representing user stories should be named
feature/jira_id-name, wherejira_idis the story identifier in Jira andnameis a brief description of the functionality. - Tasks: Branches related to tasks should be named
task/jira_id-name, wherejira_idis the task identifier in Jira andnameis a brief description of the task. - Bug Fixes: Branches involving bug fixes should be named
bugfix/jira_id-name, wherejira_idis the bug identifier in Jira andnameis a brief description of the fix.
2.2 Naming Example
- User Story:
feature/JIRA-123-add-authentication(representing a story in Jira with IDJIRA-123) - Task:
task/JIRA-456-add-validation(representing a task in Jira with IDJIRA-456) - Bug Fix:
bugfix/JIRA-789-fix-login-error(representing a bug in Jira with IDJIRA-789)
3. Workflow with Jira Integration
-
Create the Feature Branch:
- Start from the
mainbranch and create a new branch for the story-related feature:git checkout main git checkout -b feature/JIRA-123-add-authentication
- Start from the
-
Create the Task Branch:
- Within the
feature/JIRA-123-add-authenticationbranch, create a new branch for a specific task:git checkout -b task/JIRA-456-add-validation
- Within the
-
Develop and Commit:
- Make the necessary changes in the
task/JIRA-456-add-validationbranch and commit them:git add . git commit -m "Implements task JIRA-456: add validation"
- Make the necessary changes in the
-
Create a Pull Request:
- After completing the task, push the
task/JIRA-456-add-validationbranch to the remote repository:git push origin task/JIRA-456-add-validation - Go to Bitbucket and create a pull request to merge the
task/JIRA-456-add-validationbranch into thefeature/JIRA-123-add-authenticationbranch.
- After completing the task, push the
-
Merge the Task Back into the Feature:
- After the pull request is reviewed and approved, the
task/JIRA-456-add-validationbranch will be merged into thefeature/JIRA-123-add-authenticationbranch.
- After the pull request is reviewed and approved, the
-
Finalize the Feature:
- When the feature is complete and tested, create a pull request to merge the
feature/JIRA-123-add-authenticationbranch back into themainbranch.
- When the feature is complete and tested, create a pull request to merge the
-
Remove Branches:
- After merging, you can delete the task and feature branches:
git branch -d task/JIRA-456-add-validation git branch -d feature/JIRA-123-add-authentication
- After merging, you can delete the task and feature branches: