fix example tests#2610
Conversation
📝 WalkthroughWalkthroughRouter initialization wiring changed: RouterCLI now assigns a BeanRegistryImplementation to the Router before bean registration; KubernetesWatcher now obtains the registry from Changes
Sequence Diagram(s)(omitted) Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
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 |
|
/ok-to-test |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
core/src/main/java/com/predic8/membrane/core/kubernetes/KubernetesWatcher.java (1)
20-20: Unused import:BeanRegistryImplementation.This import is no longer needed since the code now obtains the registry from
router.getRegistry()rather than instantiatingBeanRegistryImplementationdirectly.🧹 Suggested cleanup
-import com.predic8.membrane.annot.beanregistry.BeanRegistryImplementation;
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
core/src/main/java/com/predic8/membrane/core/cli/RouterCLI.javacore/src/main/java/com/predic8/membrane/core/kubernetes/KubernetesWatcher.java
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-01-03T19:24:51.595Z
Learnt from: predic8
Repo: membrane/api-gateway PR: 2529
File: annot/src/main/java/com/predic8/membrane/annot/beanregistry/BeanRegistryImplementation.java:168-172
Timestamp: 2026-01-03T19:24:51.595Z
Learning: In BeanRegistryImplementation, the `getOrCreate(BeanRegistry, Grammar)` method on BeanContainer is guaranteed to always return a non-null object or throw an exception, so null filtering after calling getOrCreate is not necessary.
Applied to files:
core/src/main/java/com/predic8/membrane/core/cli/RouterCLI.javacore/src/main/java/com/predic8/membrane/core/kubernetes/KubernetesWatcher.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Automated tests
- GitHub Check: Analyze (java)
🔇 Additional comments (2)
core/src/main/java/com/predic8/membrane/core/cli/RouterCLI.java (1)
166-179: LGTM! Registry initialization ordering is correct.Setting the registry on the router before bean registration ensures that
router.getRegistry()returns the correct instance when called by other components (e.g.,KubernetesWatcher). The initialization sequence is sound: create registry → set on router → register beans → parse config → finalize → start.core/src/main/java/com/predic8/membrane/core/kubernetes/KubernetesWatcher.java (1)
50-52: The null safety and type safety concerns are not valid.DefaultMainComponents.getRegistry()includes an explicit null guard (lines 179-182) that initializes the registry if needed, guaranteeing a non-null return. Additionally,BeanRegistryImplementationimplements bothBeanRegistryandBeanCollectorinterfaces, so the cast on line 52 is safe.Likely an incorrect or invalid review comment.
Summary by CodeRabbit
Refactor
Tests
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.