Skip to content

Conversation

theakshaypant
Copy link
Contributor

@theakshaypant theakshaypant commented Oct 10, 2025

📝 Description of the Change

  • The --namespace/-n flag was incorrectly bound to the same variable as --kubeconfig, causing namespace values to overwrite the kubeconfig path
  • Fixed template condition to display repos when count > 0
  • Added tests for using kube flags with tkn-pac

Tested on local openshift cluster using latest pac and pipelines for issue reproduction
image

👨🏻‍ Linked Jira

https://issues.redhat.com/browse/SRVKP-7152

🔗 Linked GitHub Issue

N/A

🚀 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 [email protected]
Co-authored-by: ChatGPT [email protected]
Co-authored-by: Claude [email protected]
Co-authored-by: Cursor [email protected]
Co-authored-by: Copilot [email protected]

**💡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

- The --namespace/-n flag was incorrectly bound to the same variable as
--kubeconfig, causing namespace values to overwrite the kubeconfig
path
- Fixed template condition to display repos when count > 0
- Added tests for using kube flags with tkn-pac

Jira: https://issues.redhat.com/browse/SRVKP-7152

Signed-off-by: Akshay Pant <[email protected]>
Assisted-by: Claude-Sonnet-4.5 (via Cursor)
Copy link

Summary of Changes

Hello @theakshaypant, 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 addresses a critical bug in the tkn-pac CLI where the --namespace flag was incorrectly overriding the --kubeconfig path due to a binding error. It also refines a template condition to ensure repositories are displayed as expected. Comprehensive unit tests have been added to prevent regressions and confirm the proper functioning of these CLI flags.

Highlights

  • CLI Flag Binding Fix: Corrected an issue where the --namespace (-n) flag was erroneously bound to the same variable as --kubeconfig, preventing proper handling of both flags simultaneously.
  • Template Display Logic: Adjusted the template condition for displaying repositories to correctly show them when the count is greater than zero, rather than greater than one.
  • Enhanced Test Coverage: Introduced new unit tests to validate the correct behavior of Kubernetes-related flags (--namespace, --kubeconfig) within the tkn-pac CLI.
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.

@chmouel
Copy link
Member

chmouel commented Oct 10, 2025

/ok-to-test

Copy link

@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 correctly fixes a bug where the --namespace flag was overwriting the --kubeconfig value due to incorrect flag binding. The change to the template logic to display repositories is also correct. The addition of tests to cover the flag behavior is a great improvement. I've added one suggestion to make the new tests even more robust by ensuring a deterministic test environment and verifying default values.

- Set environment variables for HOME and KUBECONFIG in the test.
- Updated test cases to use dynamic kubeconfig paths instead of hardcoded
values.
- Ensured that the expected configuration path reflects the changes in the
test cases.

This improves the flexibility and maintainability of the tests.

Signed-off-by: Akshay Pant <[email protected]>
Assisted-by: Gemini [email protected]
@zakisk zakisk merged commit f8c4367 into openshift-pipelines:main Oct 13, 2025
6 of 9 checks passed
@theakshaypant theakshaypant deleted the SRVKP-7152-fix-cli-namespace-flag branch October 13, 2025 07:28
@zakisk
Copy link
Contributor

zakisk commented Oct 13, 2025

@theakshaypant we follow one commit for one fix/feature way, I've squashed it please keep in mind!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants