Skip to content

perf(github): cache check-run lookups with retry#2669

Open
theakshaypant wants to merge 2 commits intotektoncd:mainfrom
theakshaypant:perf/cache-check-runs
Open

perf(github): cache check-run lookups with retry#2669
theakshaypant wants to merge 2 commits intotektoncd:mainfrom
theakshaypant:perf/cache-check-runs

Conversation

@theakshaypant
Copy link
Copy Markdown
Member

@theakshaypant theakshaypant commented Apr 9, 2026

📝 Description of the Change

Cache GitHub check-run API responses to avoid repeated
paginated API calls during status updates. Use a mutex+channel
pattern so concurrent goroutines share a single in-flight fetch.
Failed fetches are not cached, allowing retries with exponential
backoff on transient API errors.

🔗 Linked GitHub Issue

Partial #2379

🧪 Testing Strategy

  • Unit tests
  • Integration tests
  • End-to-end tests
  • Manual testing
  • Not Applicable

Doing an analysis of the ghe e2e test suite, no duplicate list_check_runs call remains

All duplicate API calls remaining
source_file event_id event_sha event_type timestamp namespace pr source_branch target_branch source_repo_url organization repository controller_label provider operation duration_ms url_path rate_limit_remaining status_code github_request_id total_calls_in_event call_index url_call_count is_duplicate
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 0a20b9f0-33ff-11f1-9c58-4fe440ce86a3 38a8e6cc9f3bc349909684e1b150e089b0bf88b2 pull_request 2026-04-09T10:29:51.072Z pac-e2e-ns-cjtmt   pac-e2e-test-g2lc8 main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 371 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 8ce1a8f5-aef9-4512-9c53-9cbac738c6c6 9 6 2 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 0a20b9f0-33ff-11f1-9c58-4fe440ce86a3 38a8e6cc9f3bc349909684e1b150e089b0bf88b2 pull_request 2026-04-09T10:29:51.072Z pac-e2e-ns-cjtmt   pac-e2e-test-g2lc8 main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 438 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 87d28af4-a6da-4982-ad06-d0f73e32838e 9 7 2 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 356032d0-33ff-11f1-8db6-5ae365cdf224 295f81894ad8a42067186b97664e5ae2af268500 pull_request 2026-04-09T10:31:03.571Z pac-e2e-ns-bj2jz   pac-e2e-test-h878j main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 246 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 2a7076ac-3ce9-47b8-bcaf-67254d7c8d32 9 6 2 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 356032d0-33ff-11f1-8db6-5ae365cdf224 295f81894ad8a42067186b97664e5ae2af268500 pull_request 2026-04-09T10:31:03.571Z pac-e2e-ns-bj2jz   pac-e2e-test-h878j main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 252 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 03664f10-4f92-4c8b-affa-8961956440a8 9 7 2 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 39bc2f60-33fe-11f1-9934-e38559f26b1e 865a824c7f3ccf5ce89684e89b023b902926370a pull_request 2026-04-09T10:24:03.593Z pac-e2e-ns-vwlc5   pac-e2e-test-ljbtf main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 387 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 d4662dcd-7179-4c69-be97-fadaaf512a9e 15 6 5 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 39bc2f60-33fe-11f1-9934-e38559f26b1e 865a824c7f3ccf5ce89684e89b023b902926370a pull_request 2026-04-09T10:24:03.593Z pac-e2e-ns-vwlc5   pac-e2e-test-ljbtf main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 414 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 9ce089a2-8832-4fcf-bccd-3128370c4ad7 15 7 5 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 39bc2f60-33fe-11f1-9934-e38559f26b1e 865a824c7f3ccf5ce89684e89b023b902926370a pull_request 2026-04-09T10:24:03.593Z pac-e2e-ns-vwlc5   pac-e2e-test-ljbtf main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 423 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 cc892d86-f180-4e5d-8381-edf0df10c7f4 15 8 5 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 39bc2f60-33fe-11f1-9934-e38559f26b1e 865a824c7f3ccf5ce89684e89b023b902926370a pull_request 2026-04-09T10:24:03.593Z pac-e2e-ns-vwlc5   pac-e2e-test-ljbtf main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 544 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 f8a8c82a-a8a4-467f-b03e-52957e41abe9 15 9 5 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 39bc2f60-33fe-11f1-9934-e38559f26b1e 865a824c7f3ccf5ce89684e89b023b902926370a pull_request 2026-04-09T10:24:03.593Z pac-e2e-ns-vwlc5   pac-e2e-test-ljbtf main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 584 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 87851779-cfcd-4d82-88f8-6c640cb2a310 15 10 5 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 77806910-33fe-11f1-8a2e-0aa39c2b0de4 83ffc6491835a8fe53b98fe992f42f03cbfeeb0f pull_request 2026-04-09T10:25:45.714Z pac-e2e-ns-cfvpw   pac-e2e-test-plq86 main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 190 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 98a2ac65-4f97-4b6f-b873-adc7dd004605 9 6 2 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 77806910-33fe-11f1-8a2e-0aa39c2b0de4 83ffc6491835a8fe53b98fe992f42f03cbfeeb0f pull_request 2026-04-09T10:25:45.714Z pac-e2e-ns-cfvpw   pac-e2e-test-plq86 main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 210 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 70417a60-d59c-4b94-9286-8da47b1328f3 9 7 2 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 8924bf80-33ff-11f1-8b22-e7c7aeaf36f4 621bde7b838e4bed02cc012a38c8efc5e38895e1 pull_request 2026-04-09T10:33:23.984Z pac-e2e-ns-mphp6   pac-e2e-test-5vnxb main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 210 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 8d10c81c-643a-426a-a049-0bf11078ab24 9 6 2 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 8924bf80-33ff-11f1-8b22-e7c7aeaf36f4 621bde7b838e4bed02cc012a38c8efc5e38895e1 pull_request 2026-04-09T10:33:23.984Z pac-e2e-ns-mphp6   pac-e2e-test-5vnxb main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 231 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 f624bc5a-daad-437c-8325-06264736b6ec 9 7 2 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 90677dc0-33fd-11f1-8e99-bd24769aab18 b36bbe5ad9ca968f24deb2ab4308248f5fa8f621 pull_request 2026-04-09T10:19:17.655Z pac-e2e-ns-kmv22   pac-e2e-test-p6hcv main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 686 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 63f2df89-855a-445a-ae63-4695003a8fe3 11 6 3 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 90677dc0-33fd-11f1-8e99-bd24769aab18 b36bbe5ad9ca968f24deb2ab4308248f5fa8f621 pull_request 2026-04-09T10:19:17.655Z pac-e2e-ns-kmv22   pac-e2e-test-p6hcv main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 745 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 df84f03b-b471-4c93-b334-9f2ad02b5d78 11 7 3 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 90677dc0-33fd-11f1-8e99-bd24769aab18 b36bbe5ad9ca968f24deb2ab4308248f5fa8f621 pull_request 2026-04-09T10:19:17.655Z pac-e2e-ns-kmv22   pac-e2e-test-p6hcv main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 865 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 42f56855-6842-448e-8165-a298c01e86e7 11 8 3 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 91f1c740-33fd-11f1-9d21-e5411c716a44 2c049473641e0a7f5355a28aeab533b8c4cca028 pull_request 2026-04-09T10:19:21.726Z pac-e2e-ns-kmv22   pac-e2e-test-75rrn main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 1124 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 7d6b9a6c-e960-4ad4-a438-7d633d4dc1d9 11 6 3 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 91f1c740-33fd-11f1-9d21-e5411c716a44 2c049473641e0a7f5355a28aeab533b8c4cca028 pull_request 2026-04-09T10:19:21.726Z pac-e2e-ns-kmv22   pac-e2e-test-75rrn main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 1315 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 42cd4ce9-04f0-4e10-8be5-cf50e4597b9a 11 7 3 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 91f1c740-33fd-11f1-9d21-e5411c716a44 2c049473641e0a7f5355a28aeab533b8c4cca028 pull_request 2026-04-09T10:19:21.726Z pac-e2e-ns-kmv22   pac-e2e-test-75rrn main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 1583 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 90eb6fb1-b0a6-40b5-983b-23f0bab8abf3 11 8 3 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 95f219d0-33fd-11f1-8869-0224964462bd 58c404ef669a32bec1e287a2e64199f1dbeb363b pull_request 2026-04-09T10:19:28.593Z pac-e2e-ns-kmv22   pac-e2e-test-q8hzg main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 1492 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 e2f74e69-956b-4709-acd6-c6bc3b0d4c37 11 6 3 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 95f219d0-33fd-11f1-8869-0224964462bd 58c404ef669a32bec1e287a2e64199f1dbeb363b pull_request 2026-04-09T10:19:28.593Z pac-e2e-ns-kmv22   pac-e2e-test-q8hzg main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 1593 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 d5627a42-7bc9-4a4a-b19d-245bee8a69f1 11 7 3 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 95f219d0-33fd-11f1-8869-0224964462bd 58c404ef669a32bec1e287a2e64199f1dbeb363b pull_request 2026-04-09T10:19:28.593Z pac-e2e-ns-kmv22   pac-e2e-test-q8hzg main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 1624 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 72c7c22b-bd4a-4417-af47-f64ff199c1e1 11 8 3 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 971dc890-33fd-11f1-857b-4f2766d6c3ec b36bbe5ad9ca968f24deb2ab4308248f5fa8f621 retest-all-comment 2026-04-09T10:19:30.083Z pac-e2e-ns-kmv22   pac-e2e-test-p6hcv main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 869 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 f6234563-9cc0-43a4-bd29-6c639a434e99 10 7 2 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 971dc890-33fd-11f1-857b-4f2766d6c3ec b36bbe5ad9ca968f24deb2ab4308248f5fa8f621 retest-all-comment 2026-04-09T10:19:30.083Z pac-e2e-ns-kmv22   pac-e2e-test-p6hcv main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 1344 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 6a4bbc66-2a5b-4281-b6b4-0d424f2ced56 10 8 2 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 97d00190-33fd-11f1-9dd7-583a64d03acd 2c049473641e0a7f5355a28aeab533b8c4cca028 retest-all-comment 2026-04-09T10:19:32.778Z pac-e2e-ns-kmv22   pac-e2e-test-75rrn main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 792 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 461df717-2c42-4239-bf8e-e72061ee149a 12 7 3 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 97d00190-33fd-11f1-9dd7-583a64d03acd 2c049473641e0a7f5355a28aeab533b8c4cca028 retest-all-comment 2026-04-09T10:19:32.778Z pac-e2e-ns-kmv22   pac-e2e-test-75rrn main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 872 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 e13fbb3a-26e1-457d-a43f-8e94abd5ec99 12 8 3 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 97d00190-33fd-11f1-9dd7-583a64d03acd 2c049473641e0a7f5355a28aeab533b8c4cca028 retest-all-comment 2026-04-09T10:19:32.778Z pac-e2e-ns-kmv22   pac-e2e-test-75rrn main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 905 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 d3f030ad-484a-4088-a855-01e3c0ab30e0 12 9 3 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 995960b0-33fd-11f1-9553-5002030eac25 58c404ef669a32bec1e287a2e64199f1dbeb363b retest-all-comment 2026-04-09T10:19:35.382Z pac-e2e-ns-kmv22   pac-e2e-test-q8hzg main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 644 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 cc5a8c0c-b97a-4b9c-86d3-077d03afa6ef 12 7 3 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 995960b0-33fd-11f1-9553-5002030eac25 58c404ef669a32bec1e287a2e64199f1dbeb363b retest-all-comment 2026-04-09T10:19:35.382Z pac-e2e-ns-kmv22   pac-e2e-test-q8hzg main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 689 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 7dbe5551-1d23-4435-8375-f16e15494779 12 8 3 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 995960b0-33fd-11f1-9553-5002030eac25 58c404ef669a32bec1e287a2e64199f1dbeb363b retest-all-comment 2026-04-09T10:19:35.382Z pac-e2e-ns-kmv22   pac-e2e-test-q8hzg main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 718 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 bdafe520-00fa-4518-96a3-06ed87d43d31 12 9 3 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 9acfb790-33fe-11f1-89c7-b4faec69f0ab e9b7c4122e166113f9ac6d1912b7cccc4221a162 pull_request 2026-04-09T10:26:44.244Z pac-e2e-ns-xz526   pac-e2e-test-p9n5h main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 307 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 49bd28ef-8879-4695-8d23-51febee3ea87 25 6 10 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 9acfb790-33fe-11f1-89c7-b4faec69f0ab e9b7c4122e166113f9ac6d1912b7cccc4221a162 pull_request 2026-04-09T10:26:44.244Z pac-e2e-ns-xz526   pac-e2e-test-p9n5h main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 393 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 4e973cbd-4bf3-46e7-b88f-47bf97e24e76 25 7 10 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 9acfb790-33fe-11f1-89c7-b4faec69f0ab e9b7c4122e166113f9ac6d1912b7cccc4221a162 pull_request 2026-04-09T10:26:44.244Z pac-e2e-ns-xz526   pac-e2e-test-p9n5h main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 397 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 c20f06ef-baa7-454c-a2eb-4891721c123a 25 8 10 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 9acfb790-33fe-11f1-89c7-b4faec69f0ab e9b7c4122e166113f9ac6d1912b7cccc4221a162 pull_request 2026-04-09T10:26:44.244Z pac-e2e-ns-xz526   pac-e2e-test-p9n5h main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 416 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 88c06c55-3128-44bd-9485-829c0125c644 25 9 10 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 9acfb790-33fe-11f1-89c7-b4faec69f0ab e9b7c4122e166113f9ac6d1912b7cccc4221a162 pull_request 2026-04-09T10:26:44.244Z pac-e2e-ns-xz526   pac-e2e-test-p9n5h main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 442 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 637d7f1e-f65d-48dd-805c-7151724bd069 25 10 10 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 9acfb790-33fe-11f1-89c7-b4faec69f0ab e9b7c4122e166113f9ac6d1912b7cccc4221a162 pull_request 2026-04-09T10:26:44.244Z pac-e2e-ns-xz526   pac-e2e-test-p9n5h main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 672 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 2f5bd91a-bc24-4d6c-be10-3f09f88f8416 25 11 10 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 9acfb790-33fe-11f1-89c7-b4faec69f0ab e9b7c4122e166113f9ac6d1912b7cccc4221a162 pull_request 2026-04-09T10:26:44.244Z pac-e2e-ns-xz526   pac-e2e-test-p9n5h main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 696 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 2a075189-b474-4a6b-b062-2b612baeaf47 25 12 10 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 9acfb790-33fe-11f1-89c7-b4faec69f0ab e9b7c4122e166113f9ac6d1912b7cccc4221a162 pull_request 2026-04-09T10:26:44.244Z pac-e2e-ns-xz526   pac-e2e-test-p9n5h main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 753 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 6e55bdd3-b98a-4a3a-98b5-ebc09ec01bfa 25 13 10 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 9acfb790-33fe-11f1-89c7-b4faec69f0ab e9b7c4122e166113f9ac6d1912b7cccc4221a162 pull_request 2026-04-09T10:26:44.244Z pac-e2e-ns-xz526   pac-e2e-test-p9n5h main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 977 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 977f128d-ef0c-4315-b40d-463a4589ca09 25 14 10 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log 9acfb790-33fe-11f1-89c7-b4faec69f0ab e9b7c4122e166113f9ac6d1912b7cccc4221a162 pull_request 2026-04-09T10:26:44.244Z pac-e2e-ns-xz526   pac-e2e-test-p9n5h main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 995 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 94b66ce9-93ac-4c4c-bf19-edcb2d51c945 25 16 10 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log cb5633d0-33fe-11f1-947c-fe7b3a6d6fd2 40cb2a2b23fdaba43dc8b2e1ca72aae8093f094e pull_request 2026-04-09T10:28:05.967Z pac-e2e-ns-qvn8g   pac-e2e-test-svgng main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 387 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 13cb8226-5893-41e3-862e-4411ed590337 8 6 2 True
ghe-controller-6c5d49dbdf-f6v46_pipelines-as-code_ghe-controller-a72d3ba5bbf82bc9796b6b5e5d8af43cf2c99aed917b6db372de161194dcc435.log cb5633d0-33fe-11f1-947c-fe7b3a6d6fd2 40cb2a2b23fdaba43dc8b2e1ca72aae8093f094e pull_request 2026-04-09T10:28:05.967Z pac-e2e-ns-qvn8g   pac-e2e-test-svgng main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 391 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 bf96a4c4-bffd-4dbd-ab27-c00610b3b2c6 8 7 2 True
source_file event_id event_sha event_type timestamp namespace pr source_branch target_branch source_repo_url organization repository controller_label provider operation duration_ms url_path rate_limit_remaining status_code github_request_id total_calls_in_event call_index url_call_count is_duplicate
ghe-controller-6c5d49dbdf-5rfqz_pipelines-as-code_ghe-controller-5bb275f7f66f22cb0b702ea7d00da5b9784a800bb197cc7cd7c7dd4a49d4b3d2.log 21f01d10-33fe-11f1-9d01-2318e6d4f745 9534c9b153b429a2da245a582e4e1b2401d9507f pull_request 2026-04-09T10:23:21.836Z pac-e2e-ns-s854z   pac-e2e-test-gjmxb main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 196 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 05f6a41a-a356-4309-a527-53ee6e69a0c4 8 6 2 True
ghe-controller-6c5d49dbdf-5rfqz_pipelines-as-code_ghe-controller-5bb275f7f66f22cb0b702ea7d00da5b9784a800bb197cc7cd7c7dd4a49d4b3d2.log 21f01d10-33fe-11f1-9d01-2318e6d4f745 9534c9b153b429a2da245a582e4e1b2401d9507f pull_request 2026-04-09T10:23:21.836Z pac-e2e-ns-s854z   pac-e2e-test-gjmxb main https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 212 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 311f662c-0201-485c-b50a-43aeeb1123af 8 7 2 True
ghe-controller-6c5d49dbdf-5rfqz_pipelines-as-code_ghe-controller-5bb275f7f66f22cb0b702ea7d00da5b9784a800bb197cc7cd7c7dd4a49d4b3d2.log 5a6599a4-33fe-11f1-80ef-e3c74c48a421 7c4c34eb56f4542b1568e50922caa07ac861c49a push 2026-04-09T10:24:56.877Z pac-e2e-push-sxdc8     refs/heads/pac-e2e-push-sxdc8 https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 188 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 56eb3657-f479-4960-b4f1-ce8840f1cbdf 9 6 2 True
ghe-controller-6c5d49dbdf-5rfqz_pipelines-as-code_ghe-controller-5bb275f7f66f22cb0b702ea7d00da5b9784a800bb197cc7cd7c7dd4a49d4b3d2.log 5a6599a4-33fe-11f1-80ef-e3c74c48a421 7c4c34eb56f4542b1568e50922caa07ac861c49a push 2026-04-09T10:24:56.877Z pac-e2e-push-sxdc8     refs/heads/pac-e2e-push-sxdc8 https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 198 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 6b50d714-f62c-4e7f-83f5-2a4215536ee5 9 7 2 True
ghe-controller-6c5d49dbdf-5rfqz_pipelines-as-code_ghe-controller-5bb275f7f66f22cb0b702ea7d00da5b9784a800bb197cc7cd7c7dd4a49d4b3d2.log 73cd2510-33fe-11f1-83a8-f3430e1b7ca4 7c4c34eb56f4542b1568e50922caa07ac861c49a retest-comment 2026-04-09T10:25:38.989Z pac-e2e-push-sxdc8     pac-e2e-push-sxdc8 https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 186 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 c6a3ad3c-fd4c-4939-a76e-d9ab133d06d1 11 8 2 True
ghe-controller-6c5d49dbdf-5rfqz_pipelines-as-code_ghe-controller-5bb275f7f66f22cb0b702ea7d00da5b9784a800bb197cc7cd7c7dd4a49d4b3d2.log 73cd2510-33fe-11f1-83a8-f3430e1b7ca4 7c4c34eb56f4542b1568e50922caa07ac861c49a retest-comment 2026-04-09T10:25:38.989Z pac-e2e-push-sxdc8     pac-e2e-push-sxdc8 https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 190 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 7aa24e4b-4202-414e-b96f-49fd2bf21fc4 11 9 2 True
ghe-controller-6c5d49dbdf-5rfqz_pipelines-as-code_ghe-controller-5bb275f7f66f22cb0b702ea7d00da5b9784a800bb197cc7cd7c7dd4a49d4b3d2.log 8f7159b2-33fe-11f1-81a9-e4659c32cf36 2bcb3c0e4fcf81456cd667b96dc1720b380c2547 push 2026-04-09T10:26:25.581Z pac-e2e-push-lsxd7     refs/heads/pac-e2e-push-lsxd7 https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 229 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 cdcec481-fc00-4409-af2c-c5b5e4bfd6e4 9 6 2 True
ghe-controller-6c5d49dbdf-5rfqz_pipelines-as-code_ghe-controller-5bb275f7f66f22cb0b702ea7d00da5b9784a800bb197cc7cd7c7dd4a49d4b3d2.log 8f7159b2-33fe-11f1-81a9-e4659c32cf36 2bcb3c0e4fcf81456cd667b96dc1720b380c2547 push 2026-04-09T10:26:25.581Z pac-e2e-push-lsxd7     refs/heads/pac-e2e-push-lsxd7 https://ghe.pipelinesascode.com/pipelines-as-code/e2e       github create_check_run 245 /api/v3/repos/pipelines-as-code/e2e/check-runs   201 ee926e4e-c00b-45a3-a7c6-80ae93b7af95 9 7 2 True
ghe-controller-6c5d49dbdf-5rfqz_pipelines-as-code_ghe-controller-5bb275f7f66f22cb0b702ea7d00da5b9784a800bb197cc7cd7c7dd4a49d4b3d2.log b71dec10-33fd-11f1-8d41-f4294791ce59 4efed6a38d40b1cfd2a77a736bf73a383bb9e749 pull_request 2026-04-09T10:20:22.836Z pac-e2e-ns-hd72t   pac-e2e-test-kvkpt main https://ghe.pipelinesascode.com/pac-e2e-webhook-tests/pac-e2e-test-5c5s5       github create_status 233 /api/v3/repos/pac-e2e-webhook-tests/pac-e2e-test-5c5s5/statuses/4efed6a38d40b1cfd2a77a736bf73a383bb9e749   201 781d2ca7-a3ae-46a7-9306-5e7859863781 6 5 2 True
ghe-controller-6c5d49dbdf-5rfqz_pipelines-as-code_ghe-controller-5bb275f7f66f22cb0b702ea7d00da5b9784a800bb197cc7cd7c7dd4a49d4b3d2.log b71dec10-33fd-11f1-8d41-f4294791ce59 4efed6a38d40b1cfd2a77a736bf73a383bb9e749 pull_request 2026-04-09T10:20:22.836Z pac-e2e-ns-hd72t   pac-e2e-test-kvkpt main https://ghe.pipelinesascode.com/pac-e2e-webhook-tests/pac-e2e-test-5c5s5       github create_status 278 /api/v3/repos/pac-e2e-webhook-tests/pac-e2e-test-5c5s5/statuses/4efed6a38d40b1cfd2a77a736bf73a383bb9e749   201 3e1450bf-83d1-4528-9e55-2b696a74fd7e 6 6 2 True
ghe-controller-6c5d49dbdf-5rfqz_pipelines-as-code_ghe-controller-5bb275f7f66f22cb0b702ea7d00da5b9784a800bb197cc7cd7c7dd4a49d4b3d2.log c32a2e60-33fd-11f1-96d6-4ca82c76fe82 1370b9750d7352b20bc61a82a71ca31c869683b7 pull_request 2026-04-09T10:20:42.576Z pac-e2e-ns-hd72t   pac-e2e-test-kvkpt main https://ghe.pipelinesascode.com/pac-e2e-webhook-tests/pac-e2e-test-5c5s5       github create_status 493 /api/v3/repos/pac-e2e-webhook-tests/pac-e2e-test-5c5s5/statuses/1370b9750d7352b20bc61a82a71ca31c869683b7   201 cd46c0a2-c3d2-4bdc-a603-b1068534bf1e 6 5 2 True
ghe-controller-6c5d49dbdf-5rfqz_pipelines-as-code_ghe-controller-5bb275f7f66f22cb0b702ea7d00da5b9784a800bb197cc7cd7c7dd4a49d4b3d2.log c32a2e60-33fd-11f1-96d6-4ca82c76fe82 1370b9750d7352b20bc61a82a71ca31c869683b7 pull_request 2026-04-09T10:20:42.576Z pac-e2e-ns-hd72t   pac-e2e-test-kvkpt main https://ghe.pipelinesascode.com/pac-e2e-webhook-tests/pac-e2e-test-5c5s5       github create_status 518 /api/v3/repos/pac-e2e-webhook-tests/pac-e2e-test-5c5s5/statuses/1370b9750d7352b20bc61a82a71ca31c869683b7   201 dee9eeb8-ce33-45e0-8795-c8c577c52a4b 6 6 2 True
ghe-controller-6c5d49dbdf-5rfqz_pipelines-as-code_ghe-controller-5bb275f7f66f22cb0b702ea7d00da5b9784a800bb197cc7cd7c7dd4a49d4b3d2.log d1134700-33fd-11f1-808d-5243916c982d 2956a9fd3c20f8786493f264f2f15e1831b71723 pull_request 2026-04-09T10:21:06.235Z pac-e2e-ns-nsxz9   pac-e2e-test-9dt6j main https://ghe.pipelinesascode.com/pac-e2e-webhook-tests/pac-e2e-test-fn2fq       github create_status 768 /api/v3/repos/pac-e2e-webhook-tests/pac-e2e-test-fn2fq/statuses/2956a9fd3c20f8786493f264f2f15e1831b71723   201 9160964d-1269-44cb-911d-186bb177fac0 6 5 2 True
ghe-controller-6c5d49dbdf-5rfqz_pipelines-as-code_ghe-controller-5bb275f7f66f22cb0b702ea7d00da5b9784a800bb197cc7cd7c7dd4a49d4b3d2.log d1134700-33fd-11f1-808d-5243916c982d 2956a9fd3c20f8786493f264f2f15e1831b71723 pull_request 2026-04-09T10:21:06.235Z pac-e2e-ns-nsxz9   pac-e2e-test-9dt6j main https://ghe.pipelinesascode.com/pac-e2e-webhook-tests/pac-e2e-test-fn2fq       github create_status 854 /api/v3/repos/pac-e2e-webhook-tests/pac-e2e-test-fn2fq/statuses/2956a9fd3c20f8786493f264f2f15e1831b71723   201 b6972cd9-d50e-46e4-b0a4-3353063e19b3 6 6 2 True
ghe-controller-6c5d49dbdf-5rfqz_pipelines-as-code_ghe-controller-5bb275f7f66f22cb0b702ea7d00da5b9784a800bb197cc7cd7c7dd4a49d4b3d2.log e0b35e70-33fd-11f1-8105-179a3b86fe83 22619682eb42bc5f85c2fab5372327481a61b2e7 pull_request 2026-04-09T10:21:32.098Z pac-e2e-ns-nsxz9   pac-e2e-test-9dt6j main https://ghe.pipelinesascode.com/pac-e2e-webhook-tests/pac-e2e-test-fn2fq       github create_status 166 /api/v3/repos/pac-e2e-webhook-tests/pac-e2e-test-fn2fq/statuses/22619682eb42bc5f85c2fab5372327481a61b2e7   201 9bc76c98-710e-42bb-88a8-81625c9ecd24 6 5 2 True
ghe-controller-6c5d49dbdf-5rfqz_pipelines-as-code_ghe-controller-5bb275f7f66f22cb0b702ea7d00da5b9784a800bb197cc7cd7c7dd4a49d4b3d2.log e0b35e70-33fd-11f1-8105-179a3b86fe83 22619682eb42bc5f85c2fab5372327481a61b2e7 pull_request 2026-04-09T10:21:32.098Z pac-e2e-ns-nsxz9   pac-e2e-test-9dt6j main https://ghe.pipelinesascode.com/pac-e2e-webhook-tests/pac-e2e-test-fn2fq       github create_status 171 /api/v3/repos/pac-e2e-webhook-tests/pac-e2e-test-fn2fq/statuses/22619682eb42bc5f85c2fab5372327481a61b2e7   201 7e125df4-cc0f-4ffc-93e7-4d3746c9fd5e 6 6 2 True

