Skip to content

@usine/core/step/harvest

git or GitHub answered a harvesting command with output that is not a valid result.

  • Schema.Class

new HarvestError(…args): HarvestError

Parameter Type
…args [props: object, options?: MakeOptions]

HarvestError

readonly cause: unknown

readonly message: string

readonly stage: "git" | "github"

HarvestCommand<E> = (command, args) => Effect.Effect<ReadonlyArray<string>, E>

Runs one read-only git or gh command in the Attempt’s checkout and returns its stdout lines. A non-zero exit is the runner’s own failure.

Type Parameter
E
Parameter Type
command "git" | "gh"
args ReadonlyArray<string>

Effect.Effect<ReadonlyArray<string>, E>


HarvestSpec = Pick<RunSpec, "attemptId" | "repository" | "revision" | "baseCommit">

The part of an Attempt’s RunSpec that harvesting reads: where its checkout started and what it was given.

const harvestFacts: <E>(spec, run) => Effect.Effect<readonly (Comment | Commit | PullRequest)[], E | HarvestError, never>

The facts an Attempt’s checkout holds once its agent has finished: new commits, then the pull requests at its final commit. Pull request discovery is read-only enrichment, so a GitHub failure or a ten-second stall keeps the commits and records no pull request rather than failing completed work.

Type Parameter
E extends object
Parameter Type
spec HarvestSpec
run HarvestCommand<E>

Effect.Effect<readonly (Comment | Commit | PullRequest)[], E | HarvestError, never>