[PR #4438] [CLOSED] [management] refactor: introduce incremental network map builder #25490

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

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/4438
Author: @crn4
Created: 9/3/2025
Status: Closed

Base: mainHead: refactor/nmap


📝 Commits (10+)

📊 Changes

28 files changed (+4252 additions, -906 deletions)

View changed files

📝 management/main.go (+8 -1)
📝 management/server/account.go (+36 -0)
📝 management/server/account/manager.go (+1 -0)
📝 management/server/account_test.go (+46 -0)
📝 management/server/dns.go (+3 -0)
📝 management/server/group.go (+24 -0)
📝 management/server/grpcserver.go (+33 -0)
management/server/holder.go (+39 -0)
📝 management/server/mock_server/account_mock.go (+11 -3)
📝 management/server/nameserver.go (+9 -0)
management/server/networkmap.go (+80 -0)
📝 management/server/networks/manager.go (+3 -0)
📝 management/server/networks/resources/manager.go (+9 -0)
📝 management/server/networks/routers/manager.go (+9 -0)
📝 management/server/peer.go (+93 -15)
📝 management/server/peer_test.go (+21 -2)
📝 management/server/policy.go (+6 -0)
📝 management/server/posture_checks.go (+3 -0)
📝 management/server/route.go (+9 -0)
📝 management/server/store/sql_store.go (+1 -0)

...and 8 more files

📄 Description

Describe your changes

This PR refactors the network map generation approach by introducing a new, experimental network map builder. Instead of rebuilding the map from scratch, this builder applies incremental updates based on network map change events.

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)

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/__


🔄 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/4438 **Author:** [@crn4](https://github.com/crn4) **Created:** 9/3/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `refactor/nmap` --- ### 📝 Commits (10+) - [`2fb971e`](https://github.com/netbirdio/netbird/commit/2fb971e88ae9fced8908acd6baca8e4ac608327f) nmap builder - [`f4b2bed`](https://github.com/netbirdio/netbird/commit/f4b2bed1b944c897bc382b77ee1545fe441b7ded) changes to other code - nmap in separate file - [`abd7a84`](https://github.com/netbirdio/netbird/commit/abd7a84a460cbfd57c3a96684bf0a590561c754f) implement nmap builder to the code - [`fd7b3ae`](https://github.com/netbirdio/netbird/commit/fd7b3ae21c650ee67e063d4f5455adf3a4ead98c) conflicts resolution after main merge - [`bc6c5ec`](https://github.com/netbirdio/netbird/commit/bc6c5ece6e27b0b264d44c7d6772629f2397ec4a) tests and linter fix - [`333908d`](https://github.com/netbirdio/netbird/commit/333908d06eae8fa67bc07b7f90548e19d79cc118) minor fix - [`050c051`](https://github.com/netbirdio/netbird/commit/050c05164abdfb92b50371391d6f25f13dad5eca) tests fix - [`0ae2241`](https://github.com/netbirdio/netbird/commit/0ae2241573ffe8d3bb38f69c55d5d6d17b7ea4f3) removed test files - [`ca85aa9`](https://github.com/netbirdio/netbird/commit/ca85aa9b8f9af91acc1ba72f3bbf25fcf7fa4c5d) implement new map builder full rebuilder for other parts - [`08fba98`](https://github.com/netbirdio/netbird/commit/08fba9876b05594e60232f34aad0804459297b42) test fixes ### 📊 Changes **28 files changed** (+4252 additions, -906 deletions) <details> <summary>View changed files</summary> 📝 `management/main.go` (+8 -1) 📝 `management/server/account.go` (+36 -0) 📝 `management/server/account/manager.go` (+1 -0) 📝 `management/server/account_test.go` (+46 -0) 📝 `management/server/dns.go` (+3 -0) 📝 `management/server/group.go` (+24 -0) 📝 `management/server/grpcserver.go` (+33 -0) ➕ `management/server/holder.go` (+39 -0) 📝 `management/server/mock_server/account_mock.go` (+11 -3) 📝 `management/server/nameserver.go` (+9 -0) ➕ `management/server/networkmap.go` (+80 -0) 📝 `management/server/networks/manager.go` (+3 -0) 📝 `management/server/networks/resources/manager.go` (+9 -0) 📝 `management/server/networks/routers/manager.go` (+9 -0) 📝 `management/server/peer.go` (+93 -15) 📝 `management/server/peer_test.go` (+21 -2) 📝 `management/server/policy.go` (+6 -0) 📝 `management/server/posture_checks.go` (+3 -0) 📝 `management/server/route.go` (+9 -0) 📝 `management/server/store/sql_store.go` (+1 -0) _...and 8 more files_ </details> ### 📄 Description ## Describe your changes This PR refactors the network map generation approach by introducing a new, experimental network map builder. Instead of rebuilding the map from scratch, this builder applies incremental updates based on network map change events. ## 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) > 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/__ --- <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:06:04 -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#25490