-
Notifications
You must be signed in to change notification settings - Fork 0
For Contributors TeamCollaborationWorkflow
This document provides a complete team collaboration workflow, including GitHub repository creation, branch management, task assignment, code review, and Pull Request merging, with detailed step-by-step operations.
- Create a GitHub Repository
- Initialize Branch Strategy
- Configure Code Review Responsibility
- Use GitHub Projects for Task Management
- Creating GitHub Issues
- Develop & Create Pull Requests
- Review Code
- Merge Pull Request
- Sync
- Release
- Result
- Log in to GitHub, click the + button in the upper right corner, and select New repository.
- Fill in the following information:
-
Repository name:
simulation-display - Description: An interactive simulation display system.
- Visibility: Choose Public or Private.
-
Repository name:
- Check Initialize this repository with a README, then click Create repository.
Branching strategy is essential for team collaboration development. The recommended structure:
- main: The stable branch used for production-ready code.
- develop: The main development branch for integrating feature branches.
- feature/xxx: Feature branches, one for each new feature or task.
- hotfix/xxx: For urgent bug fixes in production.
- Clone the repository locally:
git clone https://github.com/immjunjie/simulation-display.git cd simulation-display - Create the
developbranch:git checkout -b develop git push origin develop
- In the GitHub repository page, go to Settings > Branches > Branch protection rules.
- Click Add branch protection rule for both
mainanddevelopbranches, and set:- Require pull request reviews before merging
- Require status checks to pass before merging
- Include administrators
Below is the revised .github/CODEOWNERS file, supporting mutual review and multiple reviewers:
# Frontend code developed by A, B, C. Reviews:
# - If A submits, B and C review
# - If B submits, A and C review
# - If C submits, A and B review
/frontend/* @userA @userB @userC
# Backend code developed by A, B, D. Reviews:
# - If A submits, B and D review
# - If B submits, A and D review
# - If D submits, A and B review
/backend/* @userA @userB @userD
# Docs maintained by C
/docs/* @userC
- When a developer submits a Pull Request involving these paths, GitHub automatically requests the listed reviewers.
- Reviewers must approve before merging is allowed.
- If the submitter is also a listed reviewer, they are automatically excluded from reviewing their own PR.
- In the GitHub repository, go to Projects, click New project.
- Choose the Table template, name it
Simulation Display System Development. - Create the following columns:
- To Do: Not started tasks.
- In Progress: Tasks currently being worked on.
- Done: Completed tasks.
For each task, create a GitHub Issue and link it to the relevant project. Issues help track progress and assign responsibilities.
- Go to the Issues tab of the GitHub repository.
- Click the New Issue button.
- Fill in the following details:
- Title: Provide a concise summary of the task, e.g., "Develop login page" or "Implement login authentication."
- Description: Include detailed information about the task, its goals, requirements, and context.
-
Labels: Add labels like
frontendorbackendto categorize the task. - Assignees: Assign the team members responsible for completing the task.
- Click Submit new issue to create the issue.
Here are some sample issues:
- Develop login page: Design and implement the login page for the application, assigned to frontend developers.
- Implement login authentication: Build and integrate backend logic for user authentication, assigned to backend developers.
- On the issue page, locate the Projects section on the right sidebar.
- Click the + Add to project button.
- Select the relevant project (e.g.,
Simulation Display Development) and add the issue to the To Do column.
Using this approach, all tasks can be visually tracked within GitHub Projects, moving through the columns (To Do, In Progress, Done) as they are completed.
- Developers create feature branches from
develop:git checkout develop git checkout -b feature/frontend-login
- Commit and push code:
git add frontend/* git commit -m "Add frontend login page" git push origin feature/frontend-login
- Go to the repository’s Pull Requests page on GitHub.
- Click New Pull Request, select
base: developandcompare: feature/frontend-login. - Fill in the description, and use
Fixes #1to auto-link and close the related Issue.
- Open the Pull Request page, click Files changed to view all file changes.
- Click + on code lines to add inline comments.
- Submit your review:
- Comment: Submit comments only.
- Approve: Approve the changes.
- Request changes: Ask the developer to make changes.
- Configure GitHub account:
- Go to File > Settings > Version Control > GitHub.
- Add your GitHub account.
- View Pull Requests:
- Go to Git > GitHub > View Pull Requests.
- Select the PR to review.
- Review code:
- Use PyCharm’s Diff tool to view changes.
- Right-click code lines to Add Comment.
- Submit review:
- Click Submit Review and choose Approve or Request changes.
-
Install Plugin:
- Open VSCode Extensions (
Ctrl+Shift+XorCmd+Shift+X). - Search for GitHub Pull Requests and Issues, click Install.
- Open VSCode Extensions (
-
Configure Account:
- Open VSCode settings, search GitHub Authentication.
- Click Sign into GitHub, authorize login.
-
View Pull Requests:
- In the left sidebar, click Source Control and find the GitHub Pull Requests tab.
- Select the PR and Checkout Pull Request.
-
Review code:
- Click Files changed, use the Diff Viewer to see changes.
- Click + on code lines to add comments.
-
Submit review:
- Click Submit Review and choose Approve, Request changes, or Comment.
- On the Pull Request page, click Merge pull request.
- Choose merge method:
- Create a merge commit (recommended, preserves history).
- Squash and merge (combines commits).
- Click Confirm merge to finish.
- Delete the feature branch by clicking Delete branch.
- Go to Git > GitHub > View Pull Requests.
- Select the approved PR.
- Click Merge Pull Request.
- Delete the feature branch:
- In the branch manager, right-click the branch and choose Delete Branch.
- In the GitHub Pull Requests panel, select the approved PR.
- Click Merge Pull Request.
- Choose merge method and complete the merge.
- Delete the feature branch:
- Click Delete Branch when prompted, or delete manually.
Team members should sync their code in the following scenarios:
- New code has been merged into the
mainbranch and needs to be pulled locally. - Before starting a new task, ensuring the local repository is up-to-date with the latest changes.
All team members should follow these steps to sync to the latest code:
- Switch to your local
mainbranch:git checkout main
- Pull the latest changes from the remote repository:
git pull origin main
- If you are starting a new task or feature, create a new branch from the updated
mainbranch:git checkout -b feature/your-branch-name
- Ensure any ongoing work is committed or stashed before syncing to avoid losing changes.
- Always sync the latest code before starting a new task to reduce merge conflicts.
A new version can be released under the following conditions:
- All planned features for the current milestone have been implemented and tested.
- Critical or high-priority issues have been resolved.
- The
mainbranch is confirmed to be stable and has passed all CI/CD checks. - The team has reviewed and approved the release candidate.
- Ensure all features and bug fixes are merged into the
mainbranch. - If there are pending changes in other branches (e.g.,
develop), complete the Pull Request and merge them first.
- Switch to the
mainbranch and ensure it is up-to-date:git checkout main git pull origin main
- Create a new version tag using Semantic Versioning (e.g.,
v1.0.0for major releases,v1.0.1for patches):git tag -a v1.0.0 -m "Release version 1.0.0" git push origin v1.0.0
- Navigate to the Releases section of the GitHub repository.
- Click on Draft a new release.
- Fill in the following details:
-
Tag version: Select the version tag created in Step 2 (e.g.,
v1.0.0). - Release title: Provide a clear title, such as "Version 1.0.0".
- Description: Summarize key features, changes, and fixes in this release. Include links to related Pull Requests or Issues.
-
Tag version: Select the version tag created in Step 2 (e.g.,
- Click Publish release.
- Inform the team and stakeholders about the new release using email, Slack, or other communication tools.
- Share the release notes and include the link to the GitHub Release page.
- All team members should sync the latest changes from the
mainbranch (refer to Section 9: Sync):git pull origin main
- Update any dependent documentation or configuration files to reflect the new version.
- Begin planning and development for the next milestone, creating new branches as needed.
This workflow enables your team to collaborate efficiently on GitHub, achieving:
- Clear division of responsibility: Developer and reviewer roles are explicit.
- Multi-tool support: GitHub GUI, PyCharm, and VSCode for flexible reviewing and merging.
-
Code quality assurance:
.github/CODEOWNERSfor automated review assignments. - Sync: Always sync the latest changes before starting new tasks to reduce conflicts.
- Release: Follow the release conditions strictly to ensure stability and quality.
Use automated tools (e.g., GitHub Actions, Jenkins) to verify the stability of the release candidate.