Skip to content

feat: Move some GitHub public e2e test to GHE#2466

Merged
chmouel merged 2 commits intotektoncd:mainfrom
chmouel:move-to-github-second
Feb 11, 2026
Merged

feat: Move some GitHub public e2e test to GHE#2466
chmouel merged 2 commits intotektoncd:mainfrom
chmouel:move-to-github-second

Conversation

@chmouel
Copy link
Copy Markdown
Member

@chmouel chmouel commented Feb 11, 2026

Added the SecondController: true flag to numerous GitHub integration tests. This change enables the use of the second controller in these tests, ensuring broader coverage and verification of the GitHub integration's functionality. The modification spans various test files, including those for pull requests, incoming webhooks, push events, and skip CI scenarios.

And at the same time move the TestOthers to concurrency to balance the loads.

📝 Description of the Change

👨🏻‍ Linked Jira

🔗 Linked GitHub Issue

Fixes #

🚀 Type of Change

  • 🐛 Bug fix (fix:)
  • ✨ New feature (feat:)
  • 💥 Breaking change (feat!:, fix!:)
  • 📚 Documentation update (docs:)
  • ⚙️ Chore (chore:)
  • 💅 Refactor (refactor:)
  • 🔧 Enhancement (enhance:)
  • 📦 Dependency update (deps:)

🧪 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

Copilot AI review requested due to automatic review settings February 11, 2026 09:12
@pipelines-as-code
Copy link
Copy Markdown

pipelines-as-code bot commented Feb 11, 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.


🤖 AI attribution

The following commits lack an explicit AI attribution footer:

  • 4e31691 fix: fix regex for delete tag event log message
  • 3771d07 feat: Move github public e2e tests to GHE

If no AI assistance was used for a commit, you can ignore this warning.
Otherwise add an Assisted-by: or Co-authored-by: footer referencing the AI used.


ℹ️ 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

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @chmouel, 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 enhances the testing infrastructure by migrating a significant portion of GitHub-related end-to-end tests to utilize a second controller, likely for GitHub Enterprise environments. This change ensures broader test coverage and validation of GitHub integration functionalities across different setups. Additionally, it optimizes test execution by rebalancing the load of certain test groups to run concurrently.

Highlights

  • GitHub Enterprise (GHE) Test Migration: Numerous existing GitHub public E2E tests have been updated to run against GitHub Enterprise by enabling the 'SecondController' flag, ensuring broader test coverage.
  • Test Concurrency Adjustment: The 'TestOthers' group has been moved to run with 'concurrency' tests to better balance test loads within the CI workflow.
Changelog
  • hack/gh-workflow-ci.sh
    • Updated the 'concurrency' test group to include 'Others' tests.
    • Modified the 'github_second_controller' test group to exclude 'Others' tests.
  • test/github_config_maxkeepruns_test.go
    • Renamed the test function 'TestGithubMaxKeepRuns' to 'TestGithubSecondMaxKeepRuns'.
    • Configured the 'PRTest' to use the 'SecondController'.
  • test/github_incoming_test.go
    • Renamed multiple 'TestGithubAppIncoming*' functions to 'TestGithubSecondAppIncoming*'.
    • Modified calls to 'verifyIncomingWebhook' to activate the 'onSecondController' flag.
  • test/github_pullrequest_retest_test.go
    • Renamed the test function 'TestGithubRetestWithMultipleFailedPipelineRuns' to 'TestGithubSecondRetestWithMultipleFailedPipelineRuns'.
    • Configured the 'PRTest' to use the 'SecondController'.
  • test/github_pullrequest_test.go
    • Renamed several 'TestGithubPullRequest*' functions to their 'TestGithubSecondPullRequest*' counterparts.
    • Configured the 'PRTest' to use the 'SecondController' for these tests.
  • test/github_pullrequest_test_comment_test.go
    • Renamed the test function 'TestGithubPullRequestTest' to 'TestGithubSecondPullRequestTest'.
    • Enabled the 'SecondController' in the 'PRTest' configuration.
  • test/github_push_retest_test.go
    • Renamed multiple 'TestGithubPushRequestGitOpsComment*' functions to 'TestGithubSecondPushRequestGitOpsComment*'.
    • Configured the 'PRTest' to use the 'SecondController' for these tests.
  • test/github_skip_ci_test.go
    • Renamed several 'TestGithubSkipCI*' functions to 'TestGithubSecondSkipCI*'.
    • Configured the 'PRTest' to use the 'SecondController' for these tests.
  • test/github_tag_gitops_test.go
    • Renamed the test function 'TestGithubGitOpsCommentOnTag' to 'TestGithubSecondGitOpsCommentOnTag'.
    • Updated the 'tgithub.Setup' call to enable the second controller.
  • test/github_tkn_pac_cli_test.go
    • Renamed the test function 'TestGithubPacCli' to 'TestGithubSecondPacCli'.
    • Updated the 'tgithub.Setup' call to enable the second controller.
