artifacts

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package artifacts abstracts where per-run report artifacts ultimately live.

A hook always writes its outputs to a local staging directory Arena hands it and records {name, description, filename} in manifest.json — it never knows or cares about the backend. After the hook runs, Arena ingests the staged manifest through a Store: the local backend leaves bytes in place and returns a relative link; a future S3/DB backend would upload and return a URL/key. Flipping the backend is a config change, never a hook change.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ingest

func Ingest(ctx context.Context, store Store, artifactsDir, runID string) error

Ingest reads the staged manifest in artifactsDir, persists each artifact via store, and rewrites the manifest with resolved References. It is a no-op when no manifest exists (no hook recorded anything). Malformed manifests error.

Types

type Local

type Local struct{}

Local is the default backend: bytes already live under the report's output dir (the hook wrote them there), so Store is a no-op that returns the relative link the report can follow from disk.

func NewLocal

func NewLocal() *Local

NewLocal returns the local artifact store.

func (*Local) Store

func (l *Local) Store(_ context.Context, runID, filename, _ string) (Reference, error)

Store returns the relative report link for an artifact left in place.

type Reference

type Reference string

Reference is a link the report resolves to an artifact: a relative path for the local backend, or an absolute URL/key for a remote one.

type ResolvedEntry

type ResolvedEntry struct {
	Name        string    `json:"name"`
	Description string    `json:"description"`
	Ref         Reference `json:"ref"`
}

ResolvedEntry is what Arena writes after storing — the Reference replaces the hook's filename. This is what the report reads.

type ResolvedManifest

type ResolvedManifest struct {
	Artifacts []ResolvedEntry `json:"artifacts"`
}

ResolvedManifest is the manifest after ingestion.

type StagedEntry

type StagedEntry struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Filename    string `json:"filename"`
}

StagedEntry is what a hook records — it owns name/description/filename.

type StagedManifest

type StagedManifest struct {
	Artifacts []StagedEntry `json:"artifacts"`
}

StagedManifest is the on-disk manifest a hook writes.

type Store

type Store interface {
	Store(ctx context.Context, runID, filename, localPath string) (Reference, error)
}

Store persists a staged artifact (written locally by a hook at localPath) and returns a Reference. Implementations decide where the bytes ultimately live.

Jump to

Keyboard shortcuts

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