Skip to content

test(e2e): migrate GitHub webhook tests to GHE#2529

Merged
theakshaypant merged 1 commit intotektoncd:mainfrom
theakshaypant:ghe-webhook-config
Mar 6, 2026
Merged

test(e2e): migrate GitHub webhook tests to GHE#2529
theakshaypant merged 1 commit intotektoncd:mainfrom
theakshaypant:ghe-webhook-config

Conversation

@theakshaypant
Copy link
Copy Markdown
Member

@theakshaypant theakshaypant commented Mar 4, 2026

📝 Description of the Change

Summary

  • Add infrastructure for GitHub Enterprise webhook E2E tests with dynamic repository creation
  • Migrate all GitHub webhook E2E tests to use GHE instead of public GitHub with fixed repositories
  • Each test now creates a fresh repository with SMEE webhook forwarding, enabling isolated webhook testing

Changes

  • Enhanced test setup with dynamic GHE repository provisioning
  • Updated all webhook E2E tests to use on-demand repo creation
  • Removed dependency on pre-configured repositories and manual webhook setup

This covers the main goal (migrating GitHub webhook tests to GHE with dynamic repos) and the key benefit (isolated testing without manual setup).

Logs when running all tests from local ``` go test -v -race -failfast -timeout 45m -count=1 -tags=e2e -run "^(TestGithubGHEPushWebhook|TestGithubGHEPullRequestWebhook|TestGithubGHEDisableCommentsOnPR|TestGithubGHEPullRequestPrivateRepositoryOnWebhook|TestGithubGHECommentStrategyUpdateCELErrorReplacement|TestGithubGHECommentStrategyUpdateMultiplePLRs|TestGithubGHECommentStrategyUpdateMarkerMatchingWithRegexChars)$" ./test

=== RUN TestGithubGHECommentStrategyUpdateCELErrorReplacement
{"level":"info","ts":1772702716.739074,"caller":"cctx/ctx.go:19","msg":"Found pipelines-as-code installation in namespace pipelines-as-code"}
{"level":"info","ts":1772702716.7393014,"caller":"cctx/ctx.go:22","msg":"Pipelines as Code Controller: &{Name:default Configmap:pipelines-as-code Secret:pipelines-as-code-secret GlobalRepository:pipelines-as-code}"}
{"level":"info","ts":1772702716.7394133,"caller":"github/github.go:319","msg":"github-webhook: initialized OAuth2 client for providerName=github-enterprise providerURL=https://ghe.pipelinesascode.com/api/v3"}
{"level":"info","ts":1772702716.7394898,"caller":"github/pr.go:137","msg":"Testing Github Comment Strategy CEL Error with Github APPS integration on pac-e2e-ns-bdhdv"}
{"level":"info","ts":1772702716.739569,"caller":"github/pr.go:147","msg":"Creating dynamic GHE repository akpant-test/pac-e2e-test-v8jvq with webhook to https://hook.pipelinesascode.com/kVKGWWgBkHTo"}
{"level":"info","ts":1772702716.739618,"caller":"github/scm.go:16","msg":"Creating GitHub repository akpant-test/pac-e2e-test-v8jvq"}
{"level":"info","ts":1772702718.779499,"caller":"github/scm.go:26","msg":"Created GitHub repository akpant-test/pac-e2e-test-v8jvq"}
{"level":"info","ts":1772702718.7796192,"caller":"github/scm.go:28","msg":"Adding webhook to repository akpant-test/pac-e2e-test-v8jvq pointing to https://hook.pipelinesascode.com/kVKGWWgBkHTo"}
{"level":"info","ts":1772702719.3817892,"caller":"repository/create.go:17","msg":"Namespace pac-e2e-ns-bdhdv created"}
{"level":"info","ts":1772702719.3976588,"caller":"repository/create.go:26","msg":"PipelinesAsCode Repository pac-e2e-ns-bdhdv has been created in namespace pac-e2e-ns-bdhdv"}
{"level":"info","ts":1772702721.7866106,"caller":"github/pr.go:185","msg":"Commit e8cc6f69488fefaaf2a7fd1b546d36c44d9b90b0 has been created and pushed to https://ghe.pipelinesascode.com/api/v3/repos/akpant-test/pac-e2e-test-v8jvq/git/refs/heads/pac-e2e-test-qpdwn"}
{"level":"info","ts":1772702722.9946425,"caller":"github/pr.go:106","msg":"Pull request created: https://ghe.pipelinesascode.com/akpant-test/pac-e2e-test-v8jvq/pull/1"}
{"level":"info","ts":1772702722.9947927,"caller":"test/github_comment_strategy_update_test.go:46","msg":"Waiting for CEL error comment to be created"}
{"level":"info","ts":1772702738.8818772,"caller":"test/github_comment_strategy_update_test.go:70","msg":"Found CEL error comment ID: 61890"}
{"level":"info","ts":1772702738.8819878,"caller":"test/github_comment_strategy_update_test.go:78","msg":"Initial comment body (truncated): \n> [!CAUTION]\n> There are some errors in your PipelineRun template.\n\n| PipelineRun | Error |\n|------|-------|\n| pipelinerun-invalid-cel-swps | `CEL expr..."}
{"level":"info","ts":1772702738.8820667,"caller":"test/github_comment_strategy_update_test.go:84","msg":"Pushing fix to replace CEL error with valid pipelinerun"}
{"level":"info","ts":1772702740.8794537,"caller":"test/github_comment_strategy_update_test.go:98","msg":"Pushed commit: 9f1b7aa47806f5505a698a134975afd99798c1ff"}
{"level":"info","ts":1772702740.879552,"caller":"wait/check.go:31","msg":"Waiting for Repository to be updated"}
{"level":"info","ts":1772702740.895999,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702743.9052424,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702746.907992,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702749.9116428,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702752.9094522,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702755.9095957,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 1/1"}
{"level":"info","ts":1772702757.910438,"caller":"wait/check.go:46","msg":"Check if we have the repository set as succeeded"}
{"level":"info","ts":1772702757.9211178,"caller":"wait/check.go:103","msg":"Success, number of status 1 has been matched"}
{"level":"info","ts":1772702768.6328263,"caller":"test/github_comment_strategy_update_test.go:134","msg":"Updated comment body (truncated): \n✅ Success: pipelinerun-invalid-cel-swps for 9f1b7aa47806f5505a698a134975afd99798c1ff\n\nPipelines as Code CI/pipelinerun-invalid-cel-swps has su..."}
{"level":"info","ts":1772702768.6330216,"caller":"github/instrumentation.go:59","msg":"Attempting to collect GitHub API calls from controller: ghe-controller in namespace: "}
{"level":"warn","ts":1772702768.633332,"caller":"github/instrumentation.go:68","msg":"Failed to get controller logs: could not get controller logs for controller "ghe-controller" in namespace "", attempts: app.kubernetes.io/name=ghe-controller/ghe-controller: resource name may not be empty; app.kubernetes.io/component=controller,app.kubernetes.io/part-of=pipelines-as-code/ghe-controller: resource name may not be empty"}
{"level":"info","ts":1772702768.6334207,"caller":"github/pr.go:219","msg":"Closing PR 1"}
{"level":"info","ts":1772702769.2675042,"caller":"repository/teardown.go:32","msg":"Deleting NS pac-e2e-ns-bdhdv"}
{"level":"info","ts":1772702769.2718627,"caller":"github/pr.go:233","msg":"Deleting Ref heads/pac-e2e-test-qpdwn"}
{"level":"info","ts":1772702769.5977652,"caller":"github/pr.go:240","msg":"Deleting dynamic repository akpant-test/pac-e2e-test-v8jvq"}
{"level":"info","ts":1772702769.5978847,"caller":"github/scm.go:50","msg":"Deleting GitHub repository akpant-test/pac-e2e-test-v8jvq"}
{"level":"info","ts":1772702770.0473993,"caller":"github/scm.go:55","msg":"Deleted GitHub repository akpant-test/pac-e2e-test-v8jvq"}
--- PASS: TestGithubGHECommentStrategyUpdateCELErrorReplacement (53.34s)
=== RUN TestGithubGHECommentStrategyUpdateMultiplePLRs
{"level":"info","ts":1772702770.0641797,"caller":"cctx/ctx.go:19","msg":"Found pipelines-as-code installation in namespace pipelines-as-code"}
{"level":"info","ts":1772702770.0649185,"caller":"cctx/ctx.go:22","msg":"Pipelines as Code Controller: &{Name:default Configmap:pipelines-as-code Secret:pipelines-as-code-secret GlobalRepository:pipelines-as-code}"}
{"level":"info","ts":1772702770.0656972,"caller":"github/github.go:319","msg":"github-webhook: initialized OAuth2 client for providerName=github-enterprise providerURL=https://ghe.pipelinesascode.com/api/v3"}
{"level":"info","ts":1772702770.0657787,"caller":"github/pr.go:137","msg":"Testing Github Comment Strategy Multiple PLRs with Github APPS integration on pac-e2e-ns-4msmp"}
{"level":"info","ts":1772702770.065859,"caller":"github/pr.go:147","msg":"Creating dynamic GHE repository akpant-test/pac-e2e-test-smcc6 with webhook to https://hook.pipelinesascode.com/kVKGWWgBkHTo"}
{"level":"info","ts":1772702770.0658998,"caller":"github/scm.go:16","msg":"Creating GitHub repository akpant-test/pac-e2e-test-smcc6"}
{"level":"info","ts":1772702771.0888803,"caller":"github/scm.go:26","msg":"Created GitHub repository akpant-test/pac-e2e-test-smcc6"}
{"level":"info","ts":1772702771.089004,"caller":"github/scm.go:28","msg":"Adding webhook to repository akpant-test/pac-e2e-test-smcc6 pointing to https://hook.pipelinesascode.com/kVKGWWgBkHTo"}
{"level":"info","ts":1772702771.4299493,"caller":"repository/create.go:17","msg":"Namespace pac-e2e-ns-4msmp created"}
{"level":"info","ts":1772702771.4441707,"caller":"repository/create.go:26","msg":"PipelinesAsCode Repository pac-e2e-ns-4msmp has been created in namespace pac-e2e-ns-4msmp"}
{"level":"info","ts":1772702774.3665974,"caller":"github/pr.go:185","msg":"Commit e0d00cd38eec544e2b2aecaebb5eacdb39ad839f has been created and pushed to https://ghe.pipelinesascode.com/api/v3/repos/akpant-test/pac-e2e-test-smcc6/git/refs/heads/pac-e2e-test-96wrl"}
{"level":"info","ts":1772702775.5431478,"caller":"github/pr.go:106","msg":"Pull request created: https://ghe.pipelinesascode.com/akpant-test/pac-e2e-test-smcc6/pull/1"}
{"level":"info","ts":1772702775.5432682,"caller":"wait/check.go:31","msg":"Waiting for Repository to be updated"}
{"level":"info","ts":1772702775.5493262,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/2"}
{"level":"info","ts":1772702778.5592523,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/2"}
{"level":"info","ts":1772702781.5639997,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/2"}
{"level":"info","ts":1772702784.5633755,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/2"}
{"level":"info","ts":1772702787.5655885,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 2/2"}
{"level":"info","ts":1772702789.566643,"caller":"wait/check.go:46","msg":"Check if we have the repository set as succeeded"}
{"level":"info","ts":1772702789.5795283,"caller":"wait/check.go:103","msg":"Success, number of status 2 has been matched"}
{"level":"info","ts":1772702789.579626,"caller":"wait/check.go:31","msg":"Waiting for Repository to be updated"}
{"level":"info","ts":1772702789.5908558,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 2/2"}
{"level":"info","ts":1772702791.5922987,"caller":"wait/check.go:46","msg":"Check if we have the repository set as succeeded"}
{"level":"info","ts":1772702791.6055276,"caller":"wait/check.go:103","msg":"Success, number of status 2 has been matched"}
{"level":"info","ts":1772702797.5116303,"caller":"test/github_comment_strategy_update_test.go:190","msg":"Found comment for PLR: pipelinerun-qhjp (ID: 61891)"}
{"level":"info","ts":1772702797.5117464,"caller":"test/github_comment_strategy_update_test.go:190","msg":"Found comment for PLR: pipelinerun-clone-ttpo (ID: 61892)"}
{"level":"info","ts":1772702797.5117953,"caller":"test/github_comment_strategy_update_test.go:202","msg":"Pushing empty commit to trigger pipelines again"}
{"level":"info","ts":1772702799.3730822,"caller":"test/github_comment_strategy_update_test.go:210","msg":"Pushed trigger commit: 32f12aca49fe764c90bfba61f6b7c34970a5176c"}
{"level":"info","ts":1772702799.3732035,"caller":"wait/check.go:31","msg":"Waiting for Repository to be updated"}
{"level":"info","ts":1772702799.3818338,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 2/4"}
{"level":"info","ts":1772702802.390728,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 2/4"}
{"level":"info","ts":1772702805.3960238,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 2/4"}
{"level":"info","ts":1772702808.3986602,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 2/4"}
{"level":"info","ts":1772702811.397592,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 2/4"}
{"level":"info","ts":1772702814.397425,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 4/4"}
{"level":"info","ts":1772702816.3983705,"caller":"wait/check.go:46","msg":"Check if we have the repository set as succeeded"}
{"level":"info","ts":1772702816.4126754,"caller":"wait/check.go:103","msg":"Success, number of status 4 has been matched"}
{"level":"info","ts":1772702822.2906635,"caller":"test/github_comment_strategy_update_test.go:242","msg":"Verified PLR pipelinerun-qhjp comment was updated (ID: 61891)"}
{"level":"info","ts":1772702822.2907782,"caller":"test/github_comment_strategy_update_test.go:242","msg":"Verified PLR pipelinerun-clone-ttpo comment was updated (ID: 61892)"}
{"level":"info","ts":1772702822.2908359,"caller":"github/instrumentation.go:59","msg":"Attempting to collect GitHub API calls from controller: ghe-controller in namespace: "}
{"level":"warn","ts":1772702822.2910936,"caller":"github/instrumentation.go:68","msg":"Failed to get controller logs: could not get controller logs for controller "ghe-controller" in namespace "", attempts: app.kubernetes.io/name=ghe-controller/ghe-controller: resource name may not be empty; app.kubernetes.io/component=controller,app.kubernetes.io/part-of=pipelines-as-code/ghe-controller: resource name may not be empty"}
{"level":"info","ts":1772702822.2911665,"caller":"github/pr.go:219","msg":"Closing PR 1"}
{"level":"info","ts":1772702823.0459957,"caller":"repository/teardown.go:32","msg":"Deleting NS pac-e2e-ns-4msmp"}
{"level":"info","ts":1772702823.0508757,"caller":"github/pr.go:233","msg":"Deleting Ref heads/pac-e2e-test-96wrl"}
{"level":"info","ts":1772702823.453939,"caller":"github/pr.go:240","msg":"Deleting dynamic repository akpant-test/pac-e2e-test-smcc6"}
{"level":"info","ts":1772702823.45402,"caller":"github/scm.go:50","msg":"Deleting GitHub repository akpant-test/pac-e2e-test-smcc6"}
{"level":"info","ts":1772702824.0290167,"caller":"github/scm.go:55","msg":"Deleted GitHub repository akpant-test/pac-e2e-test-smcc6"}
--- PASS: TestGithubGHECommentStrategyUpdateMultiplePLRs (53.98s)
=== RUN TestGithubGHECommentStrategyUpdateMarkerMatchingWithRegexChars
{"level":"info","ts":1772702824.0461464,"caller":"cctx/ctx.go:19","msg":"Found pipelines-as-code installation in namespace pipelines-as-code"}
{"level":"info","ts":1772702824.0463176,"caller":"cctx/ctx.go:22","msg":"Pipelines as Code Controller: &{Name:default Configmap:pipelines-as-code Secret:pipelines-as-code-secret GlobalRepository:pipelines-as-code}"}
{"level":"info","ts":1772702824.046411,"caller":"github/github.go:319","msg":"github-webhook: initialized OAuth2 client for providerName=github-enterprise providerURL=https://ghe.pipelinesascode.com/api/v3"}
{"level":"info","ts":1772702824.04648,"caller":"github/pr.go:137","msg":"Testing Github Comment Strategy Regex Chars with Github APPS integration on pac-e2e-ns-dt4d4"}
{"level":"info","ts":1772702824.0465565,"caller":"github/pr.go:147","msg":"Creating dynamic GHE repository akpant-test/pac-e2e-test-7mjdm with webhook to https://hook.pipelinesascode.com/kVKGWWgBkHTo"}
{"level":"info","ts":1772702824.0466115,"caller":"github/scm.go:16","msg":"Creating GitHub repository akpant-test/pac-e2e-test-7mjdm"}
{"level":"info","ts":1772702825.159263,"caller":"github/scm.go:26","msg":"Created GitHub repository akpant-test/pac-e2e-test-7mjdm"}
{"level":"info","ts":1772702825.159376,"caller":"github/scm.go:28","msg":"Adding webhook to repository akpant-test/pac-e2e-test-7mjdm pointing to https://hook.pipelinesascode.com/kVKGWWgBkHTo"}
{"level":"info","ts":1772702825.4904046,"caller":"repository/create.go:17","msg":"Namespace pac-e2e-ns-dt4d4 created"}
{"level":"info","ts":1772702825.501855,"caller":"repository/create.go:26","msg":"PipelinesAsCode Repository pac-e2e-ns-dt4d4 has been created in namespace pac-e2e-ns-dt4d4"}
{"level":"info","ts":1772702828.1259968,"caller":"github/pr.go:185","msg":"Commit 3a7a08508d0f5940719cb1854a15f8d7116bc66f has been created and pushed to https://ghe.pipelinesascode.com/api/v3/repos/akpant-test/pac-e2e-test-7mjdm/git/refs/heads/pac-e2e-test-zvjcf"}
{"level":"info","ts":1772702829.0200372,"caller":"github/pr.go:106","msg":"Pull request created: https://ghe.pipelinesascode.com/akpant-test/pac-e2e-test-7mjdm/pull/1"}
{"level":"info","ts":1772702829.0201511,"caller":"wait/check.go:31","msg":"Waiting for Repository to be updated"}
{"level":"info","ts":1772702829.0279398,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/2"}
{"level":"info","ts":1772702832.0417314,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/2"}
{"level":"info","ts":1772702835.042721,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/2"}
{"level":"info","ts":1772702838.0437496,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 1/2"}
{"level":"info","ts":1772702841.0432885,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 2/2"}
{"level":"info","ts":1772702843.0434878,"caller":"wait/check.go:46","msg":"Check if we have the repository set as succeeded"}
{"level":"info","ts":1772702843.058152,"caller":"wait/check.go:103","msg":"Success, number of status 2 has been matched"}
{"level":"info","ts":1772702843.0582829,"caller":"wait/check.go:31","msg":"Waiting for Repository to be updated"}
{"level":"info","ts":1772702843.0781186,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 2/2"}
{"level":"info","ts":1772702845.0793223,"caller":"wait/check.go:46","msg":"Check if we have the repository set as succeeded"}
{"level":"info","ts":1772702845.0927486,"caller":"wait/check.go:103","msg":"Success, number of status 2 has been matched"}
{"level":"info","ts":1772702850.9650493,"caller":"test/github_comment_strategy_update_test.go:298","msg":"Found comment for PLR with special chars: test-pipeline[0] (ID: 61893)"}
{"level":"info","ts":1772702850.965192,"caller":"test/github_comment_strategy_update_test.go:298","msg":"Found comment for PLR with special chars: test.pipeline.v1.0 (ID: 61894)"}
{"level":"info","ts":1772702850.965256,"caller":"test/github_comment_strategy_update_test.go:332","msg":"Pushing dummy update to trigger comment refresh"}
{"level":"info","ts":1772702852.8600008,"caller":"test/github_comment_strategy_update_test.go:340","msg":"Pushed dummy commit: b1586f8009c48b2b35be8749336a231a109d9665"}
{"level":"info","ts":1772702852.8601236,"caller":"wait/check.go:31","msg":"Waiting for Repository to be updated"}
{"level":"info","ts":1772702852.8696215,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 2/4"}
{"level":"info","ts":1772702855.8803568,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 2/4"}
{"level":"info","ts":1772702858.8821,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 2/4"}
{"level":"info","ts":1772702861.8864963,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 2/4"}
{"level":"info","ts":1772702864.8842947,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 3/4"}
{"level":"info","ts":1772702867.8850675,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 4/4"}
{"level":"info","ts":1772702869.885427,"caller":"wait/check.go:46","msg":"Check if we have the repository set as succeeded"}
{"level":"info","ts":1772702869.8985357,"caller":"wait/check.go:103","msg":"Success, number of status 4 has been matched"}
{"level":"info","ts":1772702870.7285545,"caller":"github/instrumentation.go:59","msg":"Attempting to collect GitHub API calls from controller: ghe-controller in namespace: "}
{"level":"warn","ts":1772702870.7289157,"caller":"github/instrumentation.go:68","msg":"Failed to get controller logs: could not get controller logs for controller "ghe-controller" in namespace "", attempts: app.kubernetes.io/name=ghe-controller/ghe-controller: resource name may not be empty; app.kubernetes.io/component=controller,app.kubernetes.io/part-of=pipelines-as-code/ghe-controller: resource name may not be empty"}
{"level":"info","ts":1772702870.728971,"caller":"github/pr.go:219","msg":"Closing PR 1"}
{"level":"info","ts":1772702871.3666396,"caller":"repository/teardown.go:32","msg":"Deleting NS pac-e2e-ns-dt4d4"}
{"level":"info","ts":1772702871.3704057,"caller":"github/pr.go:233","msg":"Deleting Ref heads/pac-e2e-test-zvjcf"}
{"level":"info","ts":1772702871.7242777,"caller":"github/pr.go:240","msg":"Deleting dynamic repository akpant-test/pac-e2e-test-7mjdm"}
{"level":"info","ts":1772702871.7243986,"caller":"github/scm.go:50","msg":"Deleting GitHub repository akpant-test/pac-e2e-test-7mjdm"}
{"level":"info","ts":1772702872.157093,"caller":"github/scm.go:55","msg":"Deleted GitHub repository akpant-test/pac-e2e-test-7mjdm"}
--- PASS: TestGithubGHECommentStrategyUpdateMarkerMatchingWithRegexChars (48.13s)
=== RUN TestGithubGHEPullRequestPrivateRepositoryOnWebhook
{"level":"info","ts":1772702872.1754303,"caller":"cctx/ctx.go:19","msg":"Found pipelines-as-code installation in namespace pipelines-as-code"}
{"level":"info","ts":1772702872.1755712,"caller":"cctx/ctx.go:22","msg":"Pipelines as Code Controller: &{Name:default Configmap:pipelines-as-code Secret:pipelines-as-code-secret GlobalRepository:pipelines-as-code}"}
{"level":"info","ts":1772702872.1756592,"caller":"github/github.go:319","msg":"github-webhook: initialized OAuth2 client for providerName=github-enterprise providerURL=https://ghe.pipelinesascode.com/api/v3"}
{"level":"info","ts":1772702872.1757207,"caller":"github/pr.go:137","msg":"Testing Github GHE Rerequest with Github APPS integration on pac-e2e-ns-prmvs"}
{"level":"info","ts":1772702872.1757782,"caller":"github/pr.go:147","msg":"Creating dynamic GHE repository akpant-test/pac-e2e-test-qpmn4 with webhook to https://hook.pipelinesascode.com/kVKGWWgBkHTo"}
{"level":"info","ts":1772702872.1758182,"caller":"github/scm.go:16","msg":"Creating GitHub repository akpant-test/pac-e2e-test-qpmn4"}
{"level":"info","ts":1772702872.8931704,"caller":"github/scm.go:26","msg":"Created GitHub repository akpant-test/pac-e2e-test-qpmn4"}
{"level":"info","ts":1772702872.893285,"caller":"github/scm.go:28","msg":"Adding webhook to repository akpant-test/pac-e2e-test-qpmn4 pointing to https://hook.pipelinesascode.com/kVKGWWgBkHTo"}
{"level":"info","ts":1772702873.5001333,"caller":"repository/create.go:17","msg":"Namespace pac-e2e-ns-prmvs created"}
{"level":"info","ts":1772702873.5144844,"caller":"repository/create.go:26","msg":"PipelinesAsCode Repository pac-e2e-ns-prmvs has been created in namespace pac-e2e-ns-prmvs"}
{"level":"info","ts":1772702875.9671779,"caller":"github/pr.go:185","msg":"Commit 0ffb9826773b95d5b6a5ece187487b4b0fbf65ad has been created and pushed to https://ghe.pipelinesascode.com/api/v3/repos/akpant-test/pac-e2e-test-qpmn4/git/refs/heads/pac-e2e-test-9w2p8"}
{"level":"info","ts":1772702876.869521,"caller":"github/pr.go:106","msg":"Pull request created: https://ghe.pipelinesascode.com/akpant-test/pac-e2e-test-qpmn4/pull/1"}
{"level":"info","ts":1772702876.8696299,"caller":"wait/check.go:31","msg":"Waiting for Repository to be updated"}
{"level":"info","ts":1772702876.8752713,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702879.8847184,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702882.8931813,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702885.8961732,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702888.8940485,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702891.8942525,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702894.89177,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702897.8942313,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702900.894141,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702903.8943331,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702906.8942602,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702909.896131,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702912.8949933,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702915.893107,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702918.8934212,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702921.8927472,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702924.8945692,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702927.8935988,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702930.8936777,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702933.8948708,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702936.8941479,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702939.8919847,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702942.8946583,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702945.891988,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702948.8944707,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 1/1"}
{"level":"info","ts":1772702950.8955748,"caller":"wait/check.go:46","msg":"Check if we have the repository set as succeeded"}
{"level":"info","ts":1772702950.9136066,"caller":"wait/check.go:103","msg":"Success, number of status 1 has been matched"}
{"level":"info","ts":1772702950.9137037,"caller":"github/instrumentation.go:59","msg":"Attempting to collect GitHub API calls from controller: ghe-controller in namespace: "}
{"level":"warn","ts":1772702950.9139054,"caller":"github/instrumentation.go:68","msg":"Failed to get controller logs: could not get controller logs for controller "ghe-controller" in namespace "", attempts: app.kubernetes.io/name=ghe-controller/ghe-controller: resource name may not be empty; app.kubernetes.io/component=controller,app.kubernetes.io/part-of=pipelines-as-code/ghe-controller: resource name may not be empty"}
{"level":"info","ts":1772702950.9139683,"caller":"github/pr.go:219","msg":"Closing PR 1"}
{"level":"info","ts":1772702952.0372076,"caller":"repository/teardown.go:32","msg":"Deleting NS pac-e2e-ns-prmvs"}
{"level":"info","ts":1772702952.0430155,"caller":"github/pr.go:233","msg":"Deleting Ref heads/pac-e2e-test-9w2p8"}
{"level":"info","ts":1772702952.386728,"caller":"github/pr.go:240","msg":"Deleting dynamic repository akpant-test/pac-e2e-test-qpmn4"}
{"level":"info","ts":1772702952.3868392,"caller":"github/scm.go:50","msg":"Deleting GitHub repository akpant-test/pac-e2e-test-qpmn4"}
{"level":"info","ts":1772702952.9550269,"caller":"github/scm.go:55","msg":"Deleted GitHub repository akpant-test/pac-e2e-test-qpmn4"}
--- PASS: TestGithubGHEPullRequestPrivateRepositoryOnWebhook (80.80s)
=== RUN TestGithubGHEPullRequestWebhook
{"level":"info","ts":1772702952.9713104,"caller":"cctx/ctx.go:19","msg":"Found pipelines-as-code installation in namespace pipelines-as-code"}
{"level":"info","ts":1772702952.9714751,"caller":"cctx/ctx.go:22","msg":"Pipelines as Code Controller: &{Name:default Configmap:pipelines-as-code Secret:pipelines-as-code-secret GlobalRepository:pipelines-as-code}"}
{"level":"info","ts":1772702952.9715712,"caller":"github/github.go:319","msg":"github-webhook: initialized OAuth2 client for providerName=github-enterprise providerURL=https://ghe.pipelinesascode.com/api/v3"}
{"level":"info","ts":1772702952.9716418,"caller":"github/pr.go:137","msg":"Testing Github GHE PullRequest onWebhook with Github APPS integration on pac-e2e-ns-vk95p"}
{"level":"info","ts":1772702952.9717047,"caller":"github/pr.go:147","msg":"Creating dynamic GHE repository akpant-test/pac-e2e-test-6ch7h with webhook to https://hook.pipelinesascode.com/kVKGWWgBkHTo"}
{"level":"info","ts":1772702952.9717624,"caller":"github/scm.go:16","msg":"Creating GitHub repository akpant-test/pac-e2e-test-6ch7h"}
{"level":"info","ts":1772702953.8054476,"caller":"github/scm.go:26","msg":"Created GitHub repository akpant-test/pac-e2e-test-6ch7h"}
{"level":"info","ts":1772702953.8055534,"caller":"github/scm.go:28","msg":"Adding webhook to repository akpant-test/pac-e2e-test-6ch7h pointing to https://hook.pipelinesascode.com/kVKGWWgBkHTo"}
{"level":"info","ts":1772702954.3951936,"caller":"repository/create.go:17","msg":"Namespace pac-e2e-ns-vk95p created"}
{"level":"info","ts":1772702954.406622,"caller":"repository/create.go:26","msg":"PipelinesAsCode Repository pac-e2e-ns-vk95p has been created in namespace pac-e2e-ns-vk95p"}
{"level":"info","ts":1772702956.5378945,"caller":"github/pr.go:185","msg":"Commit 7b33efa343754c938388020aec244412b3029639 has been created and pushed to https://ghe.pipelinesascode.com/api/v3/repos/akpant-test/pac-e2e-test-6ch7h/git/refs/heads/pac-e2e-test-9pmrh"}
{"level":"info","ts":1772702958.0193996,"caller":"github/pr.go:106","msg":"Pull request created: https://ghe.pipelinesascode.com/akpant-test/pac-e2e-test-6ch7h/pull/1"}
{"level":"info","ts":1772702958.019528,"caller":"wait/check.go:31","msg":"Waiting for Repository to be updated"}
{"level":"info","ts":1772702958.027541,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702961.0365784,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702964.0414882,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702967.0394602,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702970.0414567,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 1/1"}
{"level":"info","ts":1772702972.042589,"caller":"wait/check.go:46","msg":"Check if we have the repository set as succeeded"}
{"level":"info","ts":1772702972.0563273,"caller":"wait/check.go:103","msg":"Success, number of status 1 has been matched"}
{"level":"info","ts":1772702972.0564775,"caller":"github/instrumentation.go:59","msg":"Attempting to collect GitHub API calls from controller: ghe-controller in namespace: "}
{"level":"warn","ts":1772702972.0567844,"caller":"github/instrumentation.go:68","msg":"Failed to get controller logs: could not get controller logs for controller "ghe-controller" in namespace "", attempts: app.kubernetes.io/name=ghe-controller/ghe-controller: resource name may not be empty; app.kubernetes.io/component=controller,app.kubernetes.io/part-of=pipelines-as-code/ghe-controller: resource name may not be empty"}
{"level":"info","ts":1772702972.0568726,"caller":"github/pr.go:219","msg":"Closing PR 1"}
{"level":"info","ts":1772702973.1483722,"caller":"repository/teardown.go:32","msg":"Deleting NS pac-e2e-ns-vk95p"}
{"level":"info","ts":1772702973.1539197,"caller":"github/pr.go:233","msg":"Deleting Ref heads/pac-e2e-test-9pmrh"}
{"level":"info","ts":1772702973.548409,"caller":"github/pr.go:240","msg":"Deleting dynamic repository akpant-test/pac-e2e-test-6ch7h"}
{"level":"info","ts":1772702973.5485,"caller":"github/scm.go:50","msg":"Deleting GitHub repository akpant-test/pac-e2e-test-6ch7h"}
{"level":"info","ts":1772702973.9452126,"caller":"github/scm.go:55","msg":"Deleted GitHub repository akpant-test/pac-e2e-test-6ch7h"}
--- PASS: TestGithubGHEPullRequestWebhook (20.99s)
=== RUN TestGithubGHEDisableCommentsOnPR
{"level":"info","ts":1772702973.9650009,"caller":"cctx/ctx.go:19","msg":"Found pipelines-as-code installation in namespace pipelines-as-code"}
{"level":"info","ts":1772702973.9651883,"caller":"cctx/ctx.go:22","msg":"Pipelines as Code Controller: &{Name:default Configmap:pipelines-as-code Secret:pipelines-as-code-secret GlobalRepository:pipelines-as-code}"}
{"level":"info","ts":1772702973.9653099,"caller":"github/github.go:319","msg":"github-webhook: initialized OAuth2 client for providerName=github-enterprise providerURL=https://ghe.pipelinesascode.com/api/v3"}
{"level":"info","ts":1772702973.965382,"caller":"github/pr.go:137","msg":"Testing Github GHE PullRequest onWebhook with Github APPS integration on pac-e2e-ns-qsbs8"}
{"level":"info","ts":1772702973.965473,"caller":"github/pr.go:147","msg":"Creating dynamic GHE repository akpant-test/pac-e2e-test-mzwrf with webhook to https://hook.pipelinesascode.com/kVKGWWgBkHTo"}
{"level":"info","ts":1772702973.965515,"caller":"github/scm.go:16","msg":"Creating GitHub repository akpant-test/pac-e2e-test-mzwrf"}
{"level":"info","ts":1772702974.9058697,"caller":"github/scm.go:26","msg":"Created GitHub repository akpant-test/pac-e2e-test-mzwrf"}
{"level":"info","ts":1772702974.9059727,"caller":"github/scm.go:28","msg":"Adding webhook to repository akpant-test/pac-e2e-test-mzwrf pointing to https://hook.pipelinesascode.com/kVKGWWgBkHTo"}
{"level":"info","ts":1772702975.4154305,"caller":"repository/create.go:17","msg":"Namespace pac-e2e-ns-qsbs8 created"}
{"level":"info","ts":1772702975.4273183,"caller":"repository/create.go:26","msg":"PipelinesAsCode Repository pac-e2e-ns-qsbs8 has been created in namespace pac-e2e-ns-qsbs8"}
{"level":"info","ts":1772702977.8830462,"caller":"github/pr.go:185","msg":"Commit 72194692ba9be868ae93a3566c38fbd03f03a8e4 has been created and pushed to https://ghe.pipelinesascode.com/api/v3/repos/akpant-test/pac-e2e-test-mzwrf/git/refs/heads/pac-e2e-test-h5mtz"}
{"level":"info","ts":1772702978.7692523,"caller":"github/pr.go:106","msg":"Pull request created: https://ghe.pipelinesascode.com/akpant-test/pac-e2e-test-mzwrf/pull/1"}
{"level":"info","ts":1772702978.769365,"caller":"wait/check.go:31","msg":"Waiting for Repository to be updated"}
{"level":"info","ts":1772702978.7797432,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702981.790678,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702984.7927501,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772702987.7936647,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 1/1"}
{"level":"info","ts":1772702989.7944403,"caller":"wait/check.go:46","msg":"Check if we have the repository set as succeeded"}
{"level":"info","ts":1772702989.8053215,"caller":"wait/check.go:103","msg":"Success, number of status 1 has been matched"}
{"level":"info","ts":1772702990.5919747,"caller":"github/instrumentation.go:59","msg":"Attempting to collect GitHub API calls from controller: ghe-controller in namespace: "}
{"level":"warn","ts":1772702990.592286,"caller":"github/instrumentation.go:68","msg":"Failed to get controller logs: could not get controller logs for controller "ghe-controller" in namespace "", attempts: app.kubernetes.io/name=ghe-controller/ghe-controller: resource name may not be empty; app.kubernetes.io/component=controller,app.kubernetes.io/part-of=pipelines-as-code/ghe-controller: resource name may not be empty"}
{"level":"info","ts":1772702990.592367,"caller":"github/pr.go:219","msg":"Closing PR 1"}
{"level":"info","ts":1772702991.2684174,"caller":"repository/teardown.go:32","msg":"Deleting NS pac-e2e-ns-qsbs8"}
{"level":"info","ts":1772702991.2726738,"caller":"github/pr.go:233","msg":"Deleting Ref heads/pac-e2e-test-h5mtz"}
{"level":"info","ts":1772702991.6590219,"caller":"github/pr.go:240","msg":"Deleting dynamic repository akpant-test/pac-e2e-test-mzwrf"}
{"level":"info","ts":1772702991.6591182,"caller":"github/scm.go:50","msg":"Deleting GitHub repository akpant-test/pac-e2e-test-mzwrf"}
{"level":"info","ts":1772702992.171605,"caller":"github/scm.go:55","msg":"Deleted GitHub repository akpant-test/pac-e2e-test-mzwrf"}
--- PASS: TestGithubGHEDisableCommentsOnPR (18.23s)
=== RUN TestGithubGHEPushWebhook
{"level":"info","ts":1772702992.1904793,"caller":"cctx/ctx.go:19","msg":"Found pipelines-as-code installation in namespace pipelines-as-code"}
{"level":"info","ts":1772702992.190601,"caller":"cctx/ctx.go:22","msg":"Pipelines as Code Controller: &{Name:default Configmap:pipelines-as-code Secret:pipelines-as-code-secret GlobalRepository:pipelines-as-code}"}
{"level":"info","ts":1772702992.190687,"caller":"github/github.go:319","msg":"github-webhook: initialized OAuth2 client for providerName=github-enterprise providerURL=https://ghe.pipelinesascode.com/api/v3"}
{"level":"info","ts":1772702992.1907492,"caller":"github/pr.go:261","msg":"Testing Github GHE push request on Webhook with Direct Webhook integration on pac-e2e-push-fqs2h"}
{"level":"info","ts":1772702992.1908085,"caller":"github/pr.go:275","msg":"Creating dynamic GHE repository akpant-test/pac-e2e-test-f8jd2 with webhook to https://hook.pipelinesascode.com/kVKGWWgBkHTo"}
{"level":"info","ts":1772702992.1908476,"caller":"github/scm.go:16","msg":"Creating GitHub repository akpant-test/pac-e2e-test-f8jd2"}
{"level":"info","ts":1772702993.0950906,"caller":"github/scm.go:26","msg":"Created GitHub repository akpant-test/pac-e2e-test-f8jd2"}
{"level":"info","ts":1772702993.095204,"caller":"github/scm.go:28","msg":"Adding webhook to repository akpant-test/pac-e2e-test-f8jd2 pointing to https://hook.pipelinesascode.com/kVKGWWgBkHTo"}
{"level":"info","ts":1772702993.6129823,"caller":"repository/create.go:17","msg":"Namespace pac-e2e-push-fqs2h created"}
{"level":"info","ts":1772702993.625044,"caller":"repository/create.go:26","msg":"PipelinesAsCode Repository pac-e2e-push-fqs2h has been created in namespace pac-e2e-push-fqs2h"}
{"level":"info","ts":1772702998.5196006,"caller":"scm/scm.go:48","msg":"Pushed files to repo https://ghe.pipelinesascode.com/akpant-test/pac-e2e-test-f8jd2 branch pac-e2e-push-fqs2h"}
{"level":"info","ts":1772703004.5730386,"caller":"github/pr.go:317","msg":"Commit 6a70ece49fd1fb73d0311d1a4869080c116a12a0 has been created and pushed to https://ghe.pipelinesascode.com/akpant-test/pac-e2e-test-f8jd2/commit/6a70ece49fd1fb73d0311d1a4869080c116a12a0 in branch pac-e2e-push-fqs2h"}
{"level":"info","ts":1772703004.573152,"caller":"wait/check.go:31","msg":"Waiting for Repository to be updated"}
{"level":"info","ts":1772703004.5839045,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772703007.595186,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772703010.5967386,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772703013.5952053,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772703016.595162,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772703019.5943427,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772703022.5973194,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772703025.5989618,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772703028.595725,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772703031.5941243,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772703034.5959496,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772703037.5962746,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772703040.5970755,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 1/1"}
{"level":"info","ts":1772703042.5974793,"caller":"wait/check.go:46","msg":"Check if we have the repository set as succeeded"}
{"level":"info","ts":1772703042.6103828,"caller":"wait/check.go:103","msg":"Success, number of status 1 has been matched"}
{"level":"info","ts":1772703042.6105294,"caller":"github/instrumentation.go:59","msg":"Attempting to collect GitHub API calls from controller: ghe-controller in namespace: "}
{"level":"warn","ts":1772703042.6107903,"caller":"github/instrumentation.go:68","msg":"Failed to get controller logs: could not get controller logs for controller "ghe-controller" in namespace "", attempts: app.kubernetes.io/name=ghe-controller/ghe-controller: resource name may not be empty; app.kubernetes.io/component=controller,app.kubernetes.io/part-of=pipelines-as-code/ghe-controller: resource name may not be empty"}
{"level":"info","ts":1772703042.634642,"caller":"repository/teardown.go:32","msg":"Deleting NS pac-e2e-push-fqs2h"}
{"level":"info","ts":1772703042.6400642,"caller":"github/pr.go:233","msg":"Deleting Ref heads/pac-e2e-push-fqs2h"}
{"level":"info","ts":1772703043.4273546,"caller":"github/pr.go:240","msg":"Deleting dynamic repository akpant-test/pac-e2e-test-f8jd2"}
{"level":"info","ts":1772703043.427426,"caller":"github/scm.go:50","msg":"Deleting GitHub repository akpant-test/pac-e2e-test-f8jd2"}
{"level":"info","ts":1772703043.7958043,"caller":"github/scm.go:55","msg":"Deleted GitHub repository akpant-test/pac-e2e-test-f8jd2"}
--- PASS: TestGithubGHEPushWebhook (51.62s)
PASS
ok github.com/openshift-pipelines/pipelines-as-code/test 328.180s

go test -v -race -failfast -timeout 45m -count=1 -tags=e2e -run "^(TestGithubGHEWebhookIncoming)$" ./test
=== RUN TestGithubGHEWebhookIncoming
{"level":"info","ts":1772703468.8584476,"caller":"cctx/ctx.go:19","msg":"Found pipelines-as-code installation in namespace pipelines-as-code"}
{"level":"info","ts":1772703468.8586395,"caller":"cctx/ctx.go:22","msg":"Pipelines as Code Controller: &{Name:default Configmap:pipelines-as-code Secret:pipelines-as-code-secret GlobalRepository:pipelines-as-code}"}
{"level":"info","ts":1772703468.8587692,"caller":"github/github.go:319","msg":"github-webhook: initialized OAuth2 client for providerName=github-enterprise providerURL=https://ghe.pipelinesascode.com/api/v3"}
{"level":"info","ts":1772703468.8588736,"caller":"test/github_incoming_test.go:192","msg":"Testing GithubApp Incoming with Github APPS integration on pac-e2e-ns-2svjg with targets [pac-e2e-ns-2svjg]"}
{"level":"info","ts":1772703468.8589706,"caller":"test/github_incoming_test.go:203","msg":"Creating dynamic GHE repository akpant-test/pac-e2e-test-nhlxh with webhook to https://hook.pipelinesascode.com/kVKGWWgBkHTo"}
{"level":"info","ts":1772703468.8590207,"caller":"github/scm.go:12","msg":"Creating GitHub repository akpant-test/pac-e2e-test-nhlxh"}
{"level":"info","ts":1772703470.9034228,"caller":"github/scm.go:22","msg":"Created GitHub repository akpant-test/pac-e2e-test-nhlxh"}
{"level":"info","ts":1772703470.9035878,"caller":"github/scm.go:24","msg":"Adding webhook to repository akpant-test/pac-e2e-test-nhlxh pointing to https://hook.pipelinesascode.com/kVKGWWgBkHTo"}
{"level":"info","ts":1772703471.2443357,"caller":"repository/create.go:17","msg":"Namespace pac-e2e-ns-2svjg created"}
{"level":"info","ts":1772703471.2614696,"caller":"repository/create.go:26","msg":"PipelinesAsCode Repository pac-e2e-ns-2svjg has been created in namespace pac-e2e-ns-2svjg"}
{"level":"info","ts":1772703473.76445,"caller":"test/github_incoming_test.go:249","msg":"Commit 9c114879582be581efaa8f02325398af4fac395f has been created and pushed to branch https://ghe.pipelinesascode.com/api/v3/repos/akpant-test/pac-e2e-test-nhlxh/git/refs/heads/pac-e2e-ns-2svjg"}
{"level":"info","ts":1772703473.7800856,"caller":"test/github_incoming_test.go:305","msg":"Kicked off on incoming URL: http://controller.paac-127-0-0-1.nip.io/incoming?repository=pac-e2e-ns-2svjg&branch=pac-e2e-ns-2svjg&pipelinerun=pipelinerun-incoming&secret=shhhh-secrete with branch: pac-e2e-ns-2svjg, targets: [pac-e2e-ns-2svjg]"}
{"level":"info","ts":1772703473.7802353,"caller":"wait/check.go:31","msg":"Waiting for Repository to be updated"}
{"level":"info","ts":1772703473.7968285,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772703476.8080883,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772703479.8073847,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772703482.8081982,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 0/1"}
{"level":"info","ts":1772703485.8074791,"caller":"wait/wait.go:75","msg":"Still waiting for repository status to be updated: 1/1"}
{"level":"info","ts":1772703487.808613,"caller":"wait/check.go:46","msg":"Check if we have the repository set as succeeded"}
{"level":"info","ts":1772703487.820913,"caller":"wait/check.go:103","msg":"Success, number of status 1 has been matched"}
{"level":"info","ts":1772703487.82662,"caller":"wait/logs.go:54","msg":"looking for regexp .*It's a Bird... It's a Plane... It's Superman in namespace: pac-e2e-ns-2svjg for label pipelinesascode.tekton.dev/event-type=incoming and container step-task"}
{"level":"info","ts":1772703487.8459792,"caller":"wait/logs.go:70","msg":"matched regexp .*It's a Bird... It's a Plane... It's Superman in labelSelector/container pipelinesascode.tekton.dev/event-type=incoming:step-task"}
{"level":"info","ts":1772703487.8461132,"caller":"github/instrumentation.go:59","msg":"Attempting to collect GitHub API calls from controller: ghe-controller in namespace: pipelines-as-code"}
{"level":"warn","ts":1772703487.855968,"caller":"github/instrumentation.go:68","msg":"Failed to get controller logs: could not get controller logs for controller "ghe-controller" in namespace "pipelines-as-code", attempts: app.kubernetes.io/name=ghe-controller/ghe-controller: could not match any pod to label selector: app.kubernetes.io/name=ghe-controller; app.kubernetes.io/component=controller,app.kubernetes.io/part-of=pipelines-as-code/ghe-controller: could not find logs for label selector "app.kubernetes.io/component=controller,app.kubernetes.io/part-of=pipelines-as-code": container "ghe-controller" is not present in any pod: pipelines-as-code-controller-7579467d78-7g8cn[pac-controller]"}
{"level":"info","ts":1772703487.8742447,"caller":"repository/teardown.go:32","msg":"Deleting NS pac-e2e-ns-2svjg"}
{"level":"info","ts":1772703487.8786962,"caller":"github/pr.go:242","msg":"Deleting dynamic repository akpant-test/pac-e2e-test-nhlxh"}
{"level":"info","ts":1772703487.8787632,"caller":"github/scm.go:46","msg":"Deleting GitHub repository akpant-test/pac-e2e-test-nhlxh"}
{"level":"info","ts":1772703488.6748273,"caller":"github/scm.go:51","msg":"Deleted GitHub repository akpant-test/pac-e2e-test-nhlxh"}
--- PASS: TestGithubGHEWebhookIncoming (19.85s)
PASS
ok github.com/openshift-pipelines/pipelines-as-code/test 20.929s

👨🏻‍ Linked Jira

N/A

🔗 Linked GitHub Issue

N/A

🧪 Testing Strategy

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

🤖 AI Assistance

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

If you have used AI assistance, please provide the following details:

Which LLM was used?

  • GitHub Copilot
  • ChatGPT (OpenAI)
  • Claude (Anthropic)
  • Cursor
  • Gemini (Google)
  • Other: ____________

Extent of AI Assistance:

  • Documentation and research only
  • Unit tests or E2E tests only
  • Code generation (parts of the code)
  • Full code generation (most of the PR)
  • PR description and comments
  • Commit message(s)

Important

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: Gemini gemini@google.com
Co-authored-by: ChatGPT noreply@chatgpt.com
Co-authored-by: Claude noreply@anthropic.com
Co-authored-by: Cursor noreply@cursor.com
Co-authored-by: Copilot Copilot@users.noreply.github.com

**💡You can use the script ./hack/add-llm-coauthor.sh to automatically add
these co-author trailers to your commits.

✅ 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

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the end-to-end testing capabilities by introducing support for GitHub Enterprise with direct webhook authentication. This change addresses a critical gap in testing coverage, ensuring that all four primary authentication combinations (public GitHub + app, public GitHub + webhook, GHE + app, and GHE + webhook) are now properly validated. The modifications primarily involve updating test configurations and refining the setup logic to correctly differentiate and apply GHE-specific webhook settings.

Highlights

  • GitHub Enterprise Webhook Support: Added comprehensive support for testing direct webhook authentication on GitHub Enterprise (GHE), enabling a previously unsupported authentication combination (GHE + webhook).
  • Bug Fix: Resolved a bug where the GHE configuration block incorrectly overwrote the webhook repository settings, preventing proper webhook authentication on GHE.
  • E2E Test Configuration: Updated E2E test configurations and setup logic to correctly handle environment variables and repository owners for GHE webhook scenarios.
Changelog
  • test/README.md
    • Documented the new TEST_GITHUB_SECOND_REPO_OWNER_WEBHOOK environment variable required for GHE webhook integration testing.
  • test/e2e-config.yaml.example
    • Added repo_owner_webhook field under the github_enterprise section to the example E2E configuration file.
  • test/pkg/configfile/config.go
    • Introduced RepoOwnerWebhook field to the GitHubEnterpriseConfig struct, mapping it to the TEST_GITHUB_SECOND_REPO_OWNER_WEBHOOK environment variable.
  • test/pkg/github/setup.go
    • Refactored the Setup function to correctly initialize repository owner split variable based on viaDirectWebhook before GHE-specific overrides.
    • Modified GHE setup logic to conditionally require and use TEST_GITHUB_SECOND_REPO_OWNER_WEBHOOK when viaDirectWebhook is true, fixing the configuration overwrite bug.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/e2e.yaml
Activity
  • The author has marked end-to-end tests as completed.
  • AI assistance was used for generating commit messages.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@pipelines-as-code
Copy link
Copy Markdown

pipelines-as-code bot commented Mar 4, 2026

🔍 PR Lint Feedback

Note: This automated check helps ensure your PR follows our contribution guidelines.

⚠️ Items that need attention:

🎫 Jira reference

Add a Jira reference in the description using one of the following formats:

  • https://issues.redhat.com/browse/SRVKP-<number>

If no SRVKP ticket exists yet, link a GitHub issue instead (e.g., Fixes #123).
Minor housekeeping PRs without Jira coverage can skip this after confirming with reviewers.


ℹ️ Next Steps

  • Review and address the items above
  • Push new commits to update this PR
  • This comment will be automatically updated when issues are resolved
🔧 Admin Tools (click to expand)

Automated Issue/Ticket Creation:

  • /issue-create - Generate a GitHub issue from this PR content using AI
  • /jira-create - Create a SRVKP Jira ticket from this PR content using AI

⚠️ Important: Always review and edit generated content before finalizing tickets/issues.
The AI-generated content should be used as a starting point and may need adjustments.

These commands are available to maintainers and will post the generated content as PR comments for review.

🤖 This feedback was generated automatically by the PR CI system

@pipelines-as-code pipelines-as-code bot added e2e enhancement New feature or request labels Mar 4, 2026
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 adds support for testing direct webhook authentication on GitHub Enterprise, completing the matrix of authentication methods. The changes include updating documentation, example configuration, and the test setup logic.

The core logic change in test/pkg/github/setup.go correctly implements the new test case, but the implementation is complex and hard to follow. It also introduces a minor bug by requiring an unnecessary environment variable (TEST_GITHUB_SECOND_REPO_OWNER_GITHUBAPP) for GHE webhook tests. I've suggested a refactoring to simplify the logic, improve readability, and fix the bug, aligning with the guideline to separate conditional checks for distinct semantic meanings.

@theakshaypant theakshaypant marked this pull request as ready for review March 4, 2026 06:07
@chmouel
Copy link
Copy Markdown
Member

chmouel commented Mar 4, 2026

Hey, i wanted to do the GHE webhook differently, the issues is sharing the SMEE and we should avoid that as much as possible.. The idea would be to use a dedicated organisation for e2e tests for each users (for pac ci we can call it pac-e2e-tests like we do on gitlab) and auto create/delete repository, it will have it's own auto generated gosmee (like we do currently in gitlab and gitea) at the e2e.

I saved a CLAUDE plan some time ago, which i copy it here to help you get started as prompt (mayb need iteration). # Plan: Move GitHub OnWebhook Tests to GHE with Dynamic Repo Creation

Context

Currently, GitHub OnWebhook E2E tests (TestGithubPullRequestWebhook, TestGithubPush webhook path, TestGithubPullRequestPrivateRepositoryOnWebhook, TestGithubDisableCommentsOnPR) use a fixed pre-configured repo on public GitHub (TEST_GITHUB_REPO_OWNER_WEBHOOK). This differs from GitLab and Gitea, which create dynamic repos per test with SMEE-based webhook forwarding.

The goal is to move these tests to GHE with:

  • Dynamic repo creation per test (like GitLab's CreateGitLabProject)
  • A pre-provisioned SMEE URL for webhook forwarding (TEST_GITHUB_SECOND_SMEEURL)
  • Repos created under a GHE organization
  • Remove the old public GitHub webhook tests

Files to Modify

1. test/pkg/github/scm.go (NEW)

Create a CreateGHERepo function, mirroring test/pkg/gitlab/scm.go:CreateGitLabProject:

func CreateGHERepo(client *github.Client, org, name, hookURL, webhookSecret string, logger *zap.SugaredLogger) (*github.Repository, error)
  • Create repo under org with AutoInit: true (creates README on main)
  • Add webhook pointing to hookURL (the SMEE URL) for events: push, pull_request, issue_comment, check_run, check_suite
  • Webhook secret set to webhookSecret
  • Return the created *github.Repository

Also add:

func DeleteGHERepo(client *github.Client, org, name string, logger *zap.SugaredLogger) error

2. test/pkg/options/options.go

Add fields to E2E struct for passing webhook config to CreateCRD:

type E2E struct {
    // ... existing fields ...
    Token   string  // Auth token (for CRD GitProvider secret)
    APIURL  string  // API URL (for CRD GitProvider URL)
}

3. test/pkg/github/setup.go

Modify Setup() to handle the onGHE && viaDirectWebhook case:

  • When onGHE && viaDirectWebhook:
    • Require TEST_GITHUB_SECOND_SMEEURL env var
    • Use TEST_GITHUB_SECOND_TOKEN as the token
    • Use TEST_GITHUB_SECOND_API_URL as the API URL
    • Use TEST_GITHUB_SECOND_EL_URL as the controller URL
    • Derive org from TEST_GITHUB_SECOND_REPO_OWNER_GITHUBAPP (split on /, take first part)
    • Set opts.Repo = "" (will be filled after dynamic repo creation)
    • Populate opts.Token and opts.APIURL

4. test/pkg/github/crd.go

Modify CreateCRD() and CreateCRDIncoming():

  • When opts.DirectWebhook:
    • Use opts.Token instead of os.LookupEnv("TEST_GITHUB_TOKEN") (fall back to env if empty)
    • Use opts.APIURL instead of os.LookupEnv("TEST_GITHUB_API_URL") (fall back to env if empty)

5. test/pkg/github/pr.go

Modify PRTest struct — add field:

DynamicRepoName string  // set when a dynamic repo was created (for cleanup)

Modify RunPullRequest():

  • After Setup(), when g.GHE && g.Webhook:
    • Generate random repo name: names.SimpleNameGenerator.RestrictLengthWithRandomSuffix("pac-e2e-test")
    • Read TEST_GITHUB_SECOND_SMEEURL and TEST_EL_WEBHOOK_SECRET
    • Call CreateGHERepo(ghcnx.Client(), opts.Organization, repoName, smeeURL, webhookSecret, logger)
    • Set opts.Repo = repoName
    • Store g.DynamicRepoName = repoName
    • Use the returned repo info (skip Repositories.Get call)
  • Otherwise: fetch existing repo as before

Modify RunPushRequest():

  • Same dynamic repo creation logic when g.GHE && g.Webhook

Modify TearDown():

  • After existing cleanup, when g.DynamicRepoName != "":
    • Delete the dynamic repo: g.Provider.Client().Repositories.Delete(ctx, org, repoName)

6. test/pkg/configfile/config.go

Add to GitHubEnterpriseConfig:

SmeeURL string `env:"TEST_GITHUB_SECOND_SMEEURL" json:"smee_url" yaml:"smee_url"`

7. test/e2e-config.yaml.example

Add smee_url field to github_enterprise section.

8. Test files — replace OnWebhook tests

test/github_pullrequest_test.go:

  • TestGithubPullRequestWebhookTestGithubGHEPullRequestWebhook with GHE: true, Webhook: true
  • TestGithubDisableCommentsOnPRTestGithubGHEDisableCommentsOnPR with GHE: true, Webhook: true
  • Remove the NIGHTLY_E2E_TEST and TEST_GITHUB_REPO_OWNER_WEBHOOK skip guards (these are now standard GHE tests)

test/github_push_test.go:

  • TestGithubPush (which has the webhook path): rewrite as TestGithubGHEPushWebhook with GHE: true, Webhook: true
  • Remove the confusing conditional webhook/app logic in TestGithubPush

test/github_pullrequest_privaterepository_test.go:

  • TestGithubPullRequestPrivateRepositoryOnWebhookTestGithubGHEPullRequestPrivateRepositoryOnWebhook with GHE: true, Webhook: true
  • Remove NIGHTLY_E2E_TEST guard

9. Cleanup: Remove dead env vars

After moving all tests, TEST_GITHUB_REPO_OWNER_WEBHOOK is no longer needed:

  • Remove from test/pkg/github/setup.go (the line reading it)
  • Remove from test/pkg/configfile/config.go (GitHubConfig.RepoOwnerWebhook)
  • Remove from test/e2e-config.yaml.example

Verification

  1. make fumpt — format Go files
  2. make lint — check code quality
  3. make test — run unit tests to verify compilation
  4. Manual E2E: the tests require a GHE instance with:
    • TEST_GITHUB_SECOND_API_URL, TEST_GITHUB_SECOND_TOKEN, TEST_GITHUB_SECOND_EL_URL configured
    • TEST_GITHUB_SECOND_SMEEURL pointing to an active SMEE channel forwarding to the GHE controller
    • TEST_GITHUB_SECOND_REPO_OWNER_GITHUBAPP set (org part used for dynamic repo creation)
    • A gosmee client forwarding the SMEE channel to the GHE controller

@theakshaypant theakshaypant marked this pull request as draft March 4, 2026 12:44
@theakshaypant theakshaypant changed the title test(e2e): add GHE webhook support test(e2e): migrate GitHub webhook tests to GHE Mar 5, 2026
@theakshaypant theakshaypant force-pushed the ghe-webhook-config branch 5 times, most recently from 1ddc2df to ec179b0 Compare March 5, 2026 11:08
Add infrastructure for GitHub Enterprise webhook E2E tests with
dynamic repository creation. Each test creates a fresh repository
with SMEE webhook forwarding, mirroring the GitLab test pattern.
This enables isolated webhook testing on GHE without pre-configured
repositories or manual webhook setup.

Co-Authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Akshay Pant <akshay.akshaypant@gmail.com>
@theakshaypant
Copy link
Copy Markdown
Member Author

theakshaypant commented Mar 5, 2026

Successful CI run on my fork and also see no tests run on github_public job for the PR
Screenshot From 2026-03-05 17-30-03

@theakshaypant theakshaypant marked this pull request as ready for review March 5, 2026 12:03
@theakshaypant
Copy link
Copy Markdown
Member Author

GHE webhook tests expected to fail since the workflow uses the manifest from main and we have added the new smee for ghe webhook setup which is required by the tests.

@chmouel
Copy link
Copy Markdown
Member

chmouel commented Mar 5, 2026

please feel free to merge this tomo when you are online and monitor

@chmouel
Copy link
Copy Markdown
Member

chmouel commented Mar 5, 2026

/lgtm

Copy link
Copy Markdown

@pipelines-as-code pipelines-as-code bot left a comment

Choose a reason for hiding this comment

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

Congrats @theakshaypant your PR Has been approved 🎉

✅ Pull Request Approved

Approval Status:

  • Required Approvals: 1
  • Current Approvals: 1

👥 Reviewers Who Approved:

Reviewer Permission Level Approval Status
@chmouel admin

📝 Next Steps

  • Ensure all required checks pass
  • Comply with branch protection rules
  • Request a maintainer to merge using the /merge command (or merge it
    directly if you have repository permission).

Automated by the PAC Boussole 🧭

@theakshaypant theakshaypant merged commit 00e0d26 into tektoncd:main Mar 6, 2026
11 of 14 checks passed
@theakshaypant theakshaypant deleted the ghe-webhook-config branch March 6, 2026 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e2e enhancement New feature or request testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants