Skip to content

fix: watcher secret creation log and osc link#2637

Merged
chmouel merged 1 commit intotektoncd:mainfrom
chmouel:watcher-console-fix
Apr 2, 2026
Merged

fix: watcher secret creation log and osc link#2637
chmouel merged 1 commit intotektoncd:mainfrom
chmouel:watcher-console-fix

Conversation

@chmouel
Copy link
Copy Markdown
Member

@chmouel chmouel commented Apr 2, 2026

📝 Description of the Change

Bug fixes for watcher secret creation logging and OpenShift console URL fallback handling.

Avoid logging a secret-creation failure when no error occurred in the watcher reconciler. After the secret creation flow moved into the reconciler, the error log ran even on success, which produced noisy messages such as "failed to create secret ...: ".

Also fix console URL fallback handling when config resets from a custom console or Tekton dashboard back to the default cluster console. Instead of creating an empty OpenShift console client and ignoring route lookup failures, rebuild the console UI through the normal detection path so we either use the discovered OpenShift console URL or fall back cleanly.

Add regression tests for both cases:

  • successful secret creation should not emit an error log
  • console reset should use the discovered OpenShift route when present
  • console reset should fall back cleanly when route lookup fails

Tested on dogfooding cluster.

🔗 Linked GitHub Issue

Fixes #2636

🧪 Testing Strategy

  • Unit tests
  • Manual testing
  • Integration tests
  • End-to-end tests
  • 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

@chmouel chmouel requested a review from zakisk April 2, 2026 09:26
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 2, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.80%. Comparing base (bdcbf41) to head (249d80f).

Files with missing lines Patch % Lines
pkg/reconciler/reconciler.go 0.00% 1 Missing and 1 partial ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2637      +/-   ##
==========================================
+ Coverage   58.73%   58.80%   +0.07%     
==========================================
  Files         206      206              
  Lines       20296    20296              
==========================================
+ Hits        11920    11935      +15     
+ Misses       7611     7589      -22     
- Partials      765      772       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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 console UI initialization in UpdatePacConfig to use a factory method and fixes a logging bug in the reconciler where errors were logged even on success. Specifically, it ensures that createSecretForPipelineRun errors are only logged when an actual unhandled error occurs. Additionally, new tests were added to verify the console UI reset logic and the corrected logging behavior in the reconciler. I have no feedback to provide.

Avoid logging a secret-creation failure when no error occurred in the
watcher reconciler. After the secret creation flow moved into the
reconciler, the error log ran even on success, which produced noisy
messages such as "failed to create secret ...: <nil>".

Also fix console URL fallback handling when config resets from a custom
console or Tekton dashboard back to the default cluster console. Instead
of creating an empty OpenShift console client and ignoring route lookup
failures, rebuild the console UI through the normal detection path so we
either use the discovered OpenShift console URL or fall back cleanly.

Add regression tests for both cases:
- successful secret creation should not emit an error log
- console reset should use the discovered OpenShift route when present
- console reset should fall back cleanly when route lookup fails

Tested on cluster
@zakisk zakisk force-pushed the watcher-console-fix branch from 614de4a to 249d80f Compare April 2, 2026 10:44
@chmouel chmouel merged commit ef85098 into tektoncd:main Apr 2, 2026
13 checks passed
@chmouel chmouel deleted the watcher-console-fix branch April 2, 2026 16:10
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.

Watcher shows false secret errors and broken console links after recent merge

3 participants