Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add a script for creating labels #2778

Merged
merged 6 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading