Skip to content

ci: grant PR write permissions for actions-comment-pull-request action#152

Merged
joamaki merged 1 commit intomainfrom
pr/tklauser/ci-pr-write-permissions
Mar 13, 2026
Merged

ci: grant PR write permissions for actions-comment-pull-request action#152
joamaki merged 1 commit intomainfrom
pr/tklauser/ci-pr-write-permissions

Conversation

@tklauser
Copy link
Copy Markdown
Member

We started seeing the error of the pr workflow 1:

Run thollander/actions-comment-pull-request@v2
No comment has been found with asked pattern. Creating a new comment.
Error: Resource not accessible by integration

According to the thollander/actions-comment-pull-request action's README2 we need to add pull-requestes: write permissions to the workflow.

Do that and also update the action to v3 while at it.

Footnotes

  1. https://github.com/cilium/statedb/pull/151#issuecomment-4046941923

  2. https://github.com/thollander/actions-comment-pull-request/blob/e4a76dd2b0a3c2027c3fd84147a67c22ee4c90fa/README.md?plain=1#L172-L181

@tklauser tklauser requested review from a team as code owners March 12, 2026 15:28
@tklauser tklauser requested review from derailed, joestringer and nebril and removed request for a team March 12, 2026 15:28
@tklauser tklauser force-pushed the pr/tklauser/ci-pr-write-permissions branch 2 times, most recently from a28413c to 199ccef Compare March 12, 2026 15:34
Copy link
Copy Markdown

@derailed derailed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tklauser Good catch!

@joamaki
Copy link
Copy Markdown
Contributor

joamaki commented Mar 13, 2026

Hmm now it's not running CI at all?

@tklauser
Copy link
Copy Markdown
Member Author

Hmm now it's not running CI at all?

Yeah, something is off with my change. The pull-requests: write is rejected as invalid for some reasone: https://github.com/cilium/statedb/actions/runs/23010090363/workflow

I'll look into it.

We started seeing the error of the pr workflow [^1]:

    Run thollander/actions-comment-pull-request@v2
    No comment has been found with asked pattern. Creating a new comment.
    Error: Resource not accessible by integration

According to the thollander/actions-comment-pull-request action's
README[^2] we need to add pull-requestes: write permissions to the
workflow.

Do that and also update the action to v3 while at it.

[^1]: #151 (comment)
[^2]: https://github.com/thollander/actions-comment-pull-request/blob/e4a76dd2b0a3c2027c3fd84147a67c22ee4c90fa/README.md?plain=1#L172-L181

Signed-off-by: Tobias Klauser <tobias@cilium.io>
@tklauser tklauser force-pushed the pr/tklauser/ci-pr-write-permissions branch 2 times, most recently from 8c847d1 to c1ade48 Compare March 13, 2026 10:48
@tklauser
Copy link
Copy Markdown
Member Author

Looks like there were some non-breaking spaces in the change. Should now be fixed.

However, the workflow on this PR will still use the workflow file from main where permissions are not set thus it will still fail. Adding pull_request_target in a temporary commit didn't help for some reason 😕

@github-actions
Copy link
Copy Markdown

