Require captured repository lookups

This commit is contained in:
2026-11-05 19:55:10 +00:00
parent 0dec3dcec0
commit 90f796aef7
9 changed files with 24 additions and 80 deletions

View File

@@ -15,10 +15,6 @@ type resolvedProfileSelection struct {
profile *domain.ExecutionProfile
}
type profileIdentityRepository interface {
GetProfileIdentity(context.Context, string) (string, error)
}
func (r *Runner) profileLookupID(profileID string) (string, error) {
if strings.TrimSpace(profileID) == "" {
return "", fmt.Errorf("%w: profile id is required", ErrInvalidRequest)
@@ -61,18 +57,11 @@ func (r *Runner) resolveProfileIdentity(ctx context.Context, profileID string) (
if err != nil {
return "", err
}
if indexed, ok := r.profiles.(profileIdentityRepository); ok {
identity, err := indexed.GetProfileIdentity(ctx, lookupID)
if err != nil {
return "", profileLookupError(err)
}
return identity, nil
}
selection, err := r.resolveProfileSelection(ctx, lookupID)
identity, err := r.profiles.GetProfileIdentity(ctx, lookupID)
if err != nil {
return "", err
return "", profileLookupError(err)
}
return selection.id, nil
return identity, nil
}
func normalizeResolvedExecutionTarget(target domain.ExecutionTarget) (domain.ExecutionTarget, error) {