Skip to content

chore(status): migrate egg-status into monorepo - #6070

Merged
fengmk2 merged 2 commits into
mainfrom
codex/migrate-egg-status
Oct 7, 2026
Merged

fengmk2 merged 2 commits into
mainfrom
codex/migrate-egg-status

Conversation

@fengmk2

@fengmk2 fengmk2 commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

egg-status lives in a separate repository and uses the old middleware registration API. This change moves it into plugins/status as @eggjs/status for maintenance with the other plugins.

The package supports egg@4 and uses ESM and the plugin factory API. It registers the middleware in configWillLoad, immediately after meta. 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

  • New Features
    • Added a status-check plugin with a default /egg.status endpoint that reports whether the application is available based on configured status files.
    • Supports custom health-check paths, response keywords, HTTP status codes, and multiple status files.
  • Documentation
    • Added setup, configuration, deployment, and migration guidance for the status plugin.
  • Tests
    • Added coverage for default and custom health-check behavior, including available and unavailable responses.

Copilot AI balanced review requested due to automatic review settings October 7, 2026 07:29
@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ef9f8268-b287-4e17-9342-a51cd2dbeefa
📥 Commits

Reviewing files that changed from the base of the PR and between e701300 and 3bc4725.

📒 Files selected for processing (19)
  • plugins/status/CHANGELOG.md
  • plugins/status/LICENSE
  • plugins/status/README.md
  • plugins/status/package.json
  • plugins/status/src/app.ts
  • plugins/status/src/app/middleware/status.ts
  • plugins/status/src/config/config.default.ts
  • plugins/status/src/index.ts
  • plugins/status/src/types.ts
  • plugins/status/test/fixtures/apps/custom/config/config.default.ts
  • plugins/status/test/fixtures/apps/custom/config/plugin.ts
  • plugins/status/test/fixtures/apps/custom/package.json
  • plugins/status/test/fixtures/apps/default/app/router.ts
  • plugins/status/test/fixtures/apps/default/config/config.default.ts
  • plugins/status/test/fixtures/apps/default/config/plugin.ts
  • plugins/status/test/fixtures/apps/default/package.json
  • plugins/status/test/index.test.ts
  • plugins/status/tsconfig.json
  • tsconfig.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

Adds the @eggjs/status plugin. It registers middleware that checks configured status files for matching request paths and returns configured availability responses. The change includes default and custom configurations, tests, package metadata, and documentation.

Changes

Status health-check plugin

Layer / File(s) Summary
Plugin configuration and setup
plugins/status/src/config/*, plugins/status/src/types.ts, plugins/status/src/index.ts, plugins/status/src/app.ts, plugins/status/package.json, plugins/status/tsconfig.json, tsconfig.json, plugins/status/README.md, plugins/status/CHANGELOG.md, plugins/status/LICENSE
Adds the plugin factory, typed defaults, EggAppConfig.status augmentation, and lifecycle registration after meta. Adds package configuration, TypeScript project references, usage documentation, changelog, and MIT license.
Health-check request handling
plugins/status/src/app/middleware/status.ts
For configured paths, checks status files in order and returns the configured available or unavailable status and keyword. For other paths, calls next().
Configuration fixtures and behavior tests
plugins/status/test/fixtures/apps/*, plugins/status/test/index.test.ts
Adds default and custom app fixtures. Tests middleware ordering, status-file creation and removal, path matching, HEAD requests, downstream handling, and custom responses.

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
Loading

Merge Risk: ⚪ Minimal · up to 3bc47

The package metadata supports publication, and no actionable merge-blocking issue remains after normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning 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… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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 clearly identifies the migration of egg-status into the monorepo, which is the pull request’s primary change.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

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.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

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

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Deploying egg-v3 with  Cloudflare Pages  Cloudflare Pages

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

View logs

@codecov

codecov Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.99%. Comparing base (e701300) to head (3bc4725).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Deploying egg with  Cloudflare Pages  Cloudflare Pages

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

View logs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot AI balanced review requested due to automatic review settings October 7, 2026 07:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

Static review found no blocking issues; integration tests cover the migrated behavior but were not executed.

Review effort: Balanced
Findings: None

@killagu killagu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fengmk2
fengmk2 merged commit 86716cd into main Oct 7, 2026
40 checks passed
@fengmk2
fengmk2 deleted the codex/migrate-egg-status branch October 7, 2026 08:12
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.

3 participants