Skip to content

Commit c59fdfd

Browse files
LFXV2-124: Refactor committee deletion steps for clarity
- Renumbered steps to reflect the removal of unnecessary comments, enhancing readability and consistency in the code. Signed-off-by: Mauricio Zanetti Salomao <mauriciozanetti86@gmail.com>
1 parent 8689eb6 commit c59fdfd

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

internal/service/committee_writer.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -798,11 +798,7 @@ func (uc *committeeWriterOrchestrator) Delete(ctx context.Context, uid string, r
798798
"sso_group_name", existing.SSOGroupName,
799799
)
800800

801-
// Step 2: Get project slug for SSO group name index cleanup (if needed)
802-
// Note: We don't actually need the slug for deletion since we already have the SSO group name
803-
// but this is kept for consistency with the create/update flow
804-
805-
// Step 3: Build list of secondary indices to delete
801+
// Step 2: Build list of secondary indices to delete
806802
var indicesToDelete []string
807803

808804
// Build project+name index key
@@ -822,7 +818,7 @@ func (uc *committeeWriterOrchestrator) Delete(ctx context.Context, uid string, r
822818
"indices", indicesToDelete,
823819
)
824820

825-
// Step 4: Delete the main committee record and settings
821+
// Step 3: Delete the main committee record and settings
826822
errDelete := uc.committeeWriter.Delete(ctx, uid, revision)
827823
if errDelete != nil {
828824
slog.ErrorContext(ctx, "failed to delete committee",
@@ -836,7 +832,7 @@ func (uc *committeeWriterOrchestrator) Delete(ctx context.Context, uid string, r
836832
"committee_uid", uid,
837833
)
838834

839-
// Step 5: Delete secondary indices
835+
// Step 4: Delete secondary indices
840836
// We use the deleteKeys method which handles errors gracefully and logs them
841837
// We don't abort here - secondary indices have a minor impact during deletion compared to the main index
842838
// and access control, which must be executed successfully to avoid data inconsistency in the following steps

0 commit comments

Comments
 (0)