Migrate lock commands to independent objects

This commit is contained in:
2026-09-05 13:11:11 +00:00
parent 4bc33773fa
commit 610eaefb27
13 changed files with 368 additions and 156 deletions

View File

@@ -76,13 +76,13 @@ func SessionValidate(ctx context.Context, args []string, out io.Writer) error {
}
}
locks := inspectEffectiveLocks(ctx, cfg, store)
locks := inspectRemoteLocks(ctx, cfg, store)
if locks.Err != nil {
findings = append(findings, errorFinding("locks", locks.Err.Error()))
} else if len(locks.Locks.All) == 0 {
findings = append(findings, okFinding("locks", "no effective publish locks"))
} else if len(locks.Locks) == 0 {
findings = append(findings, okFinding("locks", "no publish locks"))
} else {
for _, lock := range locks.Locks.All {
for _, lock := range locks.Locks {
findings = append(findings, warnFinding("locks", fmt.Sprintf("%s locked: %s", lock.Source, strings.TrimSpace(lock.Reason))))
}
}