azure-sdk-tools/tools/github-labels
Jesse Squire 2607a1db4a
[GitHub Labels] More Repositories (#1915)
The focus of these changes is to add the following repositories:

- Azure\azure-sdk-for-ios
- Azure\azure-sdk-for-ios-pr
- Azure\azure-sdk-for-android
- Azure\azure-sdk-for-android-pr
- Azure\azure-sdk-pr

The "Stress" label has also been added back into the common set, by agreement
in the working group thread.
2021-08-17 14:45:33 -04:00
..
ghcreator Git Hub Label Management (#1829) 2021-07-22 09:15:43 -04:00
repository-snapshots [GitHub Labels] More Repositories (#1915) 2021-08-17 14:45:33 -04:00
.gitignore [GitHub Labels] C, C++, Go Updates (#1871) 2021-08-02 11:54:18 -04:00
README.md [GitHub Labels] Diff-vs-Common (#1885) 2021-08-09 17:20:14 -04:00
common-labels.csv [GitHub Labels] More Repositories (#1915) 2021-08-17 14:45:33 -04:00
deploy-labels.ps1 [GitHub Labels] Diff-vs-Common (#1885) 2021-08-09 17:20:14 -04:00
diff-repo-labels.ps1 [GitHub Labels] Diff-vs-Common (#1885) 2021-08-09 17:20:14 -04:00
refresh-snapshots.ps1 [GitHub Labels] Diff-vs-Common (#1885) 2021-08-09 17:20:14 -04:00
repositories.txt [GitHub Labels] More Repositories (#1915) 2021-08-17 14:45:33 -04:00
scan-new-labels.ps1 [GitHub Labels] Diff-vs-Common (#1885) 2021-08-09 17:20:14 -04:00

README.md

Overview

This area is focused on the management of GitHub labels for the various Azure SDK repositories, containing tools and data used for that purpose.

Prerequisites

  • .NET SDK: In order to run the GHCreator tool, a version of the .NET Core SDK capable of executing an application targeting netcoreapp3.1 is needed. The latest version of the .NET Core SDK is recommended.

  • PowerShell: In order to execute the scripts that perform the automation, PowerShell is needed. The latest version of PowerShell Core is recommended.

  • GitHub personal access token: When run, the GHCreator tool requires a personal access token for GitHub from a user with the ability to manage labels in each of the Azure SDK repositories. Instructions for generating a token can be found in the GitHub Docs article "Creating a personal access token."

Structure

  • root
    The root contains the core scripts for managing labels and the set of label data common across repositories.

  • repository-snapshots
    The container for a snapshot of the labels that exist in each repository; primarily used to help detect and report on new labels that have been added.

  • ghcreator
    The base container for the .NET Core-based tool used to query label information and perform creation/updates. This is a compiled drop from the GHCreator repository.

Scripts

deploy-labels.ps1

With the default parameter set, this script will deploy set of labels intended to be common across repositories from their definitions in the common-labels.csv file to the repositories identified by the repositories.txt file.

# Execute using the default set of label and repository data.
pwsh ./deploy-labels.ps1 << TOKEN >>

# View the help for the full set of parameters.
pwsh -Command "get-help ./deploy-labels.ps1 -full"

diff-repo-labels.ps1

With the default parameter set, this script will query set of labels for the requested repository and compare them against the set of common labels from the common-labels.csv file. Any labels found in the repository that are not part of the common set will be written as output.

# Execute for the .NET SDK repository using the default set of common label data.
pwsh ./diff-repo-labels.ps1 << TOKEN >> "Azure\azure-sdk-for-net"

# View the help for the full set of parameters.
pwsh -Command "get-help ./diff-repo-labels.ps1 -full"

refresh-shapshots.ps1

With the default parameter set, this script will query set of labels for each of the repositories identified by the repositories.txt file and save them as individual files in the repository-shapshots directory.

# Execute using the default set of repository data.
pwsh ./refresh-shapshots.ps1 << TOKEN >>

# View the help for the full set of parameters.
pwsh -Command "get-help ./refresh-shapshots.ps1 -full"

scan-new-labels.ps1

With the default parameter set, this script will query set of labels for each of the repositories identified by the repositories.txt file and compare them against the latest snapshot from in the repository-shapshots directory. Any new labels found will be written as output.

# Execute using the default set of repository data.
pwsh ./scan-new-labels.ps1 << TOKEN >>

# View the help for the full set of parameters.
pwsh -Command "get-help ./scan-new-labels.ps1 -full"

References and Resources