🤖 AI Assistance

AI assistance can be used for various tasks, such as code generation,
documentation, or testing.

Please indicate whether you have used AI assistance
for this PR and provide details if applicable.

  • I have not used any AI assistance for this PR.
  • I have used AI assistance for this PR.

Important

Slop will be simply rejected, if you are using AI assistance you need to make sure you
understand the code generated and that it meets the project's standards. you
need at least know how to run the code and deploy it (if needed). See
startpaac to make it easy
to deploy and test your code changes.

If the majority of the code in this PR was generated by an AI, please add a Co-authored-by trailer to your commit message.
For example:

Co-authored-by: Claude noreply@anthropic.com

✅ Submitter Checklist

  • 📝 My commit messages are clear, informative, and follow the project's How to write a git commit message guide. The Gitlint linter ensures in CI it's properly validated
  • ✨ I have ensured my commit message prefix (e.g., fix:, feat:) matches the "Type of Change" I selected above.
  • ♽ I have run make test and make lint locally to check for and fix any
    issues. For an efficient workflow, I have considered installing
    pre-commit and running pre-commit install to
    automate these checks.
  • 📖 I have added or updated documentation for any user-facing changes.
  • 🧪 I have added sufficient unit tests for my code changes.
  • 🎁 I have added end-to-end tests where feasible. See README for more details.
  • 🔎 I have addressed any CI test flakiness or provided a clear reason to bypass it.
  • If adding a provider feature, I have filled in the following and updated the provider documentation:
    • GitHub App
    • GitHub Webhook
    • Gitea/Forgejo
    • GitLab
    • Bitbucket Cloud
    • Bitbucket Data Center

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 9, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 87.77778% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.96%. Comparing base (c9be9d6) to head (f078824).
⚠️ Report is 19 commits behind head on main.

