Skip to content

fix(bin): skip manifest app close hooks#5901

Closed
killagu wants to merge 1 commit intonextfrom
agent/egg-dev/fa13d700
Closed

fix(bin): skip manifest app close hooks#5901
killagu wants to merge 1 commit intonextfrom
agent/egg-dev/fa13d700

Conversation

@killagu
Copy link
Copy Markdown
Contributor

@killagu killagu commented Apr 27, 2026

Summary

  • skip app.close() in the metadata-only manifest subprocess after manifest write succeeds
  • add an egg-bin manifest regression fixture that registers a failing beforeClose hook during loadMetadata and verifies manifest generation still succeeds

Tests

  • pnpm --filter @eggjs/bin exec vitest run test/commands/manifest.test.ts
  • pnpm --filter @eggjs/bin run typecheck
  • pnpm exec oxfmt --check tools/egg-bin/scripts/manifest-generate.mjs tools/egg-bin/test/commands/manifest.test.ts tools/egg-bin/test/fixtures/manifest-skip-close/app.js tools/egg-bin/test/fixtures/manifest-skip-close/config/config.default.js tools/egg-bin/test/fixtures/manifest-skip-close/package.json
  • pnpm exec oxlint --type-aware tools/egg-bin/scripts/manifest-generate.mjs tools/egg-bin/test/commands/manifest.test.ts tools/egg-bin/test/fixtures/manifest-skip-close/app.js tools/egg-bin/test/fixtures/manifest-skip-close/config/config.default.js

Refs EGG-18.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 27, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5cf107f7-4461-4170-b47b-c2ec8929c4cd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/egg-dev/fa13d700

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 and usage tips.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying egg with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2f967a4
Status: ✅  Deploy successful!
Preview URL: https://3f2377af.egg-cci.pages.dev
Branch Preview URL: https://agent-egg-dev-fa13d700.egg-cci.pages.dev

View logs

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.51%. Comparing base (57507ea) to head (2f967a4).
⚠️ Report is 18 commits behind head on next.

Additional details and impacted files
@@           Coverage Diff           @@
##             next    #5901   +/-   ##
=======================================
  Coverage   85.51%   85.51%           
=======================================
  Files         662      662           
  Lines       18876    18876           
  Branches     3662     3662           
=======================================
  Hits        16142    16142           
  Misses       2361     2361           
  Partials      373      373           

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request modifies the manifest generation process to skip application beforeClose hooks by removing the app.close() call and exiting the process directly. This change ensures that metadata-only subprocesses do not attempt to execute cleanup logic that may rely on a full runtime state. A comprehensive test suite and fixtures have been added to verify this behavior. I have no feedback to provide.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying egg-v3 with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2f967a4
Status: ✅  Deploy successful!
Preview URL: https://9e096b54.egg-v3.pages.dev
Branch Preview URL: https://agent-egg-dev-fa13d700.egg-v3.pages.dev

View logs

@killagu
Copy link
Copy Markdown
Contributor Author

killagu commented May 1, 2026

Superseded by #5904. Rebuilt this as a smaller core-level fix on top of current next so the metadataOnly close behavior is addressed in one place.

@killagu killagu closed this May 1, 2026
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.

1 participant