Index previous publication selections and missing inputs
This commit is contained in:
@@ -197,12 +197,3 @@ func requireInspectionFile(path, label string) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func previousRequirementSkipped(values []string, name string) bool {
|
||||
for _, value := range values {
|
||||
if value == name {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -202,9 +202,14 @@ func inspectSessionState(ctx context.Context, cfg *config.Config, status, remote
|
||||
fail("artifacts", inputs.requirementsErr)
|
||||
if inputs.effectiveErr == nil && inputs.requirementsErr == nil {
|
||||
fail("previous", inputs.previous.Err)
|
||||
skipped := make(map[string]struct{}, len(inputs.previous.SkippedMissing))
|
||||
for _, name := range inputs.previous.SkippedMissing {
|
||||
skipped[name] = struct{}{}
|
||||
}
|
||||
for _, requirement := range inputs.previous.Requirements {
|
||||
state := "ready"
|
||||
if inputs.previous.Err != nil || previousRequirementSkipped(inputs.previous.SkippedMissing, requirement.Name) {
|
||||
_, missing := skipped[requirement.Name]
|
||||
if inputs.previous.Err != nil || missing {
|
||||
state = "unavailable"
|
||||
}
|
||||
report.Previous = append(report.Previous, sessionPreviousState{Name: requirement.Name, Required: requirement.Required, State: state})
|
||||
|
||||
Reference in New Issue
Block a user