common

package
v0.49.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InferenceStatusWIFProvider added in v0.44.0

func InferenceStatusWIFProvider(
	binary, token, target, project string,
	runCLI CLIRunnerFunc,
	logf func(string, ...any),
) (string, error)

InferenceStatusWIFProvider runs "inference status" and returns the WIF provider when the status is healthy. Any other status is an error.

func ParseInferenceStatusWIFProvider

func ParseInferenceStatusWIFProvider(output string) (string, error)

ParseInferenceStatusWIFProvider extracts the WIF provider from fullsend inference status JSON output.

func ProvisionInference

func ProvisionInference(
	binary, token, target, project string,
	runCLI CLIRunnerFunc,
	logf func(string, ...any),
) (string, error)

ProvisionInference runs inference provision, then inference status, and returns the WIF provider resource name. The provider must be healthy.

func ResolveInferenceWIFProvider added in v0.44.0

func ResolveInferenceWIFProvider(
	binary, token, target, project string,
	runCLI CLIRunnerFunc,
	logf func(string, ...any),
) (string, error)

ResolveInferenceWIFProvider returns the healthy WIF provider for target. It reads "inference status" first and runs "inference provision" only when the provider is missing or not healthy, so an enrolled repo costs no IAM writes.

func RunGitHubSetup

func RunGitHubSetup(
	binary, token, target, mintURL, gcpProjectID string,
	runCLI CLIRunnerFunc,
	logf func(string, ...any),
) error

RunGitHubSetup runs fullsend github setup for the given target with the provided mint URL. If gcpProjectID is non-empty, the inference WIF provider is resolved first (see ResolveInferenceWIFProvider) and threaded to setup.

func RunGitHubSetupWithOpts added in v0.43.0

func RunGitHubSetupWithOpts(
	binary, token, target, mintURL, gcpProjectID string,
	opts GitHubSetupOpts,
	runCLI CLIRunnerFunc,
	logf func(string, ...any),
) error

RunGitHubSetupWithOpts is like RunGitHubSetup but accepts GitHubSetupOpts to control vendoring and fullsend-ref behaviour.

Types

type CLIRunnerFunc

type CLIRunnerFunc = func(binary, token string, args ...string) (string, error)

CLIRunnerFunc is the signature for running a fullsend CLI command.

type GitHubSetupOpts added in v0.43.0

type GitHubSetupOpts struct {
	// Vendor controls whether --vendor is passed. When false,
	// FullsendRef must be set so the shim references a remote ref
	// instead of a vendored binary.
	Vendor bool

	// FullsendRef is passed as --fullsend-ref when non-empty. Used in
	// non-vendored mode to pin the reusable workflow ref (e.g. "main").
	FullsendRef string

	// ConfigPreset is passed as --config when non-empty (a local path
	// or HTTPS URL to a config base layer preset). When set, --runtime
	// dummy is omitted so the preset's runtime: dummy is inherited
	// rather than pinned in the overlay.
	ConfigPreset string

	// Runtime overrides the runtime passed to github setup. When empty,
	// github setup uses the normal "dummy" runtime. Playback suites set
	// this to "dummy-playback" while retaining the standard repo-pool
	// lifecycle (allocation, install, validation, teardown).
	Runtime string

	// AppSet selects the GitHub App identities used by the configured mint.
	AppSet string

	// ResolveWIFProvider, when set, returns the inference WIF provider
	// for target in project. Callers use it to cache or serialise the
	// lookup. When nil, ResolveInferenceWIFProvider is used.
	ResolveWIFProvider func(target, project string) (string, error)
}

GitHubSetupOpts configures how RunGitHubSetupWithOpts invokes `fullsend github setup`. Use DefaultGitHubSetupOpts() for vendored-mode defaults (zero value is non-vendored).

func DefaultGitHubSetupOpts added in v0.43.0

func DefaultGitHubSetupOpts() GitHubSetupOpts

DefaultGitHubSetupOpts returns vendored-mode defaults.

Jump to

Keyboard shortcuts

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