Skip to content

Rework ChainInterceptor + configuration logic (Breaking Change)#2720

Merged
christiangoerdes merged 2 commits into
masterfrom
chain-rework
Feb 2, 2026
Merged

Rework ChainInterceptor + configuration logic (Breaking Change)#2720
christiangoerdes merged 2 commits into
masterfrom
chain-rework

Conversation

@christiangoerdes

@christiangoerdes christiangoerdes commented Jan 30, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Refactor
    • Simplified chain definition syntax in configuration files.
    • Updated API routing mechanism to use direct path-based references instead of chain indirection.
    • Enhanced documentation for flow configuration.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Jan 30, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This refactoring removes the ChainDef class and the reference-based chain resolution mechanism from ChainInterceptor, replacing chain references with direct, flatter reference compositions in configuration files. Chain definitions are now expressed using simpler $ref syntax rather than nested chain reference structures.

Changes

Cohort / File(s) Summary
Core Chain Mechanism Removal
core/src/main/java/com/predic8/membrane/core/interceptor/chain/ChainDef.java
Deleted the ChainDef class entirely, which previously provided reusable chain definitions with interceptor lists and reference attributes.
Chain Interceptor Refactoring
core/src/main/java/com/predic8/membrane/core/interceptor/chain/ChainInterceptor.java
Removed the ref field and all reference resolution logic, including the init() override, getInterceptorChainForRef(), getBean() helper, and public setRef()/getRef() accessors.
Documentation Enhancement
core/src/main/java/com/predic8/membrane/core/interceptor/.../AbstractFlowWithChildrenInterceptor.java
Added JavaDoc documentation to the setFlow() method describing its purpose for configuring interceptor flow.
Configuration Examples Update
distribution/examples/extending-membrane/reusable-plugin-chains/apis.yaml, distribution/examples/extending-membrane/reusable-plugin-chains/proxies.xml
Replaced chainDef with chain declarations and converted nested chain references to direct $ref pointers. Updated API routing from chain-based to path-based composition with explicit interceptor references.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • rrayst

Poem

🐰 Chains no longer dance through refs so deep,
Now simpler paths the configs keep,
With $ref pointers, flat and clean,
The cleanest flow we've ever seen! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: removing the ChainDef class and reworking ChainInterceptor configuration logic, and appropriately flags it as a breaking change.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chain-rework

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.

@membrane-ci-server

Copy link
Copy Markdown

This pull request needs "/ok-to-test" from an authorized committer.

@christiangoerdes

Copy link
Copy Markdown
Collaborator Author

/ok-to-test

@christiangoerdes christiangoerdes merged commit a8b1505 into master Feb 2, 2026
4 checks passed
@christiangoerdes christiangoerdes deleted the chain-rework branch February 2, 2026 07:21
@coderabbitai coderabbitai Bot mentioned this pull request Feb 11, 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.

2 participants