[PR #6231] [CLOSED] [management] combined network map refactor #27817

Open
opened 2026-08-05 07:09:15 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/6231
Author: @pascal-fischer
Created: 5/21/2026
Status: Closed

Base: mainHead: nmap/combined-deploy


📝 Commits (10+)

  • 285bbc5 calculate affected peers
  • 5a16c81 use buffering affected peers
  • cefb37e affected filtering on peers update
  • 5ec8beb add tests
  • 26d7783 clean comments
  • 0bfccd6 add to networks modules
  • 63d2217 Merge main into feature/affected-peers
  • 6b4d407 extend tests
  • 3a95f39 Merge branch 'main' into feature/affected-peers
  • c7bff8f Merge branch 'main' into feature/affected-peers

📊 Changes

66 files changed (+12939 additions, -1313 deletions)

View changed files

📝 client/internal/engine.go (+63 -3)
📝 dns/nameserver.go (+3 -0)
📝 management/internals/controllers/network_map/controller/controller.go (+363 -50)
📝 management/internals/controllers/network_map/interface.go (+9 -3)
📝 management/internals/controllers/network_map/interface_mock.go (+73 -12)
management/internals/shared/grpc/components_encoder.go (+815 -0)
management/internals/shared/grpc/components_encoder_test.go (+879 -0)
management/internals/shared/grpc/components_envelope_response.go (+193 -0)
management/internals/shared/grpc/components_envelope_response_test.go (+186 -0)
📝 management/internals/shared/grpc/conversion.go (+8 -283)
📝 management/internals/shared/grpc/conversion_test.go (+6 -5)
📝 management/internals/shared/grpc/server.go (+25 -1)
📝 management/server/account.go (+14 -2)
📝 management/server/account/manager.go (+2 -0)
📝 management/server/account/manager_mock.go (+24 -0)
📝 management/server/account_test.go (+20 -0)
management/server/affected_groups.go (+223 -0)
management/server/affected_peers_test.go (+1978 -0)
📝 management/server/dns.go (+9 -22)
📝 management/server/group.go (+84 -289)

...and 46 more files

📄 Description

Describe your changes

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • This change does not modify the public API, gRPC protocols, functionality behavior, CLI / service flags, or introduce a new feature — OR I have discussed it with the NetBird team beforehand (link the issue / Slack thread in the description). See CONTRIBUTING.md.

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

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

  • New Features

    • Component-based network map format for more efficient, compact peer sync
    • Selective "affected peers" updates so only impacted peers are notified
    • Incremental/delta network-map updates with client-side envelope decoding and caching
  • Improvements

    • Reduced network traffic and faster delivery of network maps
    • More reliable initial sync for component-capable clients and graceful fallback to legacy sync

Review Change Stack


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/6231 **Author:** [@pascal-fischer](https://github.com/pascal-fischer) **Created:** 5/21/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `nmap/combined-deploy` --- ### 📝 Commits (10+) - [`285bbc5`](https://github.com/netbirdio/netbird/commit/285bbc5ffb64860ba334dd39dba405340fea35b7) calculate affected peers - [`5a16c81`](https://github.com/netbirdio/netbird/commit/5a16c812fd729cccf6c21728d34b23a1ffecbd0c) use buffering affected peers - [`cefb37e`](https://github.com/netbirdio/netbird/commit/cefb37e920b9153837b46c13c8c10e3370f98544) affected filtering on peers update - [`5ec8beb`](https://github.com/netbirdio/netbird/commit/5ec8bebfa5edcea2e545a12c2491857b5c589bbd) add tests - [`26d7783`](https://github.com/netbirdio/netbird/commit/26d778374b5db0bbc889d2205aef1e5ad78c0b84) clean comments - [`0bfccd6`](https://github.com/netbirdio/netbird/commit/0bfccd65d2c688042854357cb3aa881187bf43e7) add to networks modules - [`63d2217`](https://github.com/netbirdio/netbird/commit/63d2217d8a0db4a21b162c48a9019a87e572d9be) Merge main into feature/affected-peers - [`6b4d407`](https://github.com/netbirdio/netbird/commit/6b4d4076f4b834590684dc8a88850861b47ef2eb) extend tests - [`3a95f39`](https://github.com/netbirdio/netbird/commit/3a95f39f2c4ab903894770b14379e430bd3a378d) Merge branch 'main' into feature/affected-peers - [`c7bff8f`](https://github.com/netbirdio/netbird/commit/c7bff8f07403d8826c9b2082fd8c816788ed8c48) Merge branch 'main' into feature/affected-peers ### 📊 Changes **66 files changed** (+12939 additions, -1313 deletions) <details> <summary>View changed files</summary> 📝 `client/internal/engine.go` (+63 -3) 📝 `dns/nameserver.go` (+3 -0) 📝 `management/internals/controllers/network_map/controller/controller.go` (+363 -50) 📝 `management/internals/controllers/network_map/interface.go` (+9 -3) 📝 `management/internals/controllers/network_map/interface_mock.go` (+73 -12) ➕ `management/internals/shared/grpc/components_encoder.go` (+815 -0) ➕ `management/internals/shared/grpc/components_encoder_test.go` (+879 -0) ➕ `management/internals/shared/grpc/components_envelope_response.go` (+193 -0) ➕ `management/internals/shared/grpc/components_envelope_response_test.go` (+186 -0) 📝 `management/internals/shared/grpc/conversion.go` (+8 -283) 📝 `management/internals/shared/grpc/conversion_test.go` (+6 -5) 📝 `management/internals/shared/grpc/server.go` (+25 -1) 📝 `management/server/account.go` (+14 -2) 📝 `management/server/account/manager.go` (+2 -0) 📝 `management/server/account/manager_mock.go` (+24 -0) 📝 `management/server/account_test.go` (+20 -0) ➕ `management/server/affected_groups.go` (+223 -0) ➕ `management/server/affected_peers_test.go` (+1978 -0) 📝 `management/server/dns.go` (+9 -22) 📝 `management/server/group.go` (+84 -289) _...and 46 more files_ </details> ### 📄 Description ## Describe your changes ## Issue ticket number and link ## Stack <!-- branch-stack --> ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [ ] Is a feature enhancement - [x] It is a refactor - [ ] Created tests that fail without the change (if possible) - [ ] This change does **not** modify the public API, gRPC protocols, functionality behavior, CLI / service flags, or introduce a new feature — **OR** I have discussed it with the NetBird team beforehand (link the issue / Slack thread in the description). See [CONTRIBUTING.md](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTING.md#discuss-changes-with-the-netbird-team-first). > By submitting this pull request, you confirm that you have read and agree to the terms of the [Contributor License Agreement](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT.md). ## Documentation Select exactly one: - [ ] I added/updated documentation for this change - [x] Documentation is **not needed** for this change (explain why) ### 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/__ <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Component-based network map format for more efficient, compact peer sync * Selective "affected peers" updates so only impacted peers are notified * Incremental/delta network-map updates with client-side envelope decoding and caching * **Improvements** * Reduced network traffic and faster delivery of network maps * More reliable initial sync for component-capable clients and graceful fallback to legacy sync <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/netbirdio/netbird/pull/6231?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 07:09:15 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#27817