Skip to content

fix: add custom Monaco language support for deployment logs#2724

Merged
baktun14 merged 1 commit intomainfrom
fix/deploy-logs-colors
Feb 13, 2026
Merged

fix: add custom Monaco language support for deployment logs#2724
baktun14 merged 1 commit intomainfrom
fix/deploy-logs-colors

Conversation

@baktun14
Copy link
Contributor

@baktun14 baktun14 commented Feb 12, 2026

image

Summary by CodeRabbit

Release Notes

  • New Features
    • Added custom syntax highlighting for deployment logs, improving readability by visually distinguishing log entries, service names, warnings, and event types in the editor.

@baktun14 baktun14 requested a review from a team as a code owner February 12, 2026 22:02
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 12, 2026

📝 Walkthrough

Walkthrough

The PR introduces log language support to the Monaco Editor component. This adds a custom Monarch tokenizer for log syntax highlighting, expands the language type options to include "log", imports the log definitions module, and integrates it into the DeploymentLogs component.

Changes

Cohort / File(s) Summary
Log Language Definition
apps/deploy-web/src/components/shared/DynamicMonacoEditor/monaco-log-definitions.ts
New module defining a custom Monarch language tokenizer for logs with rules for classifying service names, warning/normal keywords, type brackets, and string content.
Monaco Editor Infrastructure
apps/deploy-web/src/components/shared/DynamicMonacoEditor/monaco-editor.ts, apps/deploy-web/src/components/shared/DynamicMonacoEditor/DynamicMonacoEditor.tsx
Imported log-definitions module and expanded Language prop type to accept "log" as a valid language option alongside "yaml" and "plaintext".
Deployment Logs Consumer
apps/deploy-web/src/components/deployments/DeploymentLogs.tsx
Applied the new "log" language to the MemoMonaco editor instance for syntax highlighting deployment logs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 With whiskers twitching and joy to share,
A log language brightens code everywhere!
Monarch tokens dance in patterns divine,
Each deployment log will shimmer and shine.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding custom Monaco language support for deployment logs to enable syntax highlighting.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/deploy-logs-colors

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
apps/deploy-web/src/components/shared/DynamicMonacoEditor/monaco-log-definitions.ts (2)

14-19: Consider aligning the [type] regex with the service name pattern.

The service name pattern on line 15 uses [\w.-]+ to match word characters, dots, and hyphens, but the generic type pattern on line 18 only uses [\w]+. If event types can contain dots or hyphens (similar to service names), they won't be highlighted correctly.

♻️ Suggested fix to align patterns
     root: [
       [/^\[[\w.-]+\]:/, "namespace"],
       [/\[Warning\]/, "keyword"],
       [/\[Normal\]/, "string"],
-      [/\[[\w]+\]/, "type"],
+      [/\[[\w.-]+\]/, "type"],
       [/[^\[]+/, "string"]
     ]

8-8: Remove the unnecessary ESLint disable directive.

The escape sequences (\[, \]) in the regex patterns are indeed necessary for matching literal brackets (lines 15–19). Since ESLint's no-useless-escape rule should not flag necessary bracket escapes in regex, this directive suppresses no violations and can be removed.


Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

❌ Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.44%. Comparing base (d20789c) to head (e3370cc).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...ared/DynamicMonacoEditor/monaco-log-definitions.ts 0.00% 5 Missing ⚠️
...onents/shared/DynamicMonacoEditor/monaco-editor.ts 0.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the target coverage.
❌ Your project status has failed because the head coverage (75.19%) is below the target coverage (78.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2724      +/-   ##
==========================================
- Coverage   52.24%   51.44%   -0.80%     
==========================================
  Files        1057     1023      -34     
  Lines       28032    27206     -826     
  Branches     6357     6262      -95     
==========================================
- Hits        14644    13997     -647     
+ Misses      12953    12783     -170     
+ Partials      435      426       -9     
Flag Coverage Δ *Carryforward flag
api 75.19% <ø> (ø) Carriedforward from d20789c
deploy-web 37.17% <0.00%> (-0.03%) ⬇️
log-collector ?
notifications 87.94% <ø> (ø) Carriedforward from d20789c
provider-console 81.48% <ø> (ø) Carriedforward from d20789c
provider-proxy 84.35% <ø> (ø) Carriedforward from d20789c
tx-signer ?

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
...-web/src/components/deployments/DeploymentLogs.tsx 0.00% <ø> (ø)
...shared/DynamicMonacoEditor/DynamicMonacoEditor.tsx 17.24% <ø> (ø)
...onents/shared/DynamicMonacoEditor/monaco-editor.ts 0.00% <0.00%> (ø)
...ared/DynamicMonacoEditor/monaco-log-definitions.ts 0.00% <0.00%> (ø)

... and 37 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@baktun14 baktun14 merged commit fd94df9 into main Feb 13, 2026
49 of 53 checks passed
@baktun14 baktun14 deleted the fix/deploy-logs-colors branch February 13, 2026 16:39
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.

2 participants