Distinguish asset read failures from unknown writes
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user