Repository navigation
chore(status): migrate egg-status into monorepo - #6070
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (19)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughAdds the ChangesStatus health-check plugin
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Other Sequence Diagram(s)sequenceDiagram
participant Application
participant StatusMiddleware
participant FileSystem
Application->>StatusMiddleware: Send request
alt Path matches configured status URL
StatusMiddleware->>FileSystem: Check configured files with fs.access
FileSystem-->>StatusMiddleware: Return file existence
StatusMiddleware->>Application: Return configured status and keyword
else Path does not match
StatusMiddleware->>Application: Call next()
end
Merge Risk: ⚪ Minimal · up to The package metadata supports publication, and no actionable merge-blocking issue remains after normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 11 files. (8 skipped: 8 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 |
Deploying egg-v3 with
|
| Latest commit: |
3bc4725
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://8ab1be76.egg-v3.pages.dev |
| Branch Preview URL: | https://codex-migrate-egg-status.egg-v3.pages.dev |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6070 +/- ##
==========================================
+ Coverage 83.61% 83.99% +0.38%
==========================================
Files 731 734 +3
Lines 22608 22635 +27
Branches 4554 4558 +4
==========================================
+ Hits 18903 19012 +109
+ Misses 3202 3130 -72
+ Partials 503 493 -10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Deploying egg with
|
| Latest commit: |
3bc4725
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1a120315.egg-cci.pages.dev |
| Branch Preview URL: | https://codex-migrate-egg-status.egg-cci.pages.dev |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
Static review found no blocking issues, and focused regression coverage is included, though tests were not executed.
Review effort: Balanced
Findings: None
What changed in this PR
Migrates egg-status into the monorepo as @eggjs/status, modernizing it for Egg 4 while preserving its health-check behavior.
Changes:
- Adds an ESM plugin factory, lifecycle registration, and TypeScript types.
- Covers default and custom health checks with regression tests.
- Adds packaging, migration instructions, and original license and changelog.
| File | Description |
|---|---|
| tsconfig.json | Adds the status project reference. |
| plugins/status/tsconfig.json | Inherits shared TypeScript settings. |
| plugins/status/test/index.test.ts | Tests registration and health-check behavior. |
| plugins/status/test/fixtures/apps/default/package.json | Defines the default fixture. |
| plugins/status/test/fixtures/apps/default/config/plugin.ts | Enables the plugin through its factory. |
| plugins/status/test/fixtures/apps/default/config/config.default.ts | Configures the default fixture. |
| plugins/status/test/fixtures/apps/default/app/router.ts | Provides downstream routing checks. |
| plugins/status/test/fixtures/apps/custom/package.json | Defines the custom fixture. |
| plugins/status/test/fixtures/apps/custom/config/plugin.ts | Enables the plugin by package name. |
| plugins/status/test/fixtures/apps/custom/config/config.default.ts | Configures custom paths, files, and responses. |
| plugins/status/src/types.ts | Adds Egg configuration types. |
| plugins/status/src/index.ts | Exports the plugin factory and configuration type. |
| plugins/status/src/config/config.default.ts | Defines health-check options and defaults. |
| plugins/status/src/app/middleware/status.ts | Implements file-based health responses. |
| plugins/status/src/app.ts | Registers middleware immediately after meta. |
| plugins/status/README.md | Documents usage, deployment, and migration. |
| plugins/status/package.json | Defines package exports and dependencies. |
| plugins/status/LICENSE | Preserves the original MIT license. |
| plugins/status/CHANGELOG.md | Preserves the original release history. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
egg-statuslives in a separate repository and uses the old middleware registration API. This change moves it intoplugins/statusas@eggjs/statusfor maintenance with the other plugins.The package supports
egg@4and uses ESM and the plugin factory API. It registers the middleware inconfigWillLoad, immediately aftermeta. The existing health-check paths, file checks, configuration keys, and response format stay the same. The package includes TypeScript types, usage instructions, and the original license and changelog.Summary by CodeRabbit
/egg.statusendpoint that reports whether the application is available based on configured status files.