githubactions

package
v0.44.0-rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(client forge.Client, token string) ci.Driver

Types

type Driver

type Driver struct {
	Client forge.Client
	Token  string
	// contains filtered or unexported fields
}

Driver implements ci.Driver against GitHub Actions.

func (*Driver) AssertNoHarnessAgentArtifact

func (d *Driver) AssertNoHarnessAgentArtifact(ctx context.Context, owner, repo, agent string, after time.Time) error

AssertNoHarnessAgentArtifact asserts that the named agent's harness job did not run after the trigger time. It checks workflow run jobs rather than artifacts so that sibling runs for other agents are not mistaken for evidence.

func (*Driver) AssertNoWorkflow

func (d *Driver) AssertNoWorkflow(ctx context.Context, owner, repo, workflowFile string, after time.Time) error

func (*Driver) CountHarnessDispatches added in v0.32.0

func (d *Driver) CountHarnessDispatches(ctx context.Context, owner, repo, agent string, after time.Time) (int, error)

CountHarnessDispatches returns the number of harness workflow runs that scheduled the "Harness run (<agent>)" job after the trigger time.

Runs where the agent's job was cancelled or skipped are excluded. GitHub's concurrency groups cancel duplicate runs when two events (e.g. synchronize + labeled) race, and webhook at-least-once delivery can trigger duplicate workflow runs for the same event. In both cases the concurrency group cancels the superseded run, and counting it would produce a false-positive exact-count assertion failure (#6053).

The count settles before it is returned: a run whose agent job has not reached a terminal conclusion — or whose job matrix has not expanded yet — is polled until it completes, so an in-flight duplicate is classified by its final conclusion instead of being counted while its cancellation is still in progress.

func (*Driver) DownloadArtifacts

func (d *Driver) DownloadArtifacts(ctx context.Context, owner, repo string, runID int, destDir string) error

func (*Driver) DownloadNamedArtifactAfter

func (d *Driver) DownloadNamedArtifactAfter(ctx context.Context, owner, repo, artifactName string, after time.Time, destDir string) error

func (*Driver) DownloadNamedArtifactFromRun

func (d *Driver) DownloadNamedArtifactFromRun(ctx context.Context, owner, repo string, runID int, artifactName string, destDir string) error

func (*Driver) FindCompletedWorkflowRun

func (d *Driver) FindCompletedWorkflowRun(ctx context.Context, owner, repo, workflowFile string, after time.Time) (*forge.WorkflowRun, error)

func (*Driver) GetRunLogs

func (d *Driver) GetRunLogs(ctx context.Context, owner, repo string, runID int) (string, error)

func (*Driver) WaitForFailedHarnessAgent added in v0.35.1

func (d *Driver) WaitForFailedHarnessAgent(ctx context.Context, owner, repo, agent string, after time.Time) (*forge.WorkflowRun, error)

WaitForFailedHarnessAgent waits for the named agent's harness run to complete with a terminal failure conclusion. It errors out early when the run completes successfully instead — callers use this to assert a refuse-to-push (or similar fail-closed) path.

Detection is artifact-first: the fullsend action uploads the fullsend-<agent> artifact with `if: always()`, so it exists for failed runs too, and it is the only signal that works for both standard stage jobs (named e.g. "Code"/"Fix") and custom-harness matrix jobs (named "Harness run (<agent>)"). The job-name scan is a fallback for custom-harness runs that failed before uploading the artifact.

Listing failures are recorded and reported on timeout, as in WaitForHarnessAgent.

func (*Driver) WaitForHarnessAgent

func (d *Driver) WaitForHarnessAgent(ctx context.Context, owner, repo, agent string, after time.Time) (*forge.WorkflowRun, error)

WaitForHarnessAgent waits for a successful harness-run workflow job for the named agent. It fails fast only when a workflow run that contains the agent's "Harness run (<agent>)" job reaches a terminal failure conclusion and no newer run for the same agent is still pending or has already succeeded. A dual-dispatch race can leave an earlier sibling concluding failure while a later run of the same agent goes on to succeed (#7574). Sibling workflow runs that do not schedule the agent's job are ignored. On a fail-fast the failed run is returned together with the error, so the caller can save its logs before the scenario's repository is deleted.

Listing failures never end the wait — the loop keeps polling — but they are counted and reported on timeout so that a wait spent rate limited is not mistaken for a harness that never ran (#6697).

func (*Driver) WaitForWorkflow

func (d *Driver) WaitForWorkflow(ctx context.Context, owner, repo, workflowFile string, after time.Time, event string) (*forge.WorkflowRun, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL