feat: keep the console log text only and make pytest log json only#1297
feat: keep the console log text only and make pytest log json only#1297dbasunag wants to merge 3 commits intoopendatahub-io:mainfrom
Conversation
|
The following are automatically added/executed:
Available user actions:
Supported labels{'/verified', '/hold', '/wip', '/build-push-pr-image', '/cherry-pick', '/lgtm'} |
Signed-off-by: Debarati Basu-Nag <dbasunag@redhat.com> Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Debarati Basu-Nag <dbasunag@redhat.com> Co-Authored-By: Claude <noreply@anthropic.com>
28998aa to
4e8878c
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughDecouples formatting from queue transport: introduces Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Actionable Issues
🚥 Pre-merge checks | ✅ 1 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@utilities/logger.py`:
- Around line 33-39: PassthroughQueueHandler.prepare currently clears
record.exc_info after populating record.exc_text, but ThirdPartyJSONFormatter
and ThirdPartyHumanReadableFormatter only format record.getMessage() so
tracebacks get dropped; update PassthroughQueueHandler.prepare to append
record.exc_text (when present) onto the record message (e.g., combine into
record.msg or record.__dict__['message']) before setting record.exc_info = None,
and also ensure the alternate prepare block at the other location (lines
102–106) does the same; alternatively, modify ThirdPartyJSONFormatter.format and
ThirdPartyHumanReadableFormatter.format to include record.exc_text in their
output when present.
In `@utilities/opendatahub_logger.py`:
- Around line 163-172: The plain-text renderer and StructlogWrapper._log() are
leaking secrets because they use f"{k}={v}" which uses str() and bypasses
RedactedString.__repr__; change both sites to format values with repr() (e.g.,
use f"{k}={v!r}" or explicitly repr(v)) so RedactedString's redaction is honored
when building extras and log messages; update _plain_text_renderer (function
name _plain_text_renderer) and the StructlogWrapper._log method to use repr()
for each value when joining event_dict items.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: ae341550-b7a4-4c27-ab3c-f53acffd8eab
📒 Files selected for processing (2)
utilities/logger.pyutilities/opendatahub_logger.py
Signed-off-by: Debarati Basu-Nag <dbasunag@redhat.com> Co-Authored-By: Claude <noreply@anthropic.com>
Pull Request
Summary
Related Issues
Please review and indicate how it has been tested
Additional Requirements
Summary by CodeRabbit
Refactor
Bug Fixes