feat(service-logs): format JSON object messages - #3012
Conversation
|
View your CI Pipeline Execution ↗ for commit 7ec1797
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
All reported issues were addressed across 4 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
f6594ac to
3ba648e
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## staging #3012 +/- ##
===========================================
+ Coverage 51.73% 52.11% +0.37%
===========================================
Files 1356 1280 -76
Lines 29434 28184 -1250
Branches 8714 8554 -160
===========================================
- Hits 15227 14687 -540
+ Misses 11711 11071 -640
+ Partials 2496 2426 -70
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.
1 issue found across 4 files (changes from recent commits).
Confidence score: 4/5
- In
format-object-log-message.ts, Unicode case folding can shiftmatchIndexfor text after characters such asİ, causing search highlights to point at the wrong rendered text; use an index-preserving case-insensitive matcher or retain an index mapping.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="libs/domains/service-logs/feature/src/lib/list-service-logs/row-service-logs/format-object-log-message.ts">
<violation number="1" location="libs/domains/service-logs/feature/src/lib/list-service-logs/row-service-logs/format-object-log-message.ts:121">
P2: Unicode case folding can make `matchIndex` no longer index `rawMessage`, so searches after characters such as `İ` highlight the wrong rendered text. Use an index-preserving case-insensitive matcher or retain a mapping from normalized offsets back to original offsets.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
| const ranges: HighlightRange[] = [] | ||
| const normalizedSearchTerm = searchTerm.toLowerCase() | ||
| const searchableMessage = sourceMap ? rawMessage : message | ||
| const normalizedMessage = searchableMessage.toLowerCase() |
There was a problem hiding this comment.
P2: Unicode case folding can make matchIndex no longer index rawMessage, so searches after characters such as İ highlight the wrong rendered text. Use an index-preserving case-insensitive matcher or retain a mapping from normalized offsets back to original offsets.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At libs/domains/service-logs/feature/src/lib/list-service-logs/row-service-logs/format-object-log-message.ts, line 121:
<comment>Unicode case folding can make `matchIndex` no longer index `rawMessage`, so searches after characters such as `İ` highlight the wrong rendered text. Use an index-preserving case-insensitive matcher or retain a mapping from normalized offsets back to original offsets.</comment>
<file context>
@@ -1,13 +1,140 @@
+ const ranges: HighlightRange[] = []
+ const normalizedSearchTerm = searchTerm.toLowerCase()
+ const searchableMessage = sourceMap ? rawMessage : message
+ const normalizedMessage = searchableMessage.toLowerCase()
+ let matchIndex = normalizedMessage.indexOf(normalizedSearchTerm)
+
</file context>
There was a problem hiding this comment.
All reported issues were addressed across 4 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
rmnbrd
left a comment
There was a problem hiding this comment.
Looks good to me 👍
Maybe it's worth considering using an external lib instead of having our custom formatter if we ever encounter some odd edge cases.
|
🎉 This PR is included in version 1.363.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
https://qovery.atlassian.net/browse/QOV-1349
Screenshots / Recordings
Testing
PR Checklist
.cursor/rules)