Activity
  • The pull request author indicated that no AI assistance was used for this PR.
  • No other human activity (comments, reviews, etc.) has been recorded yet.
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 pipelines-as-code bot added e2e enhancement New feature or request labels Feb 11, 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 refactors a number of GitHub e2e tests to run them against a second controller, which appears to be a GitHub Enterprise instance. The changes primarily involve renaming test functions to reflect their new target and setting the SecondController flag to true in the test configurations. Additionally, the CI workflow script has been updated to rebalance the test execution load. The changes are consistent, straightforward, and appear to be correct. I have no specific comments as the implementation aligns well with the stated goals.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates several GitHub integration e2e tests to run against a GitHub Enterprise (GHE) second controller instance. The changes ensure broader test coverage by distributing tests across both the primary GitHub controller and a secondary GHE controller. Additionally, the PR rebalances test loads by moving "Others" tests from the github_second_controller execution group to the concurrency group.

Changes:

  • Renamed multiple GitHub test functions to include "Second" prefix (e.g., TestGithubPacCliTestGithubSecondPacCli)
  • Added SecondController: true flag to test configurations to enable second controller usage
  • Updated CI workflow script to route "Others" tests to the concurrency group instead of github_second_controller group

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/github_tkn_pac_cli_test.go Renamed test to TestGithubSecondPacCli and enabled second controller via Setup()
test/github_tag_gitops_test.go Renamed test to TestGithubSecondGitOpsCommentOnTag and enabled second controller
test/github_skip_ci_test.go Renamed 3 skip CI tests and added SecondController: true flag
test/github_push_retest_test.go Renamed 3 push/retest tests and added SecondController: true flag
test/github_pullrequest_test_comment_test.go Renamed test and added SecondController: true flag
test/github_pullrequest_test.go Renamed 12 pull request tests and added SecondController: true flag
test/github_pullrequest_retest_test.go Renamed retest test and added SecondController: true flag
test/github_incoming_test.go Renamed 10 incoming webhook tests and updated verifyIncomingWebhook calls
test/github_config_maxkeepruns_test.go Renamed MaxKeepRuns test and added SecondController: true flag
hack/gh-workflow-ci.sh Updated test routing: moved "Others" to concurrency group, removed from github_second_controller group

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chmouel
Copy link
Copy Markdown
Member Author

chmouel commented Feb 11, 2026

I haven't splitted second as concurrent job, let's see if sequential help first

@chmouel
Copy link
Copy Markdown
Member Author

chmouel commented Feb 11, 2026

analyse for other tests to be moved on GHE

# Analysis: Moving github_1/github_2 tests to GHE second controller

## Context

The HEAD commit (`018b9ce9`) moved many GitHub E2E tests to run against GHE
(second controller) by adding `SecondController: true`. The question is whether
the remaining 14 tests in `github_1` and `github_2` targets can also be moved.

## Key infrastructure differences

- **First controller**: uses `pipelines-as-code` configmap, gets token via GitHub
  App installation (`TEST_GITHUB_REPO_INSTALLATION_ID`), controller pod label
  `app.kubernetes.io/name=controller`
- **Second controller (GHE)**: uses `ghe-configmap`, gets token directly from
  `TEST_GITHUB_SECOND_TOKEN` env var, controller pod label
  `app.kubernetes.io/name=ghe-controller`
- **Webhook tests**: require `TEST_GITHUB_REPO_OWNER_WEBHOOK` - no GHE webhook
  repo exists

## Per-test analysis

### Can be moved (simple - just add SecondController: true)

| Test | Notes |
|------|-------|
| **TestGithubPullRequest** | Basic PR test. Rename to `TestGithubSecondPullRequest` -- but that already exists (line 46). This test is a **duplicate** of the existing second controller version. Could simply be deleted or kept as first-controller-only coverage. |

### Cannot be moved - Webhook mode (no GHE webhook infrastructure)

| Test | Reason |
|------|--------|
| **TestGithubDisableCommentsOnPR** | `Webhook: true`, needs `TEST_GITHUB_REPO_OWNER_WEBHOOK` |
| **TestGithubPullRequestPrivateRepositoryOnWebhook** | `Webhook: true`, private repo on webhook |
| **TestGithubPullRequestWebhook** | `Webhook: true`, basic PR on webhook |
| **TestGithubWebhookIncoming** | Tests incoming with legacy URL query param method (`onWebhook=true, onSecondController=false`). The GHE versions (`TestGithubSecondAppIncoming`, etc.) already cover the JSON body method. |

### Cannot be moved - Hardcoded env vars + manual payload sending

These tests bypass the `PRTest` struct and manually construct GitHub events,
reading env vars directly:

| Test | Blockers |
|------|----------|
| **TestGithubPullRequestOkToTest** | Hardcodes `TEST_GITHUB_REPO_INSTALLATION_ID`, `TEST_EL_URL`, `TEST_EL_WEBHOOK_SECRET`, `TEST_GITHUB_API_URL` in `payload.Send()`. Would need to switch to `TEST_GITHUB_SECOND_*` variants. Also constructs a `IssueCommentEvent` with the first controller's installation ID. |
| **TestGithubPullRerequest** | Same pattern - hardcodes first controller env vars in `payload.Send()` for `CheckRunEvent`/`CheckSuiteEvent`. Would need `TEST_GITHUB_SECOND_*` variants. |

