Skip to content

Conversation

pascal-fischer
Copy link
Collaborator

Describe your changes

Issue ticket number and link

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

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

@Copilot Copilot AI review requested due to automatic review settings July 3, 2025 10:48
Copy link
Contributor

@Copilot Copilot AI left a 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-serialized Peers field, and add LoadGroupPeers/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))

pnmcosta
pnmcosta previously approved these changes Jul 29, 2025
Copy link

sonarqubecloud bot commented Aug 1, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
6 New issues
5.9% Duplication on New Code (required ≤ 5%)
6 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@pascal-fischer pascal-fischer merged commit 552dc60 into main Aug 1, 2025
50 of 53 checks passed
@pascal-fischer pascal-fischer deleted the feature/net-266-groups-migration branch August 1, 2025 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants