This namespace contains functions useful to convert the internal state of a pipeline into something more easy to use for further processing, e.g. to present it to a user.
Functions taking a map step-id to step-result are usually called with the result of lambdacd.state.core/get-step-results
This namespace contains functions useful to convert the internal state of a pipeline into something more easy to use for further processing, e.g. to present it to a user. Functions taking a map step-id to step-result are usually called with the result of `lambdacd.state.core/get-step-results`
(build-duration step-ids-and-results)
Takes a map of step-ids to step results and returns the duration of a build in seconds (excluding time the build spent waiting)
Takes a map of step-ids to step results and returns the duration of a build in seconds (excluding time the build spent waiting)
(build-that-was-retriggered step-ids-and-results)
Takes a map of step-ids to step results and returns nil
(for normal builds) or the build number of the build that was retriggered.
Takes a map of step-ids to step results and returns `nil` (for normal builds) or the build number of the build that was retriggered.
(earliest-first-update step-ids-and-results)
Takes a map of step-ids to step results and finds the earliest timestamp for :first-updated-at
, usually the start time of a pipeline
Takes a map of step-ids to step results and finds the earliest timestamp for `:first-updated-at`, usually the start time of a pipeline
(history-for ctx)
Returns a build history for a given ctx;
Example:
> (history-for ctx)
[{:build-number 8
:status :waiting
:most-recent-update-at stop-time
:first-updated-at start-time
:retriggered nil
:duration-in-sec 10
:build-metadata {:some :metadata}}
{:build-number 9
:status :running
:most-recent-update-at stop-time
:first-updated-at start-time
:retriggered 2
:duration-in-sec 10
:build-metadata {}}]
Returns a build history for a given ctx; Example: ```clojure > (history-for ctx) [{:build-number 8 :status :waiting :most-recent-update-at stop-time :first-updated-at start-time :retriggered nil :duration-in-sec 10 :build-metadata {:some :metadata}} {:build-number 9 :status :running :most-recent-update-at stop-time :first-updated-at start-time :retriggered 2 :duration-in-sec 10 :build-metadata {}}] ```
(latest-most-recent-update step-ids-and-results)
Takes a map of step-ids to step results and finds the latest timestamp for :most-recent-update-at
, usually the end or most recent update of a pipeline
Takes a map of step-ids to step results and finds the latest timestamp for `:most-recent-update-at`, usually the end or most recent update of a pipeline
(most-recent-step-result-with key ctx)
Searches the build history for the current build-step (as denoted by the :step-id
in ctx
) for a step result with a particular key and returns the complete step result.
Searches the build history for the current build-step (as denoted by the `:step-id` in `ctx`) for a step result with a particular key and returns the complete step result.
(overall-build-status step-ids-and-results)
Takes a map of step-ids to step results and returns the status of the pipeline as a whole:
> (overall-build-status {'(0) {:status :success :most-recent-update-at stop-time :first-updated-at start-time}
'(1) {:status :running :most-recent-update-at stop-time :first-updated-at start-time}})
:running
Takes a map of step-ids to step results and returns the status of the pipeline as a whole: ```clojure > (overall-build-status {'(0) {:status :success :most-recent-update-at stop-time :first-updated-at start-time} '(1) {:status :running :most-recent-update-at stop-time :first-updated-at start-time}}) :running ```
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close