Skip to content

postAggregate

postAggregate(input): Promise<PostAggregateResult>

Defined in: cli/astromech/src/aggregate/post-aggregate/post-aggregate.ts:49

Computes the ci aggregate for one commit from the state the API holds and makes the check run say it. This is the one writer: Sentinel’s webhook handler, the reconcile ci command and the scheduled sweep all call it, so a verdict is the same whoever asks.

Every call reads the whole state again (the payload of a webhook is never used), finds the aggregate’s run by name and updates it, or creates one when there is none. After a create it lists the runs again and, when two writers raced, keeps the oldest and completes the others as neutral. After every write it reads once more and writes again if the verdict moved, so a slow older computation cannot leave a stale in_progress over a success.

PostAggregateInput

Promise<PostAggregateResult>