Skip to content

Commit e3550f7

Browse files
authored
Merge pull request #46 from OpenRailAssociation/more-team-settings
Synchronise all team settings
2 parents c919572 + afa6199 commit e3550f7

File tree

6 files changed

+233
-35
lines changed

6 files changed

+233
-35
lines changed

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,19 @@ The basic principle: all settings reside in YAML configuration files which will
1818
## Features
1919

2020
* Manage GitHub organization owners
21-
* Manage GitHub teams and their members and maintainers
22-
* Support of sub-teams
21+
* Manage GitHub teams, their members, maintainers and settings
22+
* Support of parent/child teams
2323
* Manage teams' permissions on organizations' repositories
2424
* Invite members to the organization if they aren't part of it yet
2525
* Warn about unmanaged teams
2626
* Warn about organization members who are not part of any team
27+
* Handle individual collaborator permissions to repositories
28+
29+
The tool's philosophy:
30+
31+
* All relevant configuration shall happen in the YAML configuration files, no actions in GitHub UI shall be necessary.
32+
* All repository permissions shall be managed by team membership. Outside collaborators and individual permissions are discouraged.
33+
* All teams shall be managed by this tool. While it can deal with unmanaged teams, it's not a priority and may cause warnings.
2734

2835
Are you missing a feature? Please check whether it's [already posted as an issue](https://github.com/OpenRailAssociation/github-org-manager/issues), and create one of this isn't the case.
2936

config/example/org.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,16 @@ org_name: example-org-on-github
1010
# List of owners of the GitHub organisation
1111
org_owners:
1212
- octocat
13+
14+
# Default settings. Will be overridden if set in a team.
15+
# If neither defaults nor team settings are present:
16+
# - when creating a new team, will take GitHub's defaults.
17+
# - when syncing setting of a team, will not touch the current status.
18+
defaults:
19+
team:
20+
# Description of a team
21+
description: ""
22+
# Level of privacy of a team. Can be "secret" or "closed"
23+
privacy: "closed"
24+
# Notification setting of a team. Can be "notifications_enabled" or "notifications_disabled"
25+
notification_setting: "notifications_enabled"

config/example/teams/myteams.yaml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22
# SPDX-License-Identifier: CC0-1.0
33

44
# A Team with its name
5-
Maintainers:
5+
Project Team:
6+
# Description of the team
7+
description: "My awesome Maintainers team"
8+
# Level of privacy of the team. Can be "secret" or "closed". Note: parent/child teams cannot be "secret"
9+
privacy: "closed"
10+
# Notification setting of the team.
11+
# Can be "notifications_enabled" or "notifications_disabled"
12+
notification_setting: "notifications_enabled"
613
# Team maintainers, can add new people and change team settings
714
maintainer:
815
- octocat
@@ -13,12 +20,15 @@ Maintainers:
1320
# The repositories the team shall have access to with a certain permission
1421
# Can be one of: pull, triage, push, maintain, admin
1522
repos:
16-
cool-repository: admin
17-
other-repo: admin
23+
cool-repository: push
24+
other-repo: push
1825

19-
Subproject:
26+
Project Maintainers:
27+
# Make this a child team of the provided parent. Note: You should first
28+
# describe parents in this file, then children
2029
parent: Maintainers
2130
member:
22-
- user2
31+
- octocat
2332
repos:
24-
cool-repository: maintain
33+
cool-repository: admin
34+
other-repo: maintain

gh_org_mgr/_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def _read_config_file(file: str) -> dict:
8585
return config
8686

8787

88-
def parse_config_files(path: str) -> tuple[dict, dict, dict]:
88+
def parse_config_files(path: str) -> tuple[dict[str, str | dict[str, str]], dict, dict]:
8989
"""Parse all relevant files in the configuration directory. Returns a tuple
9090
of org config, app config, and merged teams config"""
9191
# Find the relevant config files for app, org, and teams

0 commit comments

Comments
 (0)