**If you want to move these**: Change the env var reads to conditionally use
SECOND variants. The `payload.Send` function already handles GHE correctly (sets
`X-GitHub-Enterprise-Host` header when URL != github.com). The work is:

1. Change env var reads from `TEST_GITHUB_*` to `TEST_GITHUB_SECOND_*`
2. Use `TEST_GITHUB_SECOND_EL_URL` instead of `TEST_EL_URL`
3. Use `TEST_GITHUB_SECOND_WEBHOOK_SECRET` instead of `TEST_EL_WEBHOOK_SECRET`
4. Use `TEST_GITHUB_SECOND_REPO_INSTALLATION_ID` (value `1`) instead of `TEST_GITHUB_REPO_INSTALLATION_ID`

### Cannot be moved - ConfigMap targeting

| Test | Blockers |
|------|----------|
| **TestGithubCancelInProgressSettingFromConfigMapOnPR** | Calls `tgithub.Setup(ctx, false, false)` then `configmap.ChangeGlobalConfig()` which hardcodes configmap name `"pipelines-as-code"` (`test/pkg/configmap/configmap.go:18`). The GHE controller reads from `ghe-configmap`. |
| **TestGithubCancelInProgressSettingFromConfigMapOnPush** | Same issue. |

**If you want to move these**: Need to either (a) add a configmap name parameter
to `ChangeGlobalConfig`, or (b) create a `ChangeGHEConfig` variant that targets
`ghe-configmap`.

### Already permanently skipped

| Test | Notes |
|------|-------|
| **TestGithubPullRequestScopeTokenToListOfRepos** | `t.Skip("Skipping test changing the global config map for now")` |
| **TestGithubPullRequestScopeTokenToListOfReposByGlobalConfiguration** | Same skip |

### Already have GHE counterparts

| Test | GHE counterpart |
|------|-----------------|
| **TestGithubPullRequest** | `TestGithubSecondPullRequest` (line 46) |
| **TestGithubPullRequestGitClone** | `TestGithubSecondPullRequestGitClone` (line 37). The original checks `"controller"` logs specifically. |
| **TestGithubPush** | `TestGithubSecondPush` (line 39). Original has webhook parts. |
| **TestGithubPushRequestCELMatchOnTitle** | `TestGithubSecondPullRequestCELMatchOnTitle` (line 142, PR variant). Push test loops over webhook=true/false. |

## Summary

| Category | Count | Tests |
|----------|-------|-------|
| Already have GHE version / duplicate | 4 | PullRequest, PullRequestGitClone, Push, PushRequestCELMatchOnTitle |
| Webhook-only (no GHE infra) | 4 | DisableCommentsOnPR, PrivateRepoOnWebhook, PullRequestWebhook, WebhookIncoming |
| Need env var rework | 2 | PullRequestOkToTest, PullRerequest |
| Need configmap rework | 2 | CancelInProgressOnPR, CancelInProgressOnPush |
| Permanently skipped | 2 | ScopeTokenToListOfRepos, ScopeTokenByGlobalConfig |

## Recommendation

- **4 webhook tests**: Keep on first controller (no GHE webhook setup exists)
- **4 tests with GHE counterparts**: Keep on first controller for coverage breadth
  (they exercise different code paths: controller log checking, webhook mode
  iterations)
- **2 permanently skipped**: Ignore
- **2 CancelInProgress tests**: Movable if `ChangeGlobalConfig` is extended to
  accept a configmap name parameter, then target `ghe-configmap`
- **2 payload.Send tests (OkToTest, Rerequest)**: Movable by switching env var
  reads to `TEST_GITHUB_SECOND_*` variants

The 4 tests that **can be moved with work** are the CancelInProgress pair and
the OkToTest/Rerequest pair. The rest should stay where they are.

@chmouel chmouel force-pushed the move-to-github-second branch from 018b9ce to 1aace82 Compare February 11, 2026 12:07
The regular expression used to match the unsupported delete tag event
log message was too strict. It did not account for potential variations
in the message content that could follow the core string.

The regex was updated to be more flexible by allowing any characters to
follow the initial phrase, ensuring more reliable log matching.

Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
Added the `SecondController: true` flag to numerous GitHub integration
tests. This change enabled the use of the second controller in these
tests, ensuring broader coverage and verification of the GitHub
integration's functionality. The modification spanned various test
files, including those for pull requests, incoming webhooks, push
events, and skip CI scenarios.

The TestOthers were also moved to concurrency to balance the loads.

Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
@chmouel chmouel force-pushed the move-to-github-second branch from 1aace82 to 3771d07 Compare February 11, 2026 12:49
@chmouel chmouel merged commit 876b405 into tektoncd:main Feb 11, 2026
13 checks passed
@chmouel chmouel deleted the move-to-github-second branch February 19, 2026 13:18
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.

3 participants