Skip to content

fix: support HTTP middleware metadata instances#130

Merged
VikramAditya33 merged 1 commit into
FOSSFORGE:mainfrom
lisiqi1983:codex/http-metadata-instances
May 13, 2026
Merged

fix: support HTTP middleware metadata instances#130
VikramAditya33 merged 1 commit into
FOSSFORGE:mainfrom
lisiqi1983:codex/http-metadata-instances

Conversation

@lisiqi1983
Copy link
Copy Markdown
Contributor

@lisiqi1983 lisiqi1983 commented May 13, 2026

Summary

  • allow HTTP route metadata guards, pipes, and exception filters to be class providers or pre-built instances
  • resolve instance metadata directly before falling back to ModuleRef for class providers
  • add regression coverage for guard, pipe, and exception filter instances

Fixes #128

Verification

  • npm test -- --runInBand src/http/routing/route-registry-middleware.spec.ts
  • npx tsc -p tsconfig.build.json --noEmit
  • npx eslint src/http/routing/route-registry.ts src/http/routing/route-registry-middleware.spec.ts
  • npx prettier --check src/http/routing/route-registry.ts src/http/routing/route-registry-middleware.spec.ts
  • git diff --check -- src/http/routing/route-registry.ts src/http/routing/route-registry-middleware.spec.ts

Summary by CodeRabbit

  • New Features
    • Route middleware configuration now accepts both class constructors and pre-instantiated objects for guards, pipes, and exception filters, enabling greater flexibility in middleware setup.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

Important

Review skipped

Auto reviews are disabled on this repository. 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 638f7c54-9c8d-453a-94b2-7f6e3ee76714

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

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

@VikramAditya33
Copy link
Copy Markdown
Collaborator

@lisiqi1983 Are you done with this PR so that I can review or is anything left?

@lisiqi1983 lisiqi1983 marked this pull request as ready for review May 13, 2026 06:00
@lisiqi1983
Copy link
Copy Markdown
Contributor Author

Thanks, this is ready for review now. I marked it ready and the verification steps are listed in the PR body.

@VikramAditya33 VikramAditya33 self-requested a review May 13, 2026 06:01
Copy link
Copy Markdown
Collaborator

@VikramAditya33 VikramAditya33 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, the instance resolution logic and tests look alright. I've left an inline comment for a fix please take a look and also comment under the issue so that I can assign this issue to you.

Comment thread src/http/routing/route-registry.ts Outdated
Copy link
Copy Markdown
Collaborator

@VikramAditya33 VikramAditya33 left a comment

Choose a reason for hiding this comment

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

LGTM, Thank you. Could you please squash your commits into one?

@lisiqi1983 lisiqi1983 force-pushed the codex/http-metadata-instances branch from 623a2fa to bf8c769 Compare May 13, 2026 10:05
@lisiqi1983
Copy link
Copy Markdown
Contributor Author

Thanks, done — I squashed the PR down to a single commit while keeping the same tested changes.

@VikramAditya33
Copy link
Copy Markdown
Collaborator

Thank you LGTM

@VikramAditya33 VikramAditya33 merged commit b420940 into FOSSFORGE:main May 13, 2026
4 checks passed
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.

RouteRegistry fails to handle instances in guards/pipes/filters metadata

2 participants