releaseevidence

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: Apache-2.0 Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package releaseevidence creates and verifies versioned RobotGo release evidence snapshots.

Index

Constants

View Source
const (
	// SchemaVersion identifies the release-evidence JSON contract.
	SchemaVersion = "1"
)

Variables

This section is empty.

Functions

func Write

func Write(path string, snapshot Snapshot) error

Write stores a snapshot as indented JSON without replacing an existing evidence file.

Types

type CI

type CI struct {
	Provider   string `json:"provider"`
	RunID      string `json:"run_id"`
	RunAttempt int    `json:"run_attempt"`
	Matrix     string `json:"matrix"`
}

CI identifies the GitHub Actions execution and matrix cell.

type Config

type Config struct {
	Commit      string
	Tree        string
	Ref         string
	RunID       string
	RunAttempt  int
	Matrix      string
	TestCommand string
	TestLogPath string
	ExpectedCGO bool
}

Config contains trusted workflow inputs used to create a Snapshot.

type Expectations

type Expectations struct {
	Matrix      string
	Commit      string
	Tree        string
	Ref         string
	TestCommand string
}

Expectations bind a verified evidence file to its expected matrix cell and optionally to an exact source and test command.

type Snapshot

type Snapshot struct {
	SchemaVersion string                     `json:"schema_version"`
	Source        Source                     `json:"source"`
	CI            CI                         `json:"ci"`
	Toolchain     Toolchain                  `json:"toolchain"`
	Test          Test                       `json:"test"`
	Diagnostics   robotgo.RuntimeDiagnostics `json:"runtime_diagnostics"`
}

Snapshot is the versioned, machine-readable release-evidence document.

func Generate

func Generate(ctx context.Context, config Config) (Snapshot, error)

Generate builds a release-evidence snapshot and verifies that the running RobotGo build matches the requested CGO matrix cell.

func Verify

func Verify(path string, expected Expectations) (Snapshot, error)

Verify reads an evidence file, validates its schema and expected identity, and verifies the adjacent test log against the recorded SHA-256 digest.

type Source

type Source struct {
	Commit string `json:"commit"`
	Tree   string `json:"tree"`
	Ref    string `json:"ref"`
}

Source identifies the exact repository state used for a release check.

type Test

type Test struct {
	Command   string `json:"command"`
	Result    string `json:"result"`
	LogFile   string `json:"log_file"`
	LogSHA256 string `json:"log_sha256"`
}

Test records the passed command and the digest of its complete log.

type Toolchain

type Toolchain struct {
	GoVersion string `json:"go_version"`
}

Toolchain identifies the Go toolchain that generated the evidence.

Jump to

Keyboard shortcuts

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