Skip to content

Commit

Permalink
chore: Add scripts to close issues from Pre Snowflake bucket (#2762)
Browse files Browse the repository at this point in the history
Add scripts to close issues from Pre Snowflake bucket (for future
reference; they were already run)
  • Loading branch information
sfc-gh-asawicki committed May 6, 2024
1 parent 8f2a363 commit 44c0c37
Show file tree
Hide file tree
Showing 9 changed files with 955 additions and 1 deletion.
1 change: 0 additions & 1 deletion pkg/resources/network_policy_attachment_acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ func TestAcc_NetworkPolicyAttachmentUser(t *testing.T) {
},
},
})

}

func TestAcc_NetworkPolicyAttachmentAccount(t *testing.T) {
Expand Down
18 changes: 18 additions & 0 deletions pkg/scripts/issues/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Generating the list of open issues
1. To use the script, generate access token here: https://github.com/settings/tokens?type=beta.
2. To get all open issues invoke the [first script](./gh/main.go) setting `SF_TF_SCRIPT_GH_ACCESS_TOKEN`:
```shell
Expand All @@ -9,3 +10,20 @@
cd file && go run .
```
5. File `issues.csv` should be generated in the `file` directory. This is the CSV which summarizes all the issues we have.

# Closing old issues (regarding https://github.com/Snowflake-Labs/terraform-provider-snowflake/discussions/2755)
1. To use the script, generate access token here: https://github.com/settings/tokens?type=beta.
2. First get all open issues by invoking:
```shell
cd gh && SF_TF_SCRIPT_GH_ACCESS_TOKEN=<YOUR_PERSONAL_ACCESS_TOKEN> go run .
```
3. File `issues.json` should be generated in the `gh` directory. This is the input file for the second script. The next script is based also on `presnowflake_bucket.csv` that was created based on the GH issues filtering.
4. To filter only closeable issues invoke [this script](./filter-closeable-old-issues/main.go):
```shell
cd filter-closeable-old-issues && go run .
```
5. Script will output files `issues_to_close.csv` and `issues_edited.csv`. There are two files documenting closing action on 30.04.2024 (`20240430 - issues_edited.csv` and `20240430 - issues_to_close.csv`). In `20240430 - notes.MD` there are notes regarding the questionable issues and the decisions taken.
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 .
```
188 changes: 188 additions & 0 deletions pkg/scripts/issues/close-with-comment/20240430 - issues_to_close.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
1267
1249
1221
1204
1161
1075
1068
1067
1066
1061
1042
1029
1005
1004
998
994
989
984
981
980
977
976
973
970
967
966
965
955
953
952
951
950
946
938
897
896
892
891
882
867
865
859
847
845
844
836
835
825
822
821
818
810
806
802
800
794
793
791
788
787
781
778
776
774
772
770
760
757
756
754
753
749
744
741
738
737
735
723
722
719
718
708
690
689
688
684
683
679
678
677
676
675
674
670
665
663
660
651
648
644
642
641
640
636
623
621
617
616
612
611
608
606
604
601
596
594
592
586
583
569
568
566
564
562
560
555
551
531
529
522
521
514
512
509
502
500
498
497
494
490
474
470
466
460
455
448
447
445
430
423
421
419
411
410
409
408
402
384
317
308
306
303
288
285
284
282
275
273
254
244
211
200
186
142
137
37
1000
993
963
712
587
300
295
225
222
218
189
152

0 comments on commit 44c0c37

Please sign in to comment.