chore: Reenable BitbucketDC and move more tests to GHE#2497
chore: Reenable BitbucketDC and move more tests to GHE#2497chmouel merged 2 commits intotektoncd:mainfrom
Conversation
Summary of ChangesHello @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 focuses on enhancing the testing infrastructure by shifting several existing end-to-end tests from public GitHub to a GitHub Enterprise environment. This strategic move aims to improve test reliability and provide more control over the testing setup by utilizing a local GHE instance, thereby minimizing dependencies on external GitHub.com services for these specific test scenarios. Highlights
Changelog
Activity
Using Gemini Code AssistThe 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
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 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
|
🔍 PR Lint Feedback
|
There was a problem hiding this comment.
Code Review
The pull request successfully migrates several existing GitHub tests to utilize a GitHub Enterprise (GHE) instance. This is achieved by renaming test functions to reflect their GHE context, setting the GHE: true flag in tgithub.PRTest configurations, and updating environment variable references to point to GHE-specific API endpoints and application IDs. Additionally, the change to use ghe-controller for log matching indicates a proper separation for GHE-related operations. The changes are consistent with the pull request's objective and enhance the test suite's coverage for GHE environments.
747df39 to
8711f98
Compare
This reverts commit 982d3af.
8711f98 to
dcf065a
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the E2E test suite to (1) re-enable Bitbucket Data Center coverage now that infra is available again, and (2) shift more GitHub E2E coverage to the local GitHub Enterprise (GHE) “second controller” setup to reduce reliance on GitHub.com.
Changes:
- Re-enable Bitbucket Data Center E2E tests by removing the temporary unconditional skips.
- Migrate/rename multiple GitHub E2E tests to run against GHE (and adjust controller/log/configmap targeting accordingly).
- Extend the E2E helper
ChangeGlobalConfigto accept a configurable ConfigMap name (to support the second controller’s configmap).
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/pkg/configmap/configmap.go | ChangeGlobalConfig now accepts a configMapName to support multiple controllers/configmaps. |
| test/github_scope_token_to_list_of_private_public_repos_test.go | Updates helper call to pass explicit configmap name. |
| test/github_push_test.go | Moves a push CEL-title test to GHE and simplifies it. |
| test/github_push_retest_test.go | Converts retest PR-number substitution scenario to run on GHE. |
| test/github_pullrequest_test.go | Renames/selects several PR tests for GHE and switches cancel-in-progress config to use ghe-configmap. |
| test/github_pullrequest_rerequest_test.go | Moves rerequest test to GHE and swaps payload/env inputs for second controller. |
| test/github_pullrequest_privaterepository_test.go | Renames test and switches controller log lookup to ghe-controller. |
| test/github_pullrequest_oktotest_test.go | Moves ok-to-test test to GHE and swaps payload/env inputs for second controller. |
| test/gitea_test.go | Updates helper call to pass explicit configmap name. |
| test/gitea_params_test.go | Updates helper call to pass explicit configmap name. |
| test/gitea_access_control_test.go | Updates helper call to pass explicit configmap name. |
| test/bitbucket_datacenter_push_test.go | Re-enables Bitbucket DC push-path-change E2E test (removes unconditional skip). |
| test/bitbucket_datacenter_pull_request_test.go | Re-enables Bitbucket DC PR E2E tests (removes unconditional skips). |
| test/bitbucket_datacenter_dynamic_variables_test.go | Re-enables Bitbucket DC dynamic variables E2E test (removes unconditional skip). |
Comments suppressed due to low confidence (2)
test/github_pullrequest_oktotest_test.go:58
github.Installation.IDis being populated fromTEST_GITHUB_SECOND_APPLICATION_ID, but webhook payloads expect an installation ID (and the workflow already definesTEST_GITHUB_SECOND_REPO_INSTALLATION_IDseparately). Using the application ID here will make the controller fail to generate an app token / resolve the installation. Please switch to the correct env var (installation ID) consistently for both the payload and thepayload.Sendheader argument.
installID, err := strconv.ParseInt(os.Getenv("TEST_GITHUB_SECOND_APPLICATION_ID"), 10, 64)
assert.NilError(t, err)
event := github.IssueCommentEvent{
Comment: &github.IssueComment{
Body: github.Ptr(`/ok-to-test`),
},
Installation: &github.Installation{
ID: &installID,
},
test/github_pullrequest_rerequest_test.go:60
- This test uses
TEST_GITHUB_SECOND_APPLICATION_IDto populategithub.Installation.IDand to set theX-GitHub-Hook-Installation-Target-IDheader (viapayload.Send). Those are not the GitHub App application ID; they should be the app installation ID (the workflow providesTEST_GITHUB_SECOND_REPO_INSTALLATION_ID). Using the application ID will break webhook processing/token generation.
installID, err := strconv.ParseInt(os.Getenv("TEST_GITHUB_SECOND_APPLICATION_ID"), 10, 64)
assert.NilError(t, err)
event := github.CheckRunEvent{
Action: github.Ptr("rerequested"),
Installation: &github.Installation{
ID: &installID,
},
CheckRun: &github.CheckRun{
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Move more tests to GHE, avoiding as much as possible GitHUb.com, and using the local GHE instance instead. Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
dcf065a to
2b7e358
Compare

📝 Description of the Change
Reenable Btibucket DC since we have finally renewed license.
Move more tests to GHE, avoiding as much as possible GitHUb.com, and
using the local GHE instance instead.
👨🏻 Linked Jira
🔗 Linked GitHub Issue
Fixes #
🚀 Type of Change
fix:)feat:)feat!:,fix!:)docs:)chore:)refactor:)enhance:)deps:)🧪 Testing Strategy
🤖 AI Assistance
If you have used AI assistance, please provide the following details:
Which LLM was used?
Extent of AI Assistance:
Important
If the majority of the code in this PR was generated by an AI, please add a
Co-authored-bytrailer 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.shto automatically addthese co-author trailers to your commits.
✅ Submitter Checklist
fix:,feat:) matches the "Type of Change" I selected above.make testandmake lintlocally to check for and fix anyissues. For an efficient workflow, I have considered installing
pre-commit and running
pre-commit installtoautomate these checks.