Tutorial: Include#3025
Conversation
|
Warning Review limit reached
More reviews will be available in 9 minutes and 6 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughA new advanced tutorial ( ChangesInclude Tutorial
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
distribution/src/test/java/com/predic8/membrane/tutorials/advanced/IncludeTutorialTest.java (1)
56-63: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert the global header on the 404 path too.
This tutorial is demonstrating a global response interceptor, but the fallback test only checks the status code. Adding the
X-Gatewayassertion here would catch regressions where the shared header stops applying to unmatched routes.Suggested change
given() .when() .get("http://localhost:2000/unknown") .then() - .statusCode(404); + .statusCode(404) + .header("X-Gateway", equalTo("Membrane"));🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@distribution/src/test/java/com/predic8/membrane/tutorials/advanced/IncludeTutorialTest.java` around lines 56 - 63, The fallback test in unknownPathReturns404 only verifies the 404 status and misses the shared response header from the global interceptor. Update the assertion in IncludeTutorialTest#unknownPathReturns404 to also check for the X-Gateway header, matching the coverage already used in the matched-route test so regressions in the global interceptor are caught for unmatched routes too.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@distribution/tutorials/advanced/95-Include.yaml`:
- Around line 23-26: The /unknown example in the tutorial is missing the
fallback response header, which makes the fallback flow look different from the
global interceptor behavior. Update the documented expected output for the
unknown-path curl example so it includes X-Gateway: Membrane, and make sure the
fallback API example matches the same header behavior as the global response
interceptor. Use the nearby interceptor/fallback sections in the tutorial to
keep the examples consistent.
---
Nitpick comments:
In
`@distribution/src/test/java/com/predic8/membrane/tutorials/advanced/IncludeTutorialTest.java`:
- Around line 56-63: The fallback test in unknownPathReturns404 only verifies
the 404 status and misses the shared response header from the global
interceptor. Update the assertion in IncludeTutorialTest#unknownPathReturns404
to also check for the X-Gateway header, matching the coverage already used in
the matched-route test so regressions in the global interceptor are caught for
unmatched routes too.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 7080cf1d-9877-4a5b-a461-5e2d2abb2ac0
📒 Files selected for processing (4)
distribution/src/test/java/com/predic8/membrane/tutorials/advanced/IncludeTutorialTest.javadistribution/tutorials/advanced/95-Include.yamldistribution/tutorials/advanced/apis/customers.yamldistribution/tutorials/advanced/apis/orders.yaml
|
/ok-to-test |
Summary by CodeRabbit
New Features
/customersand/orders, each returning JSON data with a 200 response.X-Gateway: Membraneheader and request logging in the tutorial flow.Tests