$ make
go build ./...
go: downloading github.com/cilium/hive v1.0.0
go: downloading golang.org/x/time v0.5.0
go: downloading go.yaml.in/yaml/v3 v3.0.3
go: downloading github.com/spf13/cobra v1.8.0
go: downloading github.com/spf13/pflag v1.0.5
go: downloading github.com/cilium/stream v0.0.0-20240209152734-a0792b51812d
go: downloading github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de
go: downloading github.com/spf13/viper v1.18.2
go: downloading go.uber.org/dig v1.17.1
go: downloading golang.org/x/term v0.16.0
go: downloading github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
go: downloading github.com/mitchellh/mapstructure v1.5.0
go: downloading golang.org/x/sys v0.17.0
go: downloading golang.org/x/tools v0.17.0
go: downloading github.com/fsnotify/fsnotify v1.7.0
go: downloading github.com/sagikazarmark/slog-shim v0.1.0
go: downloading github.com/spf13/afero v1.11.0
go: downloading github.com/spf13/cast v1.6.0
go: downloading golang.org/x/text v0.14.0
go: downloading github.com/subosito/gotenv v1.6.0
go: downloading github.com/hashicorp/hcl v1.0.0
go: downloading gopkg.in/ini.v1 v1.67.0
go: downloading github.com/magiconair/properties v1.8.7
go: downloading github.com/pelletier/go-toml/v2 v2.1.0
go: downloading gopkg.in/yaml.v3 v3.0.1
STATEDB_VALIDATE=1 go test ./... -cover -vet=all -test.count 1
go: downloading github.com/stretchr/testify v1.8.4
go: downloading go.uber.org/goleak v1.3.0
go: downloading golang.org/x/exp v0.0.0-20240119083558-1b970713d09a
go: downloading github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2
ok  	github.com/cilium/statedb	416.777s	coverage: 78.5% of statements
ok  	github.com/cilium/statedb/index	0.013s	coverage: 33.7% of statements
ok  	github.com/cilium/statedb/internal	0.020s	coverage: 42.9% of statements
ok  	github.com/cilium/statedb/lpm	4.969s	coverage: 77.9% of statements
ok  	github.com/cilium/statedb/part	62.733s	coverage: 87.7% of statements
ok  	github.com/cilium/statedb/reconciler	0.270s	coverage: 92.3% of statements
	github.com/cilium/statedb/reconciler/benchmark		coverage: 0.0% of statements
	github.com/cilium/statedb/reconciler/example		coverage: 0.0% of statements
