Skip to content

Commit

Permalink
chore: Add a script for creating labels (#2778)
Browse files Browse the repository at this point in the history
The follow-up after new gh issue templates:
- A script for creating labels (if they don't exist already).
- A script for adding labels to issues (according to the prepared .csv -
GitHub issues buckets).
  • Loading branch information
sfc-gh-jcieslak authored May 21, 2024
1 parent 1312ff1 commit ce0fbad
Show file tree
Hide file tree
Showing 5 changed files with 960 additions and 1 deletion.
20 changes: 19 additions & 1 deletion pkg/scripts/issues/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,22 @@
6. To close the issues with the appropriate comment provide `issues_to_close.csv` in `close-with-comment` dir. Example `20240430 - issues_to_close.csv` is given. The run:
```shell
cd close-with-comment && SF_TF_SCRIPT_GH_ACCESS_TOKEN=<YOUR_PERSONAL_ACCESS_TOKEN> go run .
```
```

# Creating new labels and assigning them to issues
1. Firstly, make sure all the needed labels exist in the repository, by running:
```shell
cd create-labels && SF_TF_SCRIPT_GH_ACCESS_TOKEN=<YOUR_PERSONAL_ACCESS_TOKEN> go run .
```
2. Then, we have to get data about the existing issues with:
```shell
cd gh && SF_TF_SCRIPT_GH_ACCESS_TOKEN=<YOUR_PERSONAL_ACCESS_TOKEN> go run .
```
3. Afterward, we need to process `issues.json` with:
```shell
cd file && go run .
```
4. Next you have to analyze generated CSV and assign categories in the `Category` column and resource / data source in the `Object` column (the `GitHub issues buckets` Excel should be used here named as `GitHubIssuesBucket.csv`; Update already existing one). The csv document be of a certain format with the following columns (with headers): "A" column with issue ID (in the format of "#<issue_id>"), "B" column with the category that should be assigned to the issue (should be one of the supported categories: "OTHER", "RESOURCE", "DATA_SOURCE", "IMPORT", "SDK", "IDENTIFIERS", "PROVIDER_CONFIG", "GRANTS", and "DOCUMENTATION"), and the "C" column with the object type (should be in the format of the terraform resource, e.g. "snowflake_database"). Then, you'll be able to use this csv (put it next to the `main.go`) to assign labels to the correct issues.
```shell
cd assign-labels && SF_TF_SCRIPT_GH_ACCESS_TOKEN=<YOUR_PERSONAL_ACCESS_TOKEN> go run .
```
Loading

0 comments on commit ce0fbad

Please sign in to comment.