[PR #5358] feat: add optional heuristic deployment maturity indicator #22798

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

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/5358
Author: @ravii4
Created: 2/16/2026
Status: 🔄 Open

Base: mainHead: feat/deployment-maturity-indicator


📝 Commits (6)

  • 0259573 feat(types): add heuristic deployment maturity evaluation with unit tests
  • 7b4a50a feat(api): expose optional deployment_maturity field via config flag and account response
  • cbfb3a2 feat(ui): add DeploymentMaturityCard component for informational deployment stage display
  • 64de10a refactor(api): reduce NewAPIHandler parameter count using dependency struct (fix Sonar S107)
  • 2252d87 refactor(api): reduce NewAPIHandler cognitive complexity by extracting helpers
  • 9039ebf chore: trigger CLA recheck

📊 Changes

13 files changed (+11454 additions, -77 deletions)

View changed files

📝 client/internal/engine.go (+1 -1)
📝 management/internals/server/boot.go (+25 -1)
📝 management/internals/server/config/config.go (+5 -0)
📝 management/server/http/handler.go (+136 -61)
📝 management/server/http/handlers/accounts/accounts_handler.go (+56 -11)
📝 management/server/http/testing/testing_tools/channel/channel.go (+25 -1)
management/server/types/deployment_maturity.go (+32 -0)
management/server/types/deployment_maturity_test.go (+25 -0)
management/server/types/testdata/networkmap_golden_new_with_onpeeradded_router.json (+11093 -0)
proxy/web/src/components/DeploymentMaturityCard.tsx (+46 -0)
📝 shared/management/http/api/openapi.yml (+5 -0)
📝 shared/management/http/api/types.gen.go (+3 -0)
📝 shared/relay/client/early_msg_buffer.go (+2 -2)

📄 Description

This PR introduces an optional, heuristic deployment_maturity indicator for self-hosted deployments.

The indicator provides an informational signal about deployment stage (exploration → functional → operational → production) derived from:

  • Peer count
  • Policy count
  • Account age

The field is:

  • Fully optional
  • Feature-flag gated
  • Informational only
  • Non-enforcing
  • Backwards compatible

(No routing, policy, enforcement, or persistence behavior is modified.)


What’s Included

1. Core Evaluation Logic

  • Adds EvaluateDeploymentMaturity in management/server/types
  • Uses simple, transparent thresholds
  • Includes unit tests
  • Includes golden testdata update

(The logic is deterministic and purely heuristic.)

2. API Wiring (Flag-Gated)

  • Adds config flag: EnableDeploymentMaturity

When enabled:

  • deployment_maturity is included in the Account response

When disabled:

  • Field is omitted entirely

  • OpenAPI schema updated

  • Generated types updated

(The field is optional and does not change existing API contracts.)

3. UI Component

  • Adds DeploymentMaturityCard component
  • Informational display only
  • Not auto-wired into existing dashboard flows
  • No UX behavior changes introduced in this PR

Backwards Compatibility

  • Field is optional
  • Disabled by default
  • No breaking API changes
  • No database schema changes
  • No changes to policy evaluation or enforcement

Testing

Validated locally using:

go fmt ./...
go vet ./management/server/...
go test ./management/server/...

---

<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/5358 **Author:** [@ravii4](https://github.com/ravii4) **Created:** 2/16/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/deployment-maturity-indicator` --- ### 📝 Commits (6) - [`0259573`](https://github.com/netbirdio/netbird/commit/0259573d6db7579dcecbfb018ea44d6347427ddd) feat(types): add heuristic deployment maturity evaluation with unit tests - [`7b4a50a`](https://github.com/netbirdio/netbird/commit/7b4a50ab3dbeaaab62622cdb8fb8dcbc1c8b4a08) feat(api): expose optional deployment_maturity field via config flag and account response - [`cbfb3a2`](https://github.com/netbirdio/netbird/commit/cbfb3a25fcb40836d81ef98fef4577b0a8e65b76) feat(ui): add DeploymentMaturityCard component for informational deployment stage display - [`64de10a`](https://github.com/netbirdio/netbird/commit/64de10ab713f6b01c9f36b98f78d10f5d0ef3389) refactor(api): reduce NewAPIHandler parameter count using dependency struct (fix Sonar S107) - [`2252d87`](https://github.com/netbirdio/netbird/commit/2252d87795ccd0180ce00d53a68cdef0d7776ac3) refactor(api): reduce NewAPIHandler cognitive complexity by extracting helpers - [`9039ebf`](https://github.com/netbirdio/netbird/commit/9039ebf3aaa2353e347be3ac885b262a8db3aee9) chore: trigger CLA recheck ### 📊 Changes **13 files changed** (+11454 additions, -77 deletions) <details> <summary>View changed files</summary> 📝 `client/internal/engine.go` (+1 -1) 📝 `management/internals/server/boot.go` (+25 -1) 📝 `management/internals/server/config/config.go` (+5 -0) 📝 `management/server/http/handler.go` (+136 -61) 📝 `management/server/http/handlers/accounts/accounts_handler.go` (+56 -11) 📝 `management/server/http/testing/testing_tools/channel/channel.go` (+25 -1) ➕ `management/server/types/deployment_maturity.go` (+32 -0) ➕ `management/server/types/deployment_maturity_test.go` (+25 -0) ➕ `management/server/types/testdata/networkmap_golden_new_with_onpeeradded_router.json` (+11093 -0) ➕ `proxy/web/src/components/DeploymentMaturityCard.tsx` (+46 -0) 📝 `shared/management/http/api/openapi.yml` (+5 -0) 📝 `shared/management/http/api/types.gen.go` (+3 -0) 📝 `shared/relay/client/early_msg_buffer.go` (+2 -2) </details> ### 📄 Description This PR introduces an optional, heuristic `deployment_maturity` indicator for self-hosted deployments. The indicator provides an informational signal about deployment stage (exploration → functional → operational → production) derived from: - Peer count - Policy count - Account age The field is: - Fully optional - Feature-flag gated - Informational only - Non-enforcing - Backwards compatible (No routing, policy, enforcement, or persistence behavior is modified.) --- ## What’s Included ### 1. Core Evaluation Logic - Adds `EvaluateDeploymentMaturity` in `management/server/types` - Uses simple, transparent thresholds - Includes unit tests - Includes golden testdata update (The logic is deterministic and purely heuristic.) ### 2. API Wiring (Flag-Gated) - Adds config flag: `EnableDeploymentMaturity` When enabled: - `deployment_maturity` is included in the Account response When disabled: - Field is omitted entirely - OpenAPI schema updated - Generated types updated (The field is optional and does not change existing API contracts.) ### 3. UI Component - Adds `DeploymentMaturityCard` component - Informational display only - Not auto-wired into existing dashboard flows - No UX behavior changes introduced in this PR --- ## Backwards Compatibility - Field is optional - Disabled by default - No breaking API changes - No database schema changes - No changes to policy evaluation or enforcement --- ## Testing Validated locally using: ```bash go fmt ./... go vet ./management/server/... go test ./management/server/... --- <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 06:06:24 -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#22798