Skip to content

fix(e2e): find controller in installation namespaces#2603

Merged
chmouel merged 1 commit intotektoncd:mainfrom
theakshaypant:fix-github-api-metric-collection
Mar 26, 2026
Merged

fix(e2e): find controller in installation namespaces#2603
chmouel merged 1 commit intotektoncd:mainfrom
theakshaypant:fix-github-api-metric-collection

Conversation

@theakshaypant
Copy link
Copy Markdown
Member

📝 Description of the Change

E2E instrumentation was broken because it searched for the controller in the test namespace (e.g., pac-e2e-ns-*), but controllers actually run in installation namespaces (pipelines-as-code or openshift-pipelines).

The fix iterates through info.InstallNamespaces to find the controller, restoring the original behavior that searched across all namespaces. Also fixed linter warning (interface{} to any).

🔗 Linked GitHub Issue

N/A

🧪 Testing Strategy

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

🤖 AI Assistance

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

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

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

Important

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

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

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

✅ Submitter Checklist

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

E2E instrumentation was broken because it searched for the
controller in the test namespace (e.g., pac-e2e-ns-*), but
controllers actually run in installation namespaces
(pipelines-as-code or openshift-pipelines).

The fix iterates through info.InstallNamespaces to find the
controller, restoring the original behavior that searched across
all namespaces. Also fixed linter warning (interface{} to any).

Signed-off-by: Akshay Pant <akpant@redhat.com>
Assisted-by: Claude <noreply@anthropic.com>
@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 resolves a critical issue in the end-to-end testing framework where the system failed to locate the controller for log collection, leading to broken instrumentation. The core change enables the test suite to correctly identify the controller by iterating through all potential installation namespaces, thereby restoring the reliability of E2E tests. A minor type declaration update was also included for code hygiene.

Highlights

  • E2E Instrumentation Fix: Corrected the logic for locating the controller in E2E tests by searching across all installation namespaces instead of a single test namespace, resolving broken instrumentation.
  • Linter Warning Resolution: Updated the type declaration from interface{} to any in JSON unmarshalling to address a linter warning and improve type clarity.
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.

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.

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 the collectGitHubAPICalls function to iterate through info.InstallNamespaces when attempting to retrieve controller logs, enhancing resilience by searching multiple namespaces until a controller is located. Additionally, it updates the parseAPICallLog function to use any instead of interface{} for map values, aligning with Go 1.18+ syntax. A potential bug was identified where the collectGitHubAPICalls function might incorrectly proceed if info.InstallNamespaces is empty, as the loop would be skipped and the error check would not catch the lack of a found controller.

@chmouel chmouel merged commit 182d181 into tektoncd:main Mar 26, 2026
22 of 23 checks passed
@theakshaypant theakshaypant deleted the fix-github-api-metric-collection branch March 27, 2026 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants