[PR #2955] [CLOSED] [management] Refactor account to use store methods #18776

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

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/2955
Author: @bcmmbaga
Created: 11/27/2024
Status: Closed

Base: routes-get-account-refactoringHead: account-refactoring


📝 Commits (10+)

  • 70b4628 Refactor account settings updates
  • 7a6ca3e Fix tests
  • 2115e2c Add tests
  • ea51ce8 Remove group all checks for accounts during startup
  • e17d812 Remove unused store methods
  • 71af7ed Refactor new account handling
  • accada3 Remove db lock on aggregate db calls
  • de99624 Fix tests
  • 13eae9b Remove unused function
  • 3186876 Add group All and default policy to client tests

📊 Changes

22 files changed (+1529 additions, -1274 deletions)

View changed files

📝 client/testdata/store.sql (+3 -0)
📝 management/server/account.go (+164 -174)
📝 management/server/account_test.go (+143 -144)
📝 management/server/dns_test.go (+58 -61)
📝 management/server/ephemeral_test.go (+60 -38)
📝 management/server/group_test.go (+51 -21)
📝 management/server/http/accounts_handler.go (+2 -2)
📝 management/server/http/accounts_handler_test.go (+2 -4)
📝 management/server/management_proto_test.go (+1 -1)
📝 management/server/mock_server/account_mock.go (+12 -12)
📝 management/server/nameserver_test.go (+52 -62)
📝 management/server/peer_test.go (+83 -46)
📝 management/server/personal_access_token.go (+1 -0)
📝 management/server/posture_checks_test.go (+47 -44)
📝 management/server/route_test.go (+140 -223)
📝 management/server/setupkey_test.go (+18 -18)
📝 management/server/sql_store.go (+62 -29)
📝 management/server/sql_store_test.go (+347 -114)
📝 management/server/store.go (+5 -4)
📝 management/server/testdata/store_with_expired_peers.sql (+3 -0)

...and 2 more files

📄 Description

Describe your changes

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)
  • Extended the README / documentation, if necessary

🔄 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/2955 **Author:** [@bcmmbaga](https://github.com/bcmmbaga) **Created:** 11/27/2024 **Status:** ❌ Closed **Base:** `routes-get-account-refactoring` ← **Head:** `account-refactoring` --- ### 📝 Commits (10+) - [`70b4628`](https://github.com/netbirdio/netbird/commit/70b4628b5a9f7ff0899665ef69309af028a9bf73) Refactor account settings updates - [`7a6ca3e`](https://github.com/netbirdio/netbird/commit/7a6ca3ee371d0f745fc19b7c2a74ba1016cad605) Fix tests - [`2115e2c`](https://github.com/netbirdio/netbird/commit/2115e2c3f08024a512803f51b72d516f9dca32a2) Add tests - [`ea51ce8`](https://github.com/netbirdio/netbird/commit/ea51ce876eca0c24f543756a57521a0a2dffef01) Remove group all checks for accounts during startup - [`e17d812`](https://github.com/netbirdio/netbird/commit/e17d8127e3b25f33e0a2c08a2e0c4d9cf26ea318) Remove unused store methods - [`71af7ed`](https://github.com/netbirdio/netbird/commit/71af7edd0505b9e9dae658aab8a72b192890a954) Refactor new account handling - [`accada3`](https://github.com/netbirdio/netbird/commit/accada3311d285b39bca5aaab61bb9364f44d6b7) Remove db lock on aggregate db calls - [`de99624`](https://github.com/netbirdio/netbird/commit/de99624610817bbdd392bad2a6b4c9d65c452cfc) Fix tests - [`13eae9b`](https://github.com/netbirdio/netbird/commit/13eae9bc9311423d1915e26b2b568c5704b3b8d3) Remove unused function - [`3186876`](https://github.com/netbirdio/netbird/commit/3186876d5e2cf0a6149a8a7c39b4c268f6fbfcab) Add group All and default policy to client tests ### 📊 Changes **22 files changed** (+1529 additions, -1274 deletions) <details> <summary>View changed files</summary> 📝 `client/testdata/store.sql` (+3 -0) 📝 `management/server/account.go` (+164 -174) 📝 `management/server/account_test.go` (+143 -144) 📝 `management/server/dns_test.go` (+58 -61) 📝 `management/server/ephemeral_test.go` (+60 -38) 📝 `management/server/group_test.go` (+51 -21) 📝 `management/server/http/accounts_handler.go` (+2 -2) 📝 `management/server/http/accounts_handler_test.go` (+2 -4) 📝 `management/server/management_proto_test.go` (+1 -1) 📝 `management/server/mock_server/account_mock.go` (+12 -12) 📝 `management/server/nameserver_test.go` (+52 -62) 📝 `management/server/peer_test.go` (+83 -46) 📝 `management/server/personal_access_token.go` (+1 -0) 📝 `management/server/posture_checks_test.go` (+47 -44) 📝 `management/server/route_test.go` (+140 -223) 📝 `management/server/setupkey_test.go` (+18 -18) 📝 `management/server/sql_store.go` (+62 -29) 📝 `management/server/sql_store_test.go` (+347 -114) 📝 `management/server/store.go` (+5 -4) 📝 `management/server/testdata/store_with_expired_peers.sql` (+3 -0) _...and 2 more files_ </details> ### 📄 Description ## Describe your changes ## Issue ticket number and link ### 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) - [ ] Extended the README / documentation, if necessary --- <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 04:08:54 -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#18776