Create, rename and delete teams

Learn how to create, rename, and delete teams using CBG

This public content is an excerpt from Flutter staff GitHub docs. It is published as a reference to show how GitHub is used for inner source at Flutter.

This guide provides instructions on how to create, rename, and delete teams using the Codebase Governor (CBG). Follow these steps to efficiently manage your teams in Flutter-Global.

Prerequisites

Before you start managing teams, make sure you have read the Basic Concepts and Rules of Teams in Codebase Governor. You should also have a basic understanding of YAML syntax. You can learn more from this article.

Team Creation

To create a new team, add a team configuration file within the teams/ directory of the org-config repository. Follow these steps:

  1. Navigate to the org-config repository main page.
  2. Open the teams folder.
  3. Click the Add file > Create new file button.
  4. Enter your team name in the Name your file... field. The file name must follow the <your-team-slug>.yml pattern. For example, for a team named inner-source-opsec, the filename would be inner-source-opsec.yml.
  5. Add the team configuration properties in the file contents textarea. The team configuration file must follow the team configuration format.
  description: >
  Users who are granted write access to inner-source-opsec repos.

  owners:
    users:
      - crisostomon

  members:
    users:
      - crisostomon
      - Wilson-Pimentel
    teams:
      - contributors-cap-git-flutter

  1. Click on the Commit changes... button.
  2. Add a Commit message.
  3. Click on Propose changes to open a Pull Request.

After your pull request is open, CBG will run and display a comment similar to the image.

Once the pull request is approved and merged, CBG will create the team and apply any changes defined in the configuration.

Team Renaming

To rename a team, you can use two different methods:

  1. Using the git mv command: Rename the team configuration file using the git mv command.
  2. Using the GitHub UI file explorer: Navigate to the org-config repository and rename the file using the GitHub UI file explorer.

In any method used, the Codebase Governor will detect the change and apply the rename.

Using git mv

To rename a team using git mv, follow these steps:

  1. Clone the org-config repository:

     git clone git@github.com:Flutter-Global/org-config.git
    
  2. Create a new branch for the change. Replace <name-of-branch> with your branch name.

     git checkout -b <name-of-branch>
    
  3. Navigate to the teams folder.

     cd org-config/teams
    
  4. Rename the team configuration file, replacing <old-team-config-file> and <new-team-config-file> with the team filenames, using the following command:

     git mv <old-team-config-file> <new-team-config-file>
    
  5. Add and commit the changes:

     git add .
     git commit -m "renaming a team"
    
  6. Push the changes:

     git push
    
  7. Navigate to the org-config repository.
  8. Open a PR based on the branch created.

After your pull request is open, CBG will run and display a comment similar to the image below.

Once the pull request is approved and merged, CBG will rename the team and apply any changes defined in the configuration.

Using the GitHub UI

To rename a team using the GitHub UI, follow these steps:

  1. Navigate to the org-config repository main page.
  2. Open the teams folder.
  3. Open the team configuration file by clicking on it.
  4. Click on the Edit this file (✏️) button.
  5. In the team file name at the top left of the screen, replace the current name with the new one. The file name must follow the <your-team-slug>.yml pattern. For example, when renaming a team named inner-source-opsec to inner-source-operations, the filename would be inner-source-operations.yml.
  6. Click on the Commit changes... button.
  7. Add a Commit message.
  8. Click on Propose changes to open a Pull Request.

After your pull request is open, CBG will run and display a comment similar to the image below.

Once the pull request is approved and merged, CBG will rename the team and apply any changes defined in the configuration.

Team Deletion

To delete a team, remove the team configuration file from the teams folder. The Codebase Governor will then remove the team.

To delete a team using the GitHub UI, follow these steps:

  1. Navigate to the org-config repository main page.
  2. Open the teams folder.
  3. Open the team configuration file by clicking on it.
  4. Click on the ... > Delete file button.
  5. Click on the Commit changes... button.
  6. Add a Commit message.
  7. Click on Propose changes to open a Pull Request.

After your pull request is open, CBG will run and display a comment similar to the image below.

Once the pull request is approved and merged, CBG will delete the team.