fix: externalize update notifier worker - #81
Conversation
|
Important Review skippedNo new commits to review since the last review. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe update notifier now supports injected dependencies for testing, remains external in the Bun build, and has unit coverage for creation, interactive-mode gating, environment-variable disabling, and deferred global notifications. ChangesUpdate notifier integration
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/unit/update-check.test.ts`:
- Around line 30-34: Update the factoryOptions assertion in the update-check
test to replace the hardcoded pkg.version value with expect.any(String), while
keeping the package name and all other expected options unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: eb7b85a9-1734-4645-86ac-548f29e87783
📒 Files selected for processing (3)
package.jsonsrc/lib/update-check.tstests/unit/update-check.test.ts
c3a7353 to
197ab7d
Compare
|
CodeRabbit (@coderabbitai) review |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/unit/update-check.test.ts`:
- Around line 6-14: Update the test setup around previousOptOut and afterEach to
add per-test initialization that clears PHOTON_NO_UPDATE_NOTIFIER before each
test runs, while retaining restoration of the captured original baseline in
afterEach. Ensure startUpdateNotifier tests execute without inheriting the
developer or CI environment value.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: d324ecbf-a4b0-4577-a4d1-422c7a61c952
📒 Files selected for processing (3)
package.jsonsrc/lib/update-check.tstests/unit/update-check.test.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- package.json
- src/lib/update-check.ts
✅ Action performedReview finished.
|
197ab7d to
5c35c15
Compare
|
CodeRabbit (@coderabbitai) review |
✅ Action performedReview finished.
|
…kflow (#93) buildspace commit 2535977 (Jul 17) added a github-packages-publish job with 'permissions: packages: write' to typescript-service-release.yaml. GitHub validates called-workflow job permissions against the caller's grant when the workflow graph is compiled — even for jobs skipped via 'if:' — so every push to main since then died with startup_failure (runs for #79, #81, #82) and no release was published. Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Summary
update-notifierexternal when building the published JavaScript CLInode_modules/update-notifier/check.jsWhy
update-notifierlaunches itscheck.jsfile as a detached process. Bundling the dependency intodist/photon.jsremoved that physical file, so the background check silently failed. The published CLI now resolves the existing dependency at runtime, where the worker remains available.Upstream version
@photon-ai/dashboard-api@1.6.12)Routes added/removed/changed
Snapshot changes
New runtime dependencies
update-notifierwas already a runtime dependencyTesting
bun run check— 48 tests passednode_modules/update-notifier/check.jsdist/photon.jsretains an external runtime import forupdate-notifierScope
This fixes package-manager installations of the JavaScript CLI. Bun single-file standalone binaries do not ship an external
node_modulesworker; standalone updating is handled separately by the forthcomingphoton updatecommand.Checklist
@photon-ai/dashboard-apiversion bump, not hand edits (no API type changes)bun run checkpasses locallyLinear: ENG-2014
Summary by CodeRabbit
PHOTON_NO_UPDATE_NOTIFIERopt-out, while still issuing deferred global notifications.PHOTON_NO_UPDATE_NOTIFIERis set.