[PR #5075] [CLOSED] [management] migrate auto groups to separate table #24884

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

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/5075
Author: @pascal-fischer
Created: 1/8/2026
Status: Closed

Base: mainHead: feature/migrate-auto-groups-to-table


📝 Commits (10+)

📊 Changes

13 files changed (+554 additions, -92 deletions)

View changed files

📝 management/server/account.go (+0 -3)
📝 management/server/account_test.go (+62 -0)
📝 management/server/group_test.go (+17 -7)
📝 management/server/migration/migration.go (+100 -0)
📝 management/server/store/sql_store.go (+168 -47)
📝 management/server/store/sql_store_test.go (+9 -6)
📝 management/server/store/sqlstore_bench_test.go (+18 -7)
📝 management/server/store/store.go (+14 -0)
📝 management/server/types/account.go (+1 -1)
📝 management/server/types/group.go (+17 -0)
📝 management/server/types/user.go (+40 -5)
📝 management/server/user.go (+77 -16)
📝 management/server/user_test.go (+31 -0)

📄 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)

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

    • Group memberships are now stored relationally and can be managed with new add/remove group operations.
  • Bug Fixes / Data Integrity

    • Migration cleans up orphaned group IDs and converts serialized group lists into the relational model; saves ensure foreign-key integrity.
  • Behavior Change

    • JWT-based group updates no longer propagate to peers or generate activity events.
  • Tests

    • Tests and benchmarks updated to cover the relational group model and migration paths.

✏️ Tip: You can customize this high-level summary in your review settings.


🔄 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/5075 **Author:** [@pascal-fischer](https://github.com/pascal-fischer) **Created:** 1/8/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feature/migrate-auto-groups-to-table` --- ### 📝 Commits (10+) - [`f7ee019`](https://github.com/netbirdio/netbird/commit/f7ee019f26ecfc596b7aa718d5ac05ab1b927a57) migrate auto groups to different table - [`ea37d4b`](https://github.com/netbirdio/netbird/commit/ea37d4b768bd3d1c3b318ab50a54faa09031b71e) fix tests - [`9fd3471`](https://github.com/netbirdio/netbird/commit/9fd34718a60d48aa8e9d602010521d299d3bc5f6) remove emptying users - [`77ea4b7`](https://github.com/netbirdio/netbird/commit/77ea4b744402a77d550a8ebf9b4d9a65a956434b) fix saveAccount and gorm order - [`7949762`](https://github.com/netbirdio/netbird/commit/794976263e848b3aa2fd76b77a8e718f238bfe26) fix account copy - [`cdfe0f3`](https://github.com/netbirdio/netbird/commit/cdfe0f3d4126d8178d37084cce08fbbf002049a7) fix get account equal - [`80c49c2`](https://github.com/netbirdio/netbird/commit/80c49c268f01d11cc6738ed128dce92e1eaf01dd) add debugging store call - [`475ce09`](https://github.com/netbirdio/netbird/commit/475ce092c8915846fb09911cb0d3a95397bfaeb7) first dave user, then associations - [`ddcf9f8`](https://github.com/netbirdio/netbird/commit/ddcf9f820bd97a00756dbc7b5d9bff23dcdd7094) fix StoreAutoGroups len alloc - [`7956f67`](https://github.com/netbirdio/netbird/commit/7956f676a408dbcea78d49087246096731c1e413) fix group test setup ### 📊 Changes **13 files changed** (+554 additions, -92 deletions) <details> <summary>View changed files</summary> 📝 `management/server/account.go` (+0 -3) 📝 `management/server/account_test.go` (+62 -0) 📝 `management/server/group_test.go` (+17 -7) 📝 `management/server/migration/migration.go` (+100 -0) 📝 `management/server/store/sql_store.go` (+168 -47) 📝 `management/server/store/sql_store_test.go` (+9 -6) 📝 `management/server/store/sqlstore_bench_test.go` (+18 -7) 📝 `management/server/store/store.go` (+14 -0) 📝 `management/server/types/account.go` (+1 -1) 📝 `management/server/types/group.go` (+17 -0) 📝 `management/server/types/user.go` (+40 -5) 📝 `management/server/user.go` (+77 -16) 📝 `management/server/user_test.go` (+31 -0) </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) > 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** * Group memberships are now stored relationally and can be managed with new add/remove group operations. * **Bug Fixes / Data Integrity** * Migration cleans up orphaned group IDs and converts serialized group lists into the relational model; saves ensure foreign-key integrity. * **Behavior Change** * JWT-based group updates no longer propagate to peers or generate activity events. * **Tests** * Tests and benchmarks updated to cover the relational group model and migration paths. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- 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 06:09:16 -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#24884