Skip to content

Commit 857e822

Browse files
committed
Add GitHub management docs
These docs detail how to add a new user, remove that user, and some extra information about how we use groups and who owns an account.
1 parent c054842 commit 857e822

File tree

7 files changed

+169
-0
lines changed

7 files changed

+169
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
position: 10
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
# Add a user to GitHub
5+
6+
This runbook describes how to add internal and outside collaborators to the [LBHackney-IT GitHub organisation](https://github.com/LBHackney-IT).
7+
8+
> ⚠️ Access to `LBHackney-IT` GitHub organisation is controlled by Google Group membership, so adding users directly within GitHub will not work.
9+
10+
There are two workflows: one for users with Hackney accounts and one for those that don't ([outside collaborators](#outside-collaborators)). Always prefer the Hackney Google account route where possible.
11+
12+
## Staff and users with Hackney Google account
13+
14+
### Prerequisites
15+
16+
1. The `Manager` role in [SAML-Github-Users](https://groups.google.com/a/hackney.gov.uk/g/saml-github-users/members), which includes the Head of Engineering and Lead Engineers.
17+
18+
### Steps
19+
20+
1. In the [`SAML-Github-Users` Google Group](https://groups.google.com/a/hackney.gov.uk/g/saml-github-users/members) add the user as a "Group member" with the following welcome message:
21+
22+
> Hi, you've been added to this group so you can access our GitHub organisation.
23+
>
24+
> There are some steps you need to take now (if you've already done a couple of these, even better):
25+
>
26+
> 1. Create or login to your GitHub account. Its fine to use an existing/personal account if you have one.
27+
> 2. Visit https://github.com/settings/emails and add your Hackney email address.
28+
> 3. Visit https://github.com/settings/security and setup 2 factor authentication.
29+
> 4. Click https://github.com/orgs/LBHackney-IT/sso and follow the steps to login to your Hackney Google account and associate it with your GitHub account.
30+
>
31+
> Once you've done that, tell the person who's getting you set up your GitHub username and they'll add you to the appropriate groups so you can get started.
32+
33+
2. Once the user has completed those steps grant them access to repositories by adding them to one or more teams, following [Manage GitHub teams](./manage_github_teams.md).
34+
35+
## Outside collaborators
36+
37+
Where someone doesn't (and shouldn't) have a Hackney Google account, we can add them as "Outside collaborators"
38+
39+
> ⚠️ This method is more restrictive and cumbersome than the one above. Only use it where a contributor should not have a Hackney Google account, e.g. a short-term agency engagement accessing a single repository.
40+
41+
### Prerequisites
42+
43+
1. You must have the `Admin` role on the repository/repositories you're adding the person to.
44+
2. The user's GitHub account must have 2 factor authentication enabled.
45+
46+
### Steps
47+
48+
> ℹ️ Outside collaborators are added per-repository, so you may need to complete these steps multiple times for the same person.
49+
50+
1. In the repository the user needs access to, visit `Settings` -> `Collaborators and teams`, then in `Manage access` click `Add people`.
51+
2. Find the user by their GitHub username.
52+
- GitHub will highlight that the user is an external collaborator.
53+
3. Pick the lowest-privilege role which enables the user to perform their tasks. Typically this will be `Write` or `Maintain`, but must _not_ be `Admin`.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
sidebar_position: 10
3+
---
4+
# GitHub account ownership
5+
6+
Unlike most enterprise systems, GitHub's user model separates ownership of accounts and organisations. Within Hackney we follow this model.
7+
8+
## The `LBHackney-IT` organisation
9+
10+
Hackney owns and manages the [LBHackney-IT organisation](https://github.com/LBHackney-IT). Any repositories, Actions, etc. within the organisation are owned and controlled by us, and we have various security controls in place. Therefore all Hackney-owned repositories _must_ reside within the `LBHackney-IT` organisation.
11+
12+
## User accounts
13+
14+
User accounts are personally owned, and may be used for other activities on GitHub outside of Hackney.
15+
16+
### Do I need to create a new account when I join Hackney?
17+
18+
You have two options when you join Hackney that are equally valid:
19+
20+
1. Use your existing GitHub account. This is the most common choice, and enables you to keep all your contribution history in one place, and contribute to work and personal projects without needing to switch accounts.
21+
22+
2. Create a new account, separate from your existing account. You may prefer to have strong separation between work and personal projects, in which case a fresh account dedicated to Hackney makes sense. Typically this involves adding `LBH` as a prefix of suffix to the username. You'll still own this account if you leave, and may choose to delete it.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
sidebar_position: 2
3+
---
4+
# Manage GitHub teams
5+
6+
This page describes how to create and manage teams, as well as deciding and managing team membership.
7+
8+
## Why and how we use teams
9+
10+
Managing individuals' access to specific repositories doesn't scale well. Instead, we group people into teams and manage those teams' access to repositories. This makes it much easier to get new starters set up correctly and manage people moving between teams.
11+
12+
Teams are managed in the [LBHackney-IT Teams list](https://github.com/orgs/LBHackney-IT/teams).
13+
14+
> ℹ️ Teams should reflect our organisation structure, so may require occasional refactoring to align them.
15+
16+
There are currently two main types of team in use:
17+
18+
1. Profession teams, e.g. [`Development Team`](https://github.com/orgs/LBHackney-IT/teams/development-team). Every member of the profession belongs in these groups, and they're used for things that are owned by the professional as a whole, for example this documentation site.
19+
20+
2. Project teams, e.g. [`Targeted Services`](https://github.com/orgs/LBHackney-IT/teams/targeted-services). These project teams have a sub-team for leads, which provides elevated privileges to do more sensitive repository management.
21+
22+
## Adding a new user
23+
24+
Typically a new joiner will need to be added to at least two teams:
25+
26+
- The profession they belong to (e.g. [Development Team](https://github.com/orgs/LBHackney-IT/teams/development-team)), and
27+
- One or more product teams they belong to (or the `leads` sub-team of that product).
28+
29+
### Adding a regular contributor
30+
31+
1. In the [Teams list](https://github.com/orgs/LBHackney-IT/teams) click on the team you want to add them to.
32+
2. Click `Add a member`
33+
3. Search for the user's GitHub username.
34+
4. Click `Invite`.
35+
36+
### Adding a lead
37+
38+
Leads are added in a subtly different way, in order to grant them the `Admin` role to repositories the team is responsible for.
39+
40+
> ℹ️ A "lead" in this context is someone trusted to manage the project, and doesn't reflect a specific job title.
41+
42+
1. In the [Teams list](https://github.com/orgs/LBHackney-IT/teams) find the team you want to add them to.
43+
2. Click the disclosure arrow on the right hand side (next to `X teams`, and click the relevant "... leads" team).
44+
![Screenshot showing the above steps to select the leads team.](../img/github_add_to_leads_team.png)
45+
3. Click `Add a member`
46+
4. Search for the user's GitHub username.
47+
5. Click `Invite`.
48+
49+
> ℹ️ The lead doesn't need to be added to the parent team, because the permissions are inherited.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
sidebar_position: 3
3+
---
4+
# Remove a user from GitHub
5+
6+
There are a couple of scenarioes where we will remove someone from the `LBHackney-IT` GitHub organisation:
7+
8+
- They leave Hackney
9+
- They no longer contribute to engineering projects or don't need access to GitHub anymore.
10+
11+
There are two workflows: one for users with Hackney accounts and one for those that don't ([outside collaborators](#outside-collaborators)). Always prefer the Hackney Google account route where possible.
12+
13+
## Staff and users with Hackney Google account
14+
15+
### Prerequisites
16+
17+
1. The `Manager` role in [SAML-Github-Users](https://groups.google.com/a/hackney.gov.uk/g/saml-github-users/members), which includes the Head of Engineering and Lead Engineers.
18+
2. The `Owner` role on the `LBHackney-IT` organisation (as of 2024 that's the Head of Engineering and some Lead Engineers).
19+
20+
### Steps
21+
22+
1. Remove the person from the [`SAML-Github-Users` Google Group](https://groups.google.com/a/hackney.gov.uk/g/saml-github-users/members).
23+
24+
2. Find the user in the [People list](https://github.com/orgs/LBHackney-IT/people), click the `...` dropdown, then select `Remove from organization`:
25+
![Screenshot showing the steps described above in the GitHub interface](../img/github_remove_user.png)
26+
27+
> ℹ️ It's necessary to remove the user from both Google _and_ GitHub to ensure all access is revoked in a timely fashion and they cannot re-join the GitHub organisation.
28+
29+
## Outside collaborators
30+
31+
It is possible to remove people from individual repositories, however the process described here requires fewer steps.
32+
33+
### Prerequisites
34+
35+
1. You must have the `Owner` role on the `LBHackney-IT` organisation (as of 2024 that's the Head of Engineering and some Lead Engineers).
36+
37+
### Steps
38+
39+
> ℹ️ These steps are also described in the [official GitHub documentation](https://docs.github.com/en/organizations/managing-user-access-to-your-organizations-repositories/managing-outside-collaborators/removing-an-outside-collaborator-from-an-organization-repository), which includes alternative instructions to remove people from individual repositories.
40+
41+
1. Visit [`People` -> `Outside collaborators`](https://github.com/orgs/LBHackney-IT/outside-collaborators).
42+
2. Select the people you'd like to remove from the organisation.
43+
3. Above the list of outside collaborators, select the `X collaborators selected...` dropdown menu, and click `Remove from all repositories`.
44+
4. Review the confirmation notice and confirm by clicking `Remove outside collaborators`.
125 KB
Loading
122 KB
Loading

0 commit comments

Comments
 (0)