Skip to content

Commit

Permalink
Merge pull request #46 from OpenRailAssociation/more-team-settings
Browse files Browse the repository at this point in the history
Synchronise all team settings
  • Loading branch information
mxmehl authored Aug 23, 2024
2 parents c919572 + afa6199 commit e3550f7
Show file tree
Hide file tree
Showing 6 changed files with 233 additions and 35 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,19 @@ The basic principle: all settings reside in YAML configuration files which will
## Features

* Manage GitHub organization owners
* Manage GitHub teams and their members and maintainers
* Support of sub-teams
* Manage GitHub teams, their members, maintainers and settings
* Support of parent/child teams
* Manage teams' permissions on organizations' repositories
* Invite members to the organization if they aren't part of it yet
* Warn about unmanaged teams
* Warn about organization members who are not part of any team
* Handle individual collaborator permissions to repositories

The tool's philosophy:

* All relevant configuration shall happen in the YAML configuration files, no actions in GitHub UI shall be necessary.
* All repository permissions shall be managed by team membership. Outside collaborators and individual permissions are discouraged.
* All teams shall be managed by this tool. While it can deal with unmanaged teams, it's not a priority and may cause warnings.

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.

Expand Down
13 changes: 13 additions & 0 deletions config/example/org.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,16 @@ org_name: example-org-on-github
# List of owners of the GitHub organisation
org_owners:
- octocat

# Default settings. Will be overridden if set in a team.
# If neither defaults nor team settings are present:
# - when creating a new team, will take GitHub's defaults.
# - when syncing setting of a team, will not touch the current status.
defaults:
team:
# Description of a team
description: ""
# Level of privacy of a team. Can be "secret" or "closed"
privacy: "closed"
# Notification setting of a team. Can be "notifications_enabled" or "notifications_disabled"
notification_setting: "notifications_enabled"
22 changes: 16 additions & 6 deletions config/example/teams/myteams.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
# SPDX-License-Identifier: CC0-1.0

# A Team with its name
Maintainers:
Project Team:
# Description of the team
description: "My awesome Maintainers team"
# Level of privacy of the team. Can be "secret" or "closed". Note: parent/child teams cannot be "secret"
privacy: "closed"
# Notification setting of the team.
# Can be "notifications_enabled" or "notifications_disabled"
notification_setting: "notifications_enabled"
# Team maintainers, can add new people and change team settings
maintainer:
- octocat
Expand All @@ -13,12 +20,15 @@ Maintainers:
# The repositories the team shall have access to with a certain permission
# Can be one of: pull, triage, push, maintain, admin
repos:
cool-repository: admin
other-repo: admin
cool-repository: push
other-repo: push

Subproject:
Project Maintainers:
# Make this a child team of the provided parent. Note: You should first
# describe parents in this file, then children
parent: Maintainers
member:
- user2
- octocat
repos:
cool-repository: maintain
cool-repository: admin
other-repo: maintain
2 changes: 1 addition & 1 deletion gh_org_mgr/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def _read_config_file(file: str) -> dict:
return config


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

0 comments on commit e3550f7

Please sign in to comment.