fix(logging): log sinker errors , emit event on repository config error#2848
fix(logging): log sinker errors , emit event on repository config error#2848aThorp96 wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2848 +/- ##
==========================================
+ Coverage 61.62% 61.67% +0.05%
==========================================
Files 213 213
Lines 17512 17523 +11
==========================================
+ Hits 10792 10808 +16
- Misses 5901 5902 +1
+ Partials 819 813 -6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new sentinel error ErrSecretNotFound in the secrets package and wraps repository secret retrieval errors with it. In the event sinker, if client setup fails due to a missing repository secret, a Kubernetes event is now emitted to notify the user. Additionally, a wrapper method handleEvent was added to centralize event processing error logging, and comprehensive unit tests were added to verify the new error handling behavior. There are no review comments, so I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Since `sinker.logger` is modified during `sinker.processEvent()`, if an error is returned from `processEvent()` it lacks these modifications (i.e. added context, like repository URL or commit sha) This change also improves the logging when PaC fails to process an event due to a misconfigured Repository CR. Specifically, when the required GitProvider.Secret is either unspecified or missing PaC will now emit an Event on the Repository CR. Events are a clearer signal to users than logs since tenants may be given access to events in their namespace whereas PaC logs are considered more sensitive
9bda827 to
73b9368
Compare
📝 Description of the Change
Since
sinker.loggeris modified duringsinker.processEvent(), if an error is returned fromprocessEvent()it lacks these modifications (i.e. added context, like repository URL or commit sha)This change also improves the logging when PaC fails to process an event due to a misconfigured Repository CR. Specifically, when the required GitProvider.Secret is either unspecified or missing PaC will now emit an Event on the Repository CR. Events are a clearer signal to users than logs since tenants may be given access to events in their namespace whereas PaC logs are considered more sensitive
🔗 Linked GitHub Issue
Fixes #
🧪 Testing Strategy
🤖 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.
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-bytrailer to your commit message.For example:
Co-authored-by: Claude noreply@anthropic.com
✅ 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.