Contribution workflow - Team exercise
Now we want to try out the full contribution workflow practically in pairs of two persons!
Task: - Contribute information about Venus using the presented GitLab Contribution Workflow. - For that purpose, we divide all participants in pairs of two persons and send you to dedicated breakout rooms!
General Process¶
- Decide about the
Owner
andContributor
roles:Owner
adds the contributor to the project and reviews the changesContributor
solves the actual task
- Perform the workflow together (see below)
- You can use the screen sharing feature to better work together.
- Please return to main room until
14:45
! If you have still some time left, please switch roles and try again and/or experiment with the process on your own :)
Task and Workflow Description¶
Grant the Contributor access to your GitLab Project (OWNER)¶
- Select
Project information => Members
and clickInvite members
- Search and select the name of the contributor
- Select in the
Select a role
menu the roleDeveloper
- Click the
Invite
button
- The contributor should show up in the project member list
Contribute Information about Venus (CONTRIBUTOR)¶
- Switch to the GitLab project of the
Owner
- Create an issue (
Issues => New issue
, fill in details,Create issue
):- Title:
Add information about Venus
- Description:
We want to collect some basic information about Venus.
- Assignee: Yourself
- Label:
Documentation
- Title:
- Create a merge request from the issue (
Create merge request
, leave details as they are,Create merge request
) - Switch to your Git shell and contribute the information:
- Visit the GitLab project overview page of the Owner and copy the URL from
Clone => Clone with HTTPS
- Clone the Git repository:
git clone <URL> planets-<OWNER NAME>
- Change into the cloned repository:
cd planets-<OWNER NAME>
- Switch to the branch:
git switch 3-add-information-about-venus
(Please double-check the name of the branch in your case!)Older versions of Git use
git checkout 3-add-information-about-venus
- Add the file
venus.txt
with the content: - Commit the change locally:
git add venus.txt
git commit -m "Add initial information about Venus"
- Push the changes to the remote repository:
git push
- Visit the GitLab project overview page of the Owner and copy the URL from
- Switch to the merge request:
- Mark the merge request as ready (
Mark as ready
) - Assign the Owner as
Reviewer
- Mark the merge request as ready (
Review the Contribution and Merge it (OWNER)¶
- Check and provide feedback via comments
- Approve the merge request (
Approve
) - Merge the mere request (
Merge
) - Check the following aspects:
- See the changes in merge request list (
Merge requests
) - See the changes in the issue list (
Issues
) - See the changes in the Git history (
Repository => Graph
)
- See the changes in merge request list (
Update your local Git Repository (CONTRIBUTOR)¶
- Switch to the Git shell
- Switch to the
main
branch:git switch main
Older versions of Git use
git checkout main
- Pull the changes from the remote repository:
git pull
- Remove the local branch via:
git branch -d <BRANCH NAME>
- To get rid of the no longer needed remote branches, do a special fetch:
git fetch --prune
(will remove all origin/… branches that no longer exist)