Contributing Workflow¶
Git Branching¶
The sgn
team uses the standard git-branch-and-merge workflow, which has brief description
at GitLab and a full description
at BitBucket. As depicted below,
the workflow involves the creation of new branches for changes, the review of those branches through the Merge Request
process, and then the merging of the new changes into the main branch.
Examples Images from GstLAL repo
The example images are from the gstlal
repo, but the process is the same for all repos.
Git Workflow¶
In general the steps for working with feature branches are:
- Create a new branch from master:
git checkout -b feature-short-desc
- Edit code (and tests)
- Commit changes:
git commit . -m "comment"
- Push branch:
git push origin feature-short-desc
- Create merge request on GitLab
Merge Requests¶
Creating a Merge Request¶
Once you push feature branch, GitLab will prompt on gstlal repo home page. Click “Create Merge Request”, or you can also go to the branches page (Repository > Branches) and select “Merge Request” next to your branch.
When creating a merge request:
- Add short, descriptive title
- Add description
- (Uses markdown .md-file style)
- Summary of additions / changes
- Describe any tests run (other than CI)
- Click “Create Merge Request”
Collaborating on merge requests¶
The Overview page give a general summary of the merge request, including:
- Link to other page to view changes in detail (read below)
- Code Review Request
- Test Suite Status
- Discussion History
- Commenting
Leaving a Review¶
The View Changes page gives a detailed look at the changes made on the feature branch, including:
- List of files changed
- Changes
- Red = removed
- Green = added
- Click to leave comment on line
- Choose “Start a review”
After review started:
- comment pending
- Submit review
Responding to Reviews¶
Reply to code review comments as needed Use “Start a review” to submit all replies at once
Resolve threads when discussion on a particular piece of code is complete
Merging the Merge Request¶
Merging:
- Check all tests passed
- Check all review comments resolved
- Check at least one review approval
- Before clicking “Merge”
- Check “Delete source branch”
- Check “Squash commits” if branch history not tidy
- Click “Merge”
- Celebrate