Distinguish asset read failures from unknown writes

This commit is contained in:
2026-10-06 00:54:49 +00:00
parent 91712fd900
commit b744346210
5 changed files with 66 additions and 19 deletions

View File

@@ -124,6 +124,9 @@ func Deliver(ctx context.Context, request Request) (Result, error) {
result.Conflicting = uploadResult.Conflicting
result.Uncertain = uploadResult.Uncertain
result.State = State(uploadResult.State)
if result.State == NotAttempted && releaseResult.WriteAttempted {
result.State = Partial
}
return result, uploadErr
}

View File

@@ -21,10 +21,11 @@ import (
type DeliveryState string
const (
DeliveryComplete DeliveryState = "complete"
DeliveryPartial DeliveryState = "partial"
DeliveryConflict DeliveryState = "conflict"
DeliveryUnknown DeliveryState = "unknown"
DeliveryNotAttempted DeliveryState = "not_attempted"
DeliveryComplete DeliveryState = "complete"
DeliveryPartial DeliveryState = "partial"
DeliveryConflict DeliveryState = "conflict"
DeliveryUnknown DeliveryState = "unknown"
)
type AssetIdentity struct {
@@ -100,8 +101,8 @@ func (c Client) UploadMissing(ctx context.Context, destination Destination, rele
return result, failure(FailureConflict, "preflight release assets", 0, errors.New("one or more existing attachments conflict"))
}
if preflightUnknown {
result.State = DeliveryUnknown
return result, failure(FailureUnknown, "preflight release assets", 0, errors.New("one or more existing attachments could not be verified"))
result.State = DeliveryNotAttempted
return result, failure(FailureUnverifiable, "preflight release assets", 0, errors.New("one or more existing attachments could not be verified"))
}
if len(expected) == 0 {
result.State = DeliveryComplete