gitlabci

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: 11 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

New creates a GitLab CI driver backed by the given forge client.

Types

type Driver

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

Driver implements ci.Driver against GitLab CI pipelines.

Concurrency: the Driver is an immutable wrapper around forge.Client (which is itself safe for concurrent use) and holds no unsynchronized mutable fields (Client and Token are both set at construction and never modified). Sharing a single Driver across goroutines via World.Clone is safe by design. TestConcurrentAccess exercises the real driver under -race with a FakeClient.

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.

func (*Driver) AssertNoWorkflow

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

AssertNoWorkflow asserts that no pipeline was created after the trigger time within a settling window.

func (*Driver) CountHarnessDispatches

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

CountHarnessDispatches returns the number of pipelines that scheduled the agent's harness job after the trigger time. Cancelled/skipped jobs are excluded. The count settles before returning.

func (*Driver) DownloadArtifacts

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

DownloadArtifacts downloads all artifacts from a pipeline's jobs.

func (*Driver) DownloadNamedArtifactAfter

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

DownloadNamedArtifactAfter polls for a repository-level artifact matching the name created after the trigger time, then downloads it.

func (*Driver) DownloadNamedArtifactFromRun

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

DownloadNamedArtifactFromRun downloads a specific named artifact from a pipeline. On GitLab, artifact names correspond to job names.

func (*Driver) FindCompletedWorkflowRun

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

FindCompletedWorkflowRun finds a completed successful pipeline after the given time.

func (*Driver) GetRunLogs

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

GetRunLogs retrieves the concatenated logs for all jobs in a pipeline.

func (*Driver) WaitForFailedHarnessAgent

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.

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 pipeline job for the named agent, using artifact-first detection with job-name fallback. On a fail-fast the failed pipeline is returned together with the error, so the caller can save its logs before the scenario's repository is deleted.

func (*Driver) WaitForWorkflow

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

WaitForWorkflow polls for a pipeline created after the trigger time and waits for it to complete successfully.

Jump to

Keyboard shortcuts

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