Skip to content

Test Express not-found delegation - #1225

Merged
dahlia merged 1 commit into
fedify-dev:mainfrom
Lumia1108:issue-857-test-not-found-delegation
Oct 4, 2026
Merged

dahlia merged 1 commit into
fedify-dev:mainfrom
Lumia1108:issue-857-test-not-found-delegation

Conversation

@Lumia1108

@Lumia1108 Lumia1108 commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

@fedify/express delegates requests that Fedify does not own to subsequent Express handlers by calling next() from onNotFound. This behavior did not have a focused test, so normal route delegation could regress unnoticed.

This adds a test that makes a mock federation use onNotFound and verifies that integrateFederation() calls Express next().

Closes #857.

Testing

  • mise run check-each express
  • mise run test:deno packages/express/src/index.test.ts
  • mise run test-each express

AI assistance

I used Codex with the gpt-5.6-sol model to understand the relevant code, review the final diff, and improve my draft implementation. I wrote the final code myself and verified it locally.

@netlify

netlify Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for fedify-json-schema canceled.

Name Link
🔨 Latest commit bb87581
🔍 Latest deploy log https://app.netlify.com/projects/fedify-json-schema/deploys/6ac2619f93bad20008637dd0

@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: d6951103-5189-475e-ba63-a7a4f1475941
📥 Commits

Reviewing files that changed from the base of the PR and between 111f094 and 8c11f7d.

📒 Files selected for processing (1)
  • packages/express/src/index.test.ts

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


📝 Walkthrough

Walkthrough

Adds a test in packages/express/src/index.test.ts that checks whether the middleware calls Express next() when federation.fetch() invokes onNotFound.

Changes

Express not-found delegation

Layer / File(s) Summary
Verify not-found delegation
packages/express/src/index.test.ts
Adds a test that waits for onNotFound to run, then asserts that the middleware called next().

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~4 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to 8c11f

This change adds regression coverage for Express route delegation without changing runtime behavior. No actionable merge risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Issue [#857] requires a focused test in packages/express/src/index.test.ts that verifies integrateFederation() calls next() when federation.fetch() uses onNotFound. The added test invokes th…
Out of Scope Changes check ✅ Passed The reviewed change adds only the test for issue [#857]. The test directly covers the requested Express route-delegation behavior. No unrelated changes are present in the reviewed file.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Title check ✅ Passed The title clearly describes the focused test for Express not-found delegation, which is the main change.
Description check ✅ Passed The description explains the test, the next() behavior it verifies, and the reported test commands. It is related to the changeset.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • 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.

@codecov

codecov Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dahlia dahlia self-assigned this Oct 4, 2026
@dahlia dahlia added component/integration Web framework integration integration/express Express.js integration (@fedify/express) labels Oct 4, 2026
@dahlia dahlia added this to the Fedify 2.5 milestone Oct 4, 2026

@dahlia dahlia left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The test looks good and covers #857. Please update the AI disclosure in the PR description and the commit's Assisted-by trailer to specify which GPT-5.6 model you used: Luna, Terra, or Sol. For example, if you used Sol, the trailer should be Assisted-by: Codex:gpt-5.6-sol.

Verify that the Express integration calls `next()` when `Federation.fetch()` uses `onNotFound`, so normal route delegation cannot regress unnoticed.

fedify-dev#857

Assisted-by: Codex:gpt-5.6-sol
@Lumia1108
Lumia1108 force-pushed the issue-857-test-not-found-delegation branch from 8c11f7d to bb87581 Compare October 4, 2026 14:24
@Lumia1108

Copy link
Copy Markdown
Contributor Author

I updated the PR description and the commit's Assisted-by trailer to specify gpt-5.6-sol. Thanks!

@dahlia dahlia left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@dahlia
dahlia merged commit 8ebff09 into fedify-dev:main Oct 4, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/integration Web framework integration integration/express Express.js integration (@fedify/express)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test not-found delegation in @fedify/express

2 participants