Administration
To add new members to the organization and configure their permissions, we need an administrator. Each year an administrator is designed who preferably has experience with Git and GitHub in order to help his peers and resolve any Git problems they may face.
This chapter is destined for the person who administrates the GitHub organization
The administrators for past years were:
- 2019 @Diab0lix (Thierry Frycia)
- 2018 @azerupi (Mathieu David)
- 2017 @charlesvdv (Charles Vandevoorde)
You can contact them (most recent first preferably) if you are the chosen administrator for your team. They will add you with the correct privileges.
Creating a new repository
As administrator, your task is to setup GitHub and the repositories so that everyone can work on the project. The first thing you want to do is create a new repository for your year.
We do however recommend to base it off off the repository from previous year instead of starting from scratch. As administrator, head over to the organization's page to create a new repository.
Fill in the name with Eurobot-xxxx
where xxxx
represents the year. You can add a description if you want. Leave all
the rest blank because we are going to push the code of previous year in the newly created repository.
You will land on the following page
Let's push the repository from last year into the newly created repository. On the command line, clone last years repository. In this case, I will clone Eurobot-2018
git clone https://github.com/Ecam-Eurobot/Eurobot-2018.git
cd Eurobot-2018
Now you need to add the newly created repository as a remote. And verify that it was added correctly.
git remote add next-year https://github.com/Ecam-Eurobot/Eurobot-2019.git
git remote -v
Push the repository into the newly created repository
git push -u next-year master
If we refresh the GitHub page for the newly created repository, we can see something similar to below.
We can see (in the top left) that we are in the new repository and if we look at the README
at the
bottom we can see that it contains the files from previous year. We can now start to work in the new
repository without affecting the old one.
Note:
Now that the new repository is created, you can remove your local clone of the repository from last year. You will not need it anymore.
Adding teams
Now that the repository is created, you need to add two teams to the Eurobot organization:
- Eurobot <year>: this team will contain all the members participating this year. We will give this team the privileges to push to any branch except the master branch.
- Eurobot <year> Reviewers: this team will be given more privileges. They will be able to review and accept pull requests to the master branch.
Note:
The master branch should always be kept in a working state, this is the golden rule! As administrator, with help from the reviewers, it is your duty to make sure that this rule is followed by everyone. The normal development process should be the following:
- For any new development a new branch is created by the member that develops it
- He implements the new feature / behavior
- When done, he creates a pull request against the master branch
- At least one reviewer reads the changes, makes sure that the code meets the quality guidelines and aproves the changes
- Only then can the code be merged into the master branch.
Resist the urge of merging code that hasn't been reviewed.
To create a new team, go to the GitHub organization: Ecam-Eurobot and go to the "teams" tab.
Then click the "New team" button, fill in the name as mentioned above and then click "Create the team".
Give them correct permissions
Now that the teams are created, we need to give them the correct permissions. Go to the newly created repository, under "Settings" go to the "Collaborators & Teams" section.
Then add the teams you created with the write permissions, like below.
Now go to the "Branches" section and add the master branch as a protected branch.
And configure the protections like in the image below:
This will prevent anyone from commiting to the master branch directly except the administrator and the reviewers, who need push access to accept pull requests. Don't abuse these privileges, it is always better to have your code reviewed by others, even if you are a badass programmer!
Invite members
Now that everything is setup, we still need to invite the people who will be participating with you this year and assign them to the correct teams. To do this, go to the organization's page again under the "People" tab and click on "Invite member".
Type in their GitHub user name and invite them. In the invitation, you can already assign them to the correct teams.
Once the invitation has been sent, the invited user can accept the invitation by visiting the organization's page: https://github.com/Ecam-Eurobot.