[management] Revert "[management] allow local routing peer resource (#5814)"#5847
Conversation
This reverts commit 2a8aacc.
|
📝 WalkthroughWalkthroughThis PR removes the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
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. ✨ Finishing Touches📝 Generate docstrings
🧪 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.
🧹 Nitpick comments (1)
management/server/types/networkmap_components.go (1)
695-739: Consider splitting the router and source-peer paths.This function is still doing router membership detection, posture filtering, source-peer aggregation, and route materialization in one loop. Extracting the
addSourcePeersbranch and thepeer can consume resourcebranch into small helpers would make future changes here much easier to reason about.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@management/server/types/networkmap_components.go` around lines 695 - 739, The getNetworkResourcesRoutesToSync function is doing router membership detection, posture filtering, source-peer aggregation, and route materialization in one loop; extract and replace the two main branches into small helpers: create collectSourcePeersForResource(resource *NetworkResource, policy *ResourcePolicy, peers []string, addSourcePeers bool) which uses c.getPostureValidPeers and updates allSourcePeers, and create materializeRoutesForConsumingPeer(resource *NetworkResource, peerID string, networkRoutingPeers map[string]*Router, policy *ResourcePolicy) which checks slices.Contains(peers, peerID) and c.ValidatePostureChecksOnPeer and calls c.getNetworkResourcesRoutes for each router to append to routes; keep router detection (networkRoutingPeers, router, addSourcePeers) in getNetworkResourcesRoutesToSync and call these helpers inside the policy loop (use names ResourcePoliciesMap, getNetworkResourcesRoutes, getPostureValidPeers, ValidatePostureChecksOnPeer to locate relevant logic).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@management/server/types/networkmap_components.go`:
- Around line 695-739: The getNetworkResourcesRoutesToSync function is doing
router membership detection, posture filtering, source-peer aggregation, and
route materialization in one loop; extract and replace the two main branches
into small helpers: create collectSourcePeersForResource(resource
*NetworkResource, policy *ResourcePolicy, peers []string, addSourcePeers bool)
which uses c.getPostureValidPeers and updates allSourcePeers, and create
materializeRoutesForConsumingPeer(resource *NetworkResource, peerID string,
networkRoutingPeers map[string]*Router, policy *ResourcePolicy) which checks
slices.Contains(peers, peerID) and c.ValidatePostureChecksOnPeer and calls
c.getNetworkResourcesRoutes for each router to append to routes; keep router
detection (networkRoutingPeers, router, addSourcePeers) in
getNetworkResourcesRoutesToSync and call these helpers inside the policy loop
(use names ResourcePoliciesMap, getNetworkResourcesRoutes, getPostureValidPeers,
ValidatePostureChecksOnPeer to locate relevant logic).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: da8dd6b2-c654-48c7-b4e8-009e6f1e0636
📒 Files selected for processing (7)
management/server/networks/resources/manager.gomanagement/server/networks/resources/types/resource.gomanagement/server/store/sql_store.gomanagement/server/store/sql_store_test.gomanagement/server/types/networkmap_components.goshared/management/http/api/openapi.ymlshared/management/http/api/types.gen.go
💤 Files with no reviewable changes (2)
- shared/management/http/api/openapi.yml
- shared/management/http/api/types.gen.go

Describe your changes
There was some miscommunication. This feature will not yet be added.
Issue ticket number and link
Stack
Checklist
Documentation
Select exactly one:
Docs PR URL (required if "docs added" is checked)
Paste the PR link from https://github.com/netbirdio/docs here:
https://github.com/netbirdio/docs/pull/__
Summary by CodeRabbit
on_routing_peerproperty from network resource API endpoints and responses. This property is no longer available when creating, updating, or retrieving network resources.