-
-
Notifications
You must be signed in to change notification settings - Fork 870
[management] migrate group peers into seperate table #4096
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Migrate group peers into a dedicated group_peers
table for better normalization and performance. Key changes:
- Introduce a new
GroupPeer
model, remove JSON-serializedPeers
field, and addLoadGroupPeers
/StoreGroupPeers
helpers. - Extend the store interface and SQL implementation to use the new table, including an automated JSON-to-table migration.
- Refactor all group-related methods and update tests to use the new Add/Remove peer-group operations.
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
management/server/types/group.go | Introduce GroupPeer , drop JSON Peers , add load/store helpers |
management/server/migration/migration.go | Add MigrateJsonToTable and peers JSON migration |
management/server/store/store.go | Update Store interface with new peer-group methods |
management/server/store/sql_store.go | AutoMigrate GroupPeer , refactor save/load and CRUD methods |
management/server/group_test.go | Add concurrent tests for new peer-group operations |
Comments suppressed due to low confidence (1)
management/server/group_test.go:800
- The final argument uses
len(account.Peers)
which does not exist; it should reference the same slice under test, e.g.,len(maps.Values(account.Groups)[0].Peers)
.
assert.Equal(t, totalPeers, len(maps.Values(account.Groups)[0].Peers), "Expected %d peers in account %s, got %d", totalPeers, accountID, len(account.Peers))
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This reverts commit 76b180a.
…' into feature/net-266-groups-migration
…' into feature/net-266-groups-migration
|
Describe your changes
Issue ticket number and link
Stack
Checklist