go test -race ./... -test.count 1
ok  	github.com/cilium/statedb	38.641s
ok  	github.com/cilium/statedb/index	1.015s
ok  	github.com/cilium/statedb/internal	1.035s
ok  	github.com/cilium/statedb/lpm	2.814s
ok  	github.com/cilium/statedb/part	37.126s
ok  	github.com/cilium/statedb/reconciler	1.467s
?   	github.com/cilium/statedb/reconciler/benchmark	[no test files]
?   	github.com/cilium/statedb/reconciler/example	[no test files]
go test ./... -bench . -benchmem -test.run xxx
goos: linux
goarch: amd64
pkg: github.com/cilium/statedb
cpu: AMD EPYC 7763 64-Core Processor                
BenchmarkDB_WriteTxn_1-4                      	  688380	      1668 ns/op	    599447 objects/sec	    1000 B/op	      16 allocs/op
BenchmarkDB_WriteTxn_10-4                     	 1701726	       746.8 ns/op	   1339020 objects/sec	     520 B/op	       8 allocs/op
BenchmarkDB_WriteTxn_100-4                    	 2024965	       600.1 ns/op	   1666430 objects/sec	     536 B/op	       7 allocs/op
BenchmarkDB_WriteTxn_1000-4                   	 1730335	       685.9 ns/op	   1457845 objects/sec	     522 B/op	       7 allocs/op
BenchmarkDB_WriteTxn_100_SecondaryIndex-4     	  768018	      1382 ns/op	    723762 objects/sec	    1100 B/op	      20 allocs/op
BenchmarkDB_WriteTxn_CommitOnly_100Tables-4   	 1000000	      1184 ns/op	    1112 B/op	       5 allocs/op
BenchmarkDB_WriteTxn_CommitOnly_1Table-4      	 1595695	       750.5 ns/op	     224 B/op	       5 allocs/op
BenchmarkDB_NewWriteTxn-4                     	 1753281	       686.0 ns/op	     200 B/op	       4 allocs/op
BenchmarkDB_WriteTxnCommit100-4               	 1000000	      1169 ns/op	    1096 B/op	       5 allocs/op
BenchmarkDB_NewReadTxn-4                      	542181852	         2.185 ns/op	       0 B/op	       0 allocs/op
BenchmarkDB_Modify-4                          	    1596	    741608 ns/op	   1348422 objects/sec	  546079 B/op	    8094 allocs/op
BenchmarkDB_GetInsert-4                       	    1459	    813893 ns/op	   1228662 objects/sec	  530071 B/op	    8094 allocs/op
BenchmarkDB_RandomInsert-4                    	    1668	    699909 ns/op	   1428758 objects/sec	  522019 B/op	    7094 allocs/op
BenchmarkDB_RandomReplace-4                   	     426	   2812266 ns/op	    355585 objects/sec	 2073405 B/op	   29146 allocs/op
BenchmarkDB_SequentialInsert-4                	    1759	    684694 ns/op	   1460507 objects/sec	  522024 B/op	    7094 allocs/op
BenchmarkDB_SequentialInsert_Prefix-4         	     477	   2491844 ns/op	    401309 objects/sec	 3563956 B/op	   45542 allocs/op
BenchmarkDB_Changes_Baseline-4                	    1477	    808416 ns/op	   1236988 objects/sec	  582203 B/op	    9185 allocs/op
BenchmarkDB_Changes-4                         	     908	   1321806 ns/op	    756540 objects/sec	  783719 B/op	   12336 allocs/op
BenchmarkDB_RandomLookup-4                    	   22080	     54412 ns/op	  18378221 objects/sec	       0 B/op	       0 allocs/op
BenchmarkDB_SequentialLookup-4                	   26688	     44918 ns/op	  22262859 objects/sec	       0 B/op	       0 allocs/op
BenchmarkDB_Prefix_SecondaryIndex-4           	    6903	    164861 ns/op	   6065732 objects/sec	  124920 B/op	    1025 allocs/op
BenchmarkDB_FullIteration_All-4               	     770	   1416419 ns/op	  70600575 objects/sec	     104 B/op	       4 allocs/op
BenchmarkDB_FullIteration_Prefix-4            	     946	   1427092 ns/op	  70072572 objects/sec	     136 B/op	       5 allocs/op
BenchmarkDB_FullIteration_Get-4               	     214	   5562709 ns/op	  17976853 objects/sec	       0 B/op	       0 allocs/op
BenchmarkDB_FullIteration_Get_Secondary-4     	      90	  12580687 ns/op	   7948692 objects/sec	       0 B/op	       0 allocs/op
BenchmarkDB_FullIteration_ReadTxnGet-4        	     207	   5741349 ns/op	  17417510 objects/sec	       0 B/op	       0 allocs/op
BenchmarkDB_PropagationDelay-4                	  640850	      1755 ns/op	        14.00 50th_µs	        20.00 90th_µs	        48.00 99th_µs	    1120 B/op	      19 allocs/op
BenchmarkDB_WriteTxn_100_LPMIndex-4           	  473667	      2433 ns/op	    410983 objects/sec	    1825 B/op	      37 allocs/op
BenchmarkDB_WriteTxn_1_LPMIndex-4             	  130275	     14203 ns/op	     70408 objects/sec	   15746 B/op	      81 allocs/op
BenchmarkDB_LPMIndex_Get-4                    	     410	   2920969 ns/op	   3423522 objects/sec	       0 B/op	       0 allocs/op
BenchmarkWatchSet_4-4                         	 2245932	       530.4 ns/op	     296 B/op	       4 allocs/op
BenchmarkWatchSet_16-4                        	  684012	      1578 ns/op	    1096 B/op	       5 allocs/op
BenchmarkWatchSet_128-4                       	   87069	     13864 ns/op	    8904 B/op	       5 allocs/op
BenchmarkWatchSet_1024-4                      	    8356	    137841 ns/op	   73743 B/op	       5 allocs/op
PASS
ok  	github.com/cilium/statedb	43.760s
PASS
ok  	github.com/cilium/statedb/index	0.004s
goos: linux
goarch: amd64
pkg: github.com/cilium/statedb/internal
cpu: AMD EPYC 7763 64-Core Processor                
Benchmark_SortableMutex-4   	 6200728	       193.1 ns/op	       0 B/op	       0 allocs/op
PASS
ok  	github.com/cilium/statedb/internal	1.202s
goos: linux
goarch: amd64
pkg: github.com/cilium/statedb/lpm
cpu: AMD EPYC 7763 64-Core Processor                
Benchmark_txn_insert/batchSize=1-4         	    1869	    645556 ns/op	   1549051 objects/sec	  838409 B/op	   13975 allocs/op
Benchmark_txn_insert/batchSize=10-4        	    3010	    397073 ns/op	   2518427 objects/sec	  385195 B/op	    6668 allocs/op
Benchmark_txn_insert/batchSize=100-4       	    3183	    373736 ns/op	   2675688 objects/sec	  345613 B/op	    6027 allocs/op
Benchmark_txn_delete/batchSize=1-4         	    1568	    769851 ns/op	   1298953 objects/sec	 1286469 B/op	   13976 allocs/op
Benchmark_txn_delete/batchSize=10-4        	    3078	    382486 ns/op	   2614473 objects/sec	  372418 B/op	    5769 allocs/op
Benchmark_txn_delete/batchSize=100-4       	    3529	    342475 ns/op	   2919925 objects/sec	  286753 B/op	    5038 allocs/op
Benchmark_LPM_Lookup-4                     	    7804	    152402 ns/op	   6561586 objects/sec	       0 B/op	       0 allocs/op
Benchmark_LPM_All-4                        	  133976	      8986 ns/op	 111279218 objects/sec	      32 B/op	       1 allocs/op
Benchmark_LPM_Prefix-4                     	  133322	      9108 ns/op	 109791848 objects/sec	      32 B/op	       1 allocs/op
Benchmark_LPM_LowerBound-4                 	  244107	      4849 ns/op	 103116632 objects/sec	     288 B/op	       2 allocs/op
PASS
ok  	github.com/cilium/statedb/lpm	11.988s
goos: linux
goarch: amd64
pkg: github.com/cilium/statedb/part
cpu: AMD EPYC 7763 64-Core Processor                
Benchmark_Uint64Map_Random-4                  	    1534	    740649 ns/op	   1350167 items/sec	 2524858 B/op	    6031 allocs/op
Benchmark_Uint64Map_Sequential-4              	    1903	    621802 ns/op	   1608229 items/sec	 2216725 B/op	    5754 allocs/op
Benchmark_Uint64Map_Sequential_Insert-4       	    2157	    562320 ns/op	   1778346 items/sec	 2208720 B/op	    4753 allocs/op
Benchmark_Uint64Map_Sequential_Txn_Insert-4   	   10000	    101835 ns/op	   9819849 items/sec	   86352 B/op	    2028 allocs/op
Benchmark_Uint64Map_Random_Insert-4           	    1794	    674347 ns/op	   1482915 items/sec	 2521570 B/op	    5055 allocs/op
Benchmark_Uint64Map_Random_Txn_Insert-4       	    7309	    169352 ns/op	   5904846 items/sec	  120417 B/op	    2425 allocs/op
Benchmark_Insert_RootOnlyWatch-4              	   10000	    110275 ns/op	   9068275 objects/sec	   71504 B/op	    2033 allocs/op
Benchmark_Insert-4                            	    7885	    154492 ns/op	   6472824 objects/sec	  186937 B/op	    3060 allocs/op
Benchmark_Modify-4                            	   12404	     96586 ns/op	  10353444 objects/sec	   58224 B/op	    1007 allocs/op
Benchmark_GetInsert-4                         	    9307	    127047 ns/op	   7871115 objects/sec	   58224 B/op	    1007 allocs/op
Benchmark_Replace-4                           	31945753	        37.07 ns/op	  26978710 objects/sec	       0 B/op	       0 allocs/op
Benchmark_Replace_RootOnlyWatch-4             	31936137	        37.39 ns/op	  26747532 objects/sec	       0 B/op	       0 allocs/op
Benchmark_txn_1-4                             	 6164982	       192.9 ns/op	   5184514 objects/sec	     168 B/op	       3 allocs/op
Benchmark_txn_10-4                            	10079758	       118.6 ns/op	   8435006 objects/sec	      86 B/op	       2 allocs/op
Benchmark_txn_100-4                           	11851177	       100.8 ns/op	   9923743 objects/sec	      80 B/op	       2 allocs/op
Benchmark_txn_1000-4                          	10303004	       116.2 ns/op	   8607900 objects/sec	      65 B/op	       2 allocs/op
Benchmark_txn_delete_1-4                      	 4862599	       246.7 ns/op	   4053990 objects/sec	     664 B/op	       4 allocs/op
Benchmark_txn_delete_10-4                     	11325169	       106.4 ns/op	   9395033 objects/sec	     106 B/op	       1 allocs/op
Benchmark_txn_delete_100-4                    	12310760	        96.29 ns/op	  10385120 objects/sec	      47 B/op	       1 allocs/op
Benchmark_txn_delete_1000-4                   	14694666	        80.61 ns/op	  12405343 objects/sec	      24 B/op	       1 allocs/op
Benchmark_Get-4                               	   45262	     26476 ns/op	  37770403 objects/sec	       0 B/op	       0 allocs/op
Benchmark_All-4                               	  118689	     10469 ns/op	  95523648 objects/sec	       0 B/op	       0 allocs/op
Benchmark_Iterator_All-4                      	  151534	      9827 ns/op	 101758444 objects/sec	       0 B/op	       0 allocs/op
Benchmark_Iterator_Next-4                     	  162255	      7339 ns/op	 136249115 objects/sec	     896 B/op	       1 allocs/op
Benchmark_Hashmap_Insert-4                    	   14812	     81759 ns/op	  12231039 objects/sec	   74264 B/op	      20 allocs/op
Benchmark_Hashmap_Get_Uint64-4                	  134274	      8895 ns/op	 112426122 objects/sec	       0 B/op	       0 allocs/op
Benchmark_Hashmap_Get_Bytes-4                 	  110624	     10828 ns/op	  92349020 objects/sec	       0 B/op	       0 allocs/op
Benchmark_Delete_Random-4                     	      76	  16398530 ns/op	   6098107 objects/sec	 2111877 B/op	  102364 allocs/op
Benchmark_find16-4                            	202276813	         5.933 ns/op	       0 B/op	       0 allocs/op
Benchmark_findIndex16-4                       	114781382	        10.41 ns/op	       0 B/op	       0 allocs/op
Benchmark_find48-4                            	384881599	         3.118 ns/op	       0 B/op	       0 allocs/op
Benchmark_findIndex48_hit-4                   	427822384	         2.804 ns/op	       0 B/op	       0 allocs/op
Benchmark_findIndex48_miss-4                  	384246615	         3.116 ns/op	       0 B/op	       0 allocs/op
Benchmark_find4-4                             	424725136	         2.826 ns/op	       0 B/op	       0 allocs/op
Benchmark_findIndex4-4                        	321339934	         3.737 ns/op	       0 B/op	       0 allocs/op
PASS
ok  	github.com/cilium/statedb/part	43.340s
PASS
ok  	github.com/cilium/statedb/reconciler	0.005s
?   	github.com/cilium/statedb/reconciler/benchmark	[no test files]
?   	github.com/cilium/statedb/reconciler/example	[no test files]
go run ./reconciler/benchmark -quiet
1000000 objects reconciled in 1.94 seconds (batch size 1000)
Throughput 515971.16 objects per second
888MB total allocated, 6015163 in-use objects, 338MB bytes in use

@tklauser
Copy link
Copy Markdown
Member Author

Looks like there were some non-breaking spaces in the change. Should now be fixed.

However, the workflow on this PR will still use the workflow file from main where permissions are not set thus it will still fail. Adding pull_request_target in a temporary commit didn't help for some reason 😕

Nevermind, looks like pull_request_target wasn't necessary after all and the workflow passed with the comment being posted again.

@joamaki ok to merge?

@joamaki joamaki merged commit 3c6df79 into main Mar 13, 2026
1 check passed
@joamaki joamaki deleted the pr/tklauser/ci-pr-write-permissions branch March 13, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants