ecluse:ecluse-runtime
Safe HaskellNone
LanguageGHC2021

Ecluse.Runtime.Pilot.Export

Description

The S3 publication of a compiled OSV artifact, guarded against older and sharply reduced data.

Each attempt reads the destination's metadata with HEAD, asks Ecluse.Core.Osv.Publication whether the candidate may replace what it found, and writes the artifact and its new metadata in one conditional PUT over that revision. A conflict rereads and decides again. The metadata carries the durable baseline, so the guard reads no object history and no stored database.

Synopsis

Documentation

data Published Source #

A publication that landed: the revision the store reported, and the decision it carried out.

Constructors

Published 

Fields

Instances

Instances details
Show Published Source # 
Instance details

Defined in Ecluse.Runtime.Pilot.Export

Eq Published Source # 
Instance details

Defined in Ecluse.Runtime.Pilot.Export

data PublicationStop Source #

Why a publication stopped without replacing the stored artifact.

Constructors

PublicationRefused PublicationRefusal

The guard refused the candidate.

PublicationFaulted StoreFault

The store could not be read or written as the guard requires.

data StoreFault Source #

A store condition that leaves the publication's outcome unproven, so nothing is promoted.

Constructors

StoreTransport TransportFault

A request failed outright.

StoreReadDenied

The object exists, and HEAD was refused, so its metadata cannot be read.

StoreAbsenceUnknown

HEAD was refused, and the listing could not prove the key absent.

StoreListDenied

Both HEAD and the one-key listing were refused.

StoreResponseTooLarge Int

A HEAD or listing response passed its byte bound, carried.

StoreNoRevision

HEAD answered without an ETag or a length.

StoreConditionalWriteUnsupported

The store refused a conditional write as unimplemented.

StoreEnvelopeRefused EnvelopeFault

The new metadata cannot be written.

StoreConflictsExhausted Int

Every attempt lost a race to another writer.

StoreWriteUncertain TransportFault RereadFinding

The write failed without proof either way, and the reread found no write of this publication.

Instances

Instances details
Show StoreFault Source # 
Instance details

Defined in Ecluse.Runtime.Pilot.Export

Eq StoreFault Source # 
Instance details

Defined in Ecluse.Runtime.Pilot.Export

data RereadFinding Source #

What the reread after an unproven write found.

renderPublicationStop :: PublicationStop -> Text Source #

The stop as an operator reads it.

maxPublicationAttempts :: Int Source #

How many conditional writes one publication attempts before it gives up a race.

publishCandidate :: (MonadUnliftIO m, KatipContext m) => Maybe TracerProvider -> Env -> ShrinkPolicy -> BaselineCapability -> Maybe Rebaseline -> Text -> Text -> OsvCandidate -> m (Either PublicationStop Published) Source #

Publish the candidate under bucket and key, deciding each attempt on a fresh HEAD. Each attempt's nonce identifies it if it lands unseen.