Skip to content

Developer Wiki

Maryush Padhol edited this page Oct 3, 2024 · 7 revisions

This guide outlines the Git strategy and best practices for managing branches, commits, and pull requests (PRs) in our development workflow.

Branching Strategy

Main Branches

  • master: This branch is reserved for releases. Only production-ready code should be merged here.
  • develop: The main branch for ongoing development. All feature branches should be merged into develop.

Feature and Bugfix Branches

  • Feature Branches: Created for new tasks and enhancements. Branch names follow the convention: feature/FE-15-Cars-Assignment-For-Admin.

  • Bugfix Branches: Created for fixing bugs. Branch names follow the convention: bugfix/FE-15-Cars-Assignment-For-Admin.

    • Branch Naming Conventions:
      • Prefix:
        • FE: Frontend-related task.
        • BE: Backend-related task.
        • DB: Database-related task.
        • DO: DevOps-related task.
      • Task Type:
        • feature: For new features or user stories.
        • bugfix: For bug fixes.
      • Task Number: Each branch should include the task number and a brief description of the task.
      • Example: feature/FE-15-Cars-Assignment-For-Admin
  • Quick Wins: For small tasks or bugfixes that involve a few lines of code, branch names can include multiple task numbers:
    bugfix/FE-15_16_18_20-Quick-Wins-Car-Assignment-and-Admin-Panel

Workflow Process

Creating and Merging Branches

  1. Create a Branch: For each task or bug, create a new branch from develop.
  2. Rebase Regularly: If develop changes while working on your branch, rebase your branch onto the latest develop and resolve any conflicts locally.
  3. Force Push: After rebasing, use a force push (git push -f) to update your branch.

Pull Requests

  1. Create a PR: Once your task is complete, create a PR to merge your branch into develop.
  2. Link to Task: Include links to the relevant task(s) in the PR description.
  3. Code Review: Every PR must be reviewed before merging. Ensure that the reviewer checks out the branch locally if needed.
  4. Merge and Update Status: Upon approval and merging, move the task to the Done column in GitHub. If it was the last task in a user story, move the story to Done as well.

Commit Strategy

  • Commit Message Format:
    • [TaskID]: Brief description of the task
    • Example: [15]: Cars Assignment for Admin

Status Tracking

  • Task Status:
    • In Progress: When work begins.
    • In Review: When the PR is ready for review.
    • Done: After the PR is merged.

Important Notes

  • Always keep an eye on changes in the develop branch and rebase your branch as necessary to stay up to date.
  • Reviewers should test branches locally where applicable.
  • Always check your code quality with such tools as sonar, prettier.

Setting Up the Local Environment

DB config

  1. Run docker-compose.yml: image

  2. Check if containers started successfully: image

  3. Enter http://localhost:5050/browser/

  4. Login with admin

  5. Press Add New Server

  6. Enter any Name under General tab: image

  7. Configure Connection tab: image

  8. Press save, now you have access to db.

Application Config

  1. Press this button to start the backend app: image

  2. Navigate to the frontend app project in terminal:

cd frontend

img

  1. If you are running frontend app for the first time, you need to install dependencies:
npm install
  1. Start Angular app:
ng serve

or, if you do not have angular installed:

npm run start
  1. Open the app. Navigate to the following address:
http://localhost:4200/

img

  1. Before each commit run following command (formats code styling):
npm run prettier

Also run follwoing command:

npm run lint

This will show all your code errors. Frontend pipeline may fail because of them.