-
Notifications
You must be signed in to change notification settings - Fork 52
chore: daemon logs #1017
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
chore: daemon logs #1017
Conversation
Tagging OptionsShould a new tag be published when this PR is merged?
|
WalkthroughAdds pervasive runtime logging across publish/build, meta watching, worker lifecycle, and port utilities; introduces worker startup error handling that rejects the startup promise on failure. No exported API or signature changes. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
daemon/workers/utils.ts (1)
7-9: Consider removing or reducing log verbosity in the polling loop.This function is called repeatedly inside
waitForPort's polling loop (line 25). Logging every failed connection attempt will flood the logs when waiting for a port to become available, especially with the 1-second polling interval.Consider one of these approaches:
- Remove this log entirely since
waitForPortalready logs the overall wait status- Move this logging to the caller level where it can be controlled contextually
Apply this diff to remove the noisy log:
- } catch (err) { - console.log(`[isListening] Error connecting to port ${port}:`, err); + } catch { return false; }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
daemon/git.ts(1 hunks)daemon/meta.ts(4 hunks)daemon/worker.ts(4 hunks)daemon/workers/utils.ts(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
daemon/meta.ts (3)
runtime/mod.ts (1)
meta(106-108)daemon/worker.ts (2)
worker(36-52)dispatchWorkerState(24-27)daemon/sse/channel.ts (1)
broadcast(9-11)
daemon/worker.ts (1)
daemon/workers/denoRun.ts (1)
DenoRun(48-190)
🔇 Additional comments (9)
daemon/workers/utils.ts (1)
17-48: LGTM! Good observability improvements.The logging additions provide excellent visibility into port waiting operations, including timing metrics and abort signal status. The timeout formatting change to
10_000improves readability.daemon/meta.ts (2)
68-93: LGTM! Excellent hang detection mechanism.The periodic warning timer provides valuable diagnostics for detecting when
meta.promiseis taking too long to resolve. The timer is properly cleaned up in thefinallyblock, and the logging includes useful elapsed time metrics.
95-154: LGTM! Comprehensive watcher lifecycle logging.The logging additions provide excellent visibility into the meta watcher's control flow, including attempt tracking, etag values, received metadata, and error conditions. The 404 handling is particularly well-logged before stopping the watcher.
daemon/worker.ts (4)
1-1: LGTM! Good TypeScript typing.Adding explicit
ContextandNexttypes improves type safety throughout the worker middleware.
36-52: LGTM! Clear worker lifecycle logging.The logging provides excellent visibility into the worker startup sequence with timing metrics. This will help diagnose slow worker initialization.
72-86: Excellent: Critical error handling prevents startup hangs.The try-catch wrapper with
wp.reject(error)is a crucial addition that prevents indefinite hangs when worker initialization fails. Without this, any code awaitingwp.promisewould hang forever on startup errors. The logging also provides clear diagnostics.
88-103: LGTM! Good initialization logging and type safety.The initialization log and explicit type annotations for middleware and handler parameters improve both observability and type safety.
daemon/git.ts (2)
193-226: LGTM! Comprehensive build pipeline logging.The logging provides excellent visibility into the asynchronous build lifecycle, including timing metrics, buildMap operations, and error conditions. This will help diagnose build issues and track concurrent builds.
228-270: Verify that logging author email doesn't violate privacy policies.The comprehensive logging provides excellent visibility into the publish workflow. However, line 235 logs the author object including the email address. Depending on your organization's privacy policies, logging email addresses (PII) may require additional safeguards or masking.
Consider whether the email should be redacted or if this logging is acceptable under your privacy policies. If PII logging is a concern, apply this diff:
console.log( - `[publish] Author: ${JSON.stringify(author)}, Message: "${message}"`, + `[publish] Author: ${author.name}, Message: "${message}"`, );
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.