Files with missing lines Patch % Lines
pkg/provider/github/status.go 87.35% 9 Missing and 2 partials ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2669      +/-   ##
==========================================
+ Coverage   58.85%   58.96%   +0.10%     
==========================================
  Files         204      204              
  Lines       20149    20227      +78     
==========================================
+ Hits        11859    11926      +67     
- Misses       7525     7534       +9     
- Partials      765      767       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a caching mechanism for GitHub check runs to reduce the number of API calls made by the provider. It adds a checkRunsCache struct and utilizes sync.Once within getExistingCheckRunID to fetch and store all check run pages. Feedback on the implementation highlights a potential issue where sync.Once will cache transient errors from the initial API call, preventing any future successful attempts for that provider instance. It is recommended to use a sync.Mutex or a similar pattern to avoid caching failed operations.

Comment thread pkg/provider/github/status.go Outdated
Comment on lines +70 to +72
v.checkRunsCache.once.Do(func() {
v.checkRunsCache.runs, v.checkRunsCache.err = v.fetchAllCheckRunPages(ctx, runevent)
})
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

Using sync.Once to cache the result of a fallible operation like an API call can be problematic. If the first call to fetchAllCheckRunPages fails due to a transient error (e.g., network timeout, context cancellation, or temporary GitHub API issue), the error is cached in v.checkRunsCache.err. All subsequent concurrent or future calls to getExistingCheckRunID using this Provider instance will immediately return the cached error without attempting a retry.

Consider using a sync.Mutex to protect the cache and only storing the result if the error is nil, or implementing a mechanism to allow retries for transient errors.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The Provider is created fresh per webhook event and is short-lived. If fetchAllCheckRunPages fails, that would likely affect any immediate retry from the next goroutine too. The mutex just adds complexity to retry into the same failure IMO

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think the main issue is a bit different from provider lifetime across webhooks. Even if the provider is short-lived, we still retry status reporting on the same Provider instance inside the same webhook flow.

So if fetchAllCheckRunPages fails once because of a transient GitHub/API/network issue, sync.Once ends up caching that error and the later retries just return the same cached error without actually calling GitHub again.

Perhaps a mutex-protected cache with a loaded flag that only flips to true after a successful fetch. That keeps the perf win for repeated lookups, but still allows retries after transient GitHub/API failures.

@theakshaypant theakshaypant marked this pull request as ready for review April 9, 2026 11:00
@theakshaypant
Copy link
Copy Markdown
Member Author

Added API calls duplication data in the description showing no duplicate calls to fetch check_runs

Comment thread pkg/provider/github/status.go Outdated
return searchCheckRuns(v.checkRunsCache.runs, status, v), nil
}

func searchCheckRuns(runs []*github.CheckRun, status providerstatus.StatusOpts, v *Provider) *int64 {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why not just attach to Provider struct?

func (v *Provider) searchCheckRuns(runs []*github.CheckRun, status providerstatus.StatusOpts) *int64 {

@chmouel chmouel marked this pull request as draft April 14, 2026 07:38
@chmouel
Copy link
Copy Markdown
Member

chmouel commented Apr 14, 2026

setting draft, to give you time to address the comments..

@theakshaypant theakshaypant force-pushed the perf/cache-check-runs branch from 919500a to b421ba1 Compare April 16, 2026 07:17
Cache GitHub check-run API responses to avoid repeated
paginated API calls during status updates. Use a mutex+channel
pattern so concurrent goroutines share a single in-flight fetch.
Failed fetches are not cached, allowing retries with exponential
backoff on transient API errors.

Signed-off-by: Akshay Pant <akpant@redhat.com>
Assisted-by: Claude Opus 4.6 <noreply@anthropic.com>
Provider struct literals bypass the New() constructor, leaving
the checkRunsCache map nil. Use New() consistently across test
files to ensure proper initialization.

Signed-off-by: Akshay Pant <akpant@redhat.com>
@theakshaypant theakshaypant force-pushed the perf/cache-check-runs branch from b421ba1 to f078824 Compare April 16, 2026 07:23
@theakshaypant theakshaypant changed the title perf(github): cache check runs with sync.Once perf(github): cache check-run lookups with retry Apr 16, 2026
@theakshaypant theakshaypant marked this pull request as ready for review April 16, 2026 10:21
@theakshaypant
Copy link
Copy Markdown
Member Author

/test go-testing

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.

3 participants