| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Pilot.Plan
Description
The decisions Pilot makes before it does anything: whether the scheduled loop exports at all and how often, which upstreams one compile reads, whether a failed EPSS feed stops its publication, and whether a one-shot run uploads.
Each is a pure function over the resolved configuration, so Ecluse.Pilot dispatches on their
results instead of branching inside IO (Ecluse.Composition.MirrorRole is the same shape).
Synopsis
- data ExportLoopPlan
- data ExportTarget = ExportTarget {
- etEcosystem :: Ecosystem
- etEpss :: EpssRequirement
- exportLoopPlan :: AdvisoriesSettings -> [ExportTarget] -> Maybe ExportLoopPlan
- exportCadenceMicros :: AdvisoriesSettings -> Int
- idleCadenceMicros :: Int
- configuredSources :: AdvisoriesSettings -> OsvEcosystem -> CompileSources
- quietTimeFor :: AdvisoriesSettings -> Maybe Ecosystem -> QuietTime
- epssAttemptLine :: AdvisoriesSettings -> Text
- shrinkPolicyOf :: AdvisoriesSettings -> ShrinkPolicy
- pilotPostureLines :: AdvisoriesSettings -> [Text]
- data PilotCompileOptions = PilotCompileOptions {}
- data UploadRequest
- = NoUpload
- | Upload
- | UploadRebaselined Rebaseline
- compileEpssRequirement :: AdvisoriesSettings -> MountMap -> PilotCompileOptions -> EpssRequirement
- unmountedCompileWarning :: MountMap -> PilotCompileOptions -> Maybe Text
- data UploadPlan
- = UploadSkipped
- | UploadTo AdvisoryStoreUrl (Maybe Rebaseline)
- uploadPlan :: PilotCompileOptions -> Maybe AdvisoryStoreUrl -> Either PilotUploadUnconfigured UploadPlan
- data PilotUploadUnconfigured = PilotUploadUnconfigured
- uploadTarget :: AdvisoryStoreUrl -> FilePath -> (Text, Text)
The scheduled export loop
data ExportLoopPlan Source #
What the scheduled export loop does with the advisory settings and the mounted ecosystems.
Constructors
| ExportIdle | No advisory store is configured, so the loop idles and exports nothing. |
| ExportTo AdvisoryStoreUrl (NonEmpty ExportTarget) | Compile and upload one artifact per target to this store, each on its own cadence. |
Instances
| Show ExportLoopPlan Source # | |
Defined in Ecluse.Pilot.Plan Methods showsPrec :: Int -> ExportLoopPlan -> ShowS # show :: ExportLoopPlan -> String # showList :: [ExportLoopPlan] -> ShowS # | |
| Eq ExportLoopPlan Source # | |
Defined in Ecluse.Pilot.Plan Methods (==) :: ExportLoopPlan -> ExportLoopPlan -> Bool # (/=) :: ExportLoopPlan -> ExportLoopPlan -> Bool # | |
data ExportTarget Source #
One mounted ecosystem the scheduled loop compiles, with what a failed EPSS feed means for it.
Constructors
| ExportTarget | |
Fields
| |
Instances
| Show ExportTarget Source # | |
Defined in Ecluse.Pilot.Plan Methods showsPrec :: Int -> ExportTarget -> ShowS # show :: ExportTarget -> String # showList :: [ExportTarget] -> ShowS # | |
| Eq ExportTarget Source # | |
Defined in Ecluse.Pilot.Plan | |
exportLoopPlan :: AdvisoriesSettings -> [ExportTarget] -> Maybe ExportLoopPlan Source #
A configured store turns exporting on, one artifact per mounted ecosystem. Nothing is a store with no ecosystem, which the boot refuses.
exportCadenceMicros :: AdvisoriesSettings -> Int Source #
The delay between export cycles. The decoder bounds compileInterval to maxBound `div` 1000000 seconds, so it cannot wrap negative.
idleCadenceMicros :: Int Source #
The idle loop's sleep. An added store takes effect only on the next boot, so nothing observes the wakeup.
The upstreams a compile reads
configuredSources :: AdvisoriesSettings -> OsvEcosystem -> CompileSources Source #
The upstreams a compile reads, and how its artifact records them. A moved or mirrored feed never needs a new binary.
quietTimeFor :: AdvisoriesSettings -> Maybe Ecosystem -> QuietTime Source #
The quiet-time thresholds of one compile. An unconfigured ecosystem, or one this build does not serve, takes defaultQuietTime.
epssAttemptLine :: AdvisoriesSettings -> Text Source #
The egress every compile attempts whatever the rules, named by the host and port it dials.
The publication guard
shrinkPolicyOf :: AdvisoriesSettings -> ShrinkPolicy Source #
The shrink limits every publication is held to, scheduled or one-shot.
pilotPostureLines :: AdvisoriesSettings -> [Text] Source #
What every Pilot boot reports: the egress it attempts, and, with a store to publish to, the guard each publication passes.
The one-shot run
data PilotCompileOptions Source #
Options for the one-shot ecluse pilot compile mode.
Constructors
| PilotCompileOptions | |
Fields
| |
Instances
| Show PilotCompileOptions Source # | |
Defined in Ecluse.Pilot.Plan Methods showsPrec :: Int -> PilotCompileOptions -> ShowS # show :: PilotCompileOptions -> String # showList :: [PilotCompileOptions] -> ShowS # | |
| Eq PilotCompileOptions Source # | |
Defined in Ecluse.Pilot.Plan Methods (==) :: PilotCompileOptions -> PilotCompileOptions -> Bool # (/=) :: PilotCompileOptions -> PilotCompileOptions -> Bool # | |
data UploadRequest Source #
Whether a one-shot run publishes its artifact. A rebaseline exists only beside an upload.
Constructors
| NoUpload | |
| Upload | Publish under the configured guard. |
| UploadRebaselined Rebaseline | Publish once over the named revision, with this run's own shrink allowance, and restart the baseline. |
Instances
| Show UploadRequest Source # | |
Defined in Ecluse.Pilot.Plan Methods showsPrec :: Int -> UploadRequest -> ShowS # show :: UploadRequest -> String # showList :: [UploadRequest] -> ShowS # | |
| Eq UploadRequest Source # | |
Defined in Ecluse.Pilot.Plan Methods (==) :: UploadRequest -> UploadRequest -> Bool # (/=) :: UploadRequest -> UploadRequest -> Bool # | |
compileEpssRequirement :: AdvisoriesSettings -> MountMap -> PilotCompileOptions -> EpssRequirement Source #
The compiled mount's own requirement. A compile for no mount may serve a policy that needs EPSS.
unmountedCompileWarning :: MountMap -> PilotCompileOptions -> Maybe Text Source #
The warning a one-shot compile logs for an ecosystem the loaded configuration does not mount.
data UploadPlan Source #
Whether a one-shot run uploads its artifact, and where.
Constructors
| UploadSkipped | The run did not ask to upload, so the artifact stays local. |
| UploadTo AdvisoryStoreUrl (Maybe Rebaseline) | Upload the compiled artifact to this store, under an operator's rebaseline if one was given. |
Instances
| Show UploadPlan Source # | |
Defined in Ecluse.Pilot.Plan Methods showsPrec :: Int -> UploadPlan -> ShowS # show :: UploadPlan -> String # showList :: [UploadPlan] -> ShowS # | |
| Eq UploadPlan Source # | |
Defined in Ecluse.Pilot.Plan | |
uploadPlan :: PilotCompileOptions -> Maybe AdvisoryStoreUrl -> Either PilotUploadUnconfigured UploadPlan Source #
Plan a one-shot run's upload. One asked for with no store is refused, so a scripted run cannot succeed having published nothing.
data PilotUploadUnconfigured Source #
An upload requested without an advisory store: a wiring fault, so it throws rather than return a value to re-raise.
Constructors
| PilotUploadUnconfigured |
Instances
| Exception PilotUploadUnconfigured Source # | |
Defined in Ecluse.Pilot.Plan | |
| Show PilotUploadUnconfigured Source # | |
Defined in Ecluse.Pilot.Plan Methods showsPrec :: Int -> PilotUploadUnconfigured -> ShowS # show :: PilotUploadUnconfigured -> String # showList :: [PilotUploadUnconfigured] -> ShowS # | |
| Eq PilotUploadUnconfigured Source # | |
Defined in Ecluse.Pilot.Plan Methods (==) :: PilotUploadUnconfigured -> PilotUploadUnconfigured -> Bool # (/=) :: PilotUploadUnconfigured -> PilotUploadUnconfigured -> Bool # | |
uploadTarget :: AdvisoryStoreUrl -> FilePath -> (Text, Text) Source #
Where one compiled artifact lands: the store's bucket and its file's key under the prefix, which the proxy's sync reads.