domain

package
v0.2.16 Latest Latest
Warning

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

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

Documentation

Overview

Package domain holds neutral types shared across components.

Index

Constants

View Source
const RunnerNamePrefix = "ushr-"

RunnerNamePrefix identifies jobs served by this fleet.

View Source
const RunnerNameSuffixLength = 26

RunnerNameSuffixLength leaves room for a 32-character host in GitHub’s 64-character runner name.

Variables

This section is empty.

Functions

func LabelsSatisfied

func LabelsSatisfied(required, advertised []string) bool

LabelsSatisfied reports whether every label a job requires is advertised by a runner. Case-insensitive: GitHub preserves the case a workflow wrote and an operator's config rarely matches it.

Both the control plane (deciding what to offer an agent) and the agent (deciding what is worth reporting) must apply the same test — an agent that reports work it can never be offered leaks that work into its queue forever, because nothing but running a job to completion clears an entry.

func RandomName

func RandomName(prefix string) string

RandomName keeps short names for local runtime resources.

func RunnerName

func RunnerName(agent string) string

RunnerName identifies an attempt; retries must never overwrite an earlier attempt's telemetry.

func SplitRepoScope

func SplitRepoScope(scope string) (owner, repo string, ok bool)

SplitRepoScope splits an "owner/repo" scope. ok is false for an org scope (a '/' is legal in neither an org login nor a bare repo name).

Types

type Job

type Job struct {
	// Org is the tenant scope: a GitHub org login, or "owner/repo" for a
	// repo-scoped target (personal accounts have no org-level runner pool, so
	// their runners are per-repo). Everything downstream — dispatch dedup, the
	// enrollment-token grant set, tenant matching — treats it as an opaque
	// string; only the agent's GitHub calls interpret org vs repo. See SplitRepoScope.
	Org      string
	Repo     string
	RunID    int64
	JobID    int64
	Labels   []string
	QueuedAt time.Time

	// PassStart, when set, makes this a pass marker that carries no work: the
	// source finished a clean pass over Org that began at PassStart, and has
	// already sent every job still queued there. A job the consumer last
	// received before PassStart is no longer queued.
	PassStart time.Time
}

Job is a queued unit of work that needs a runner.

Jump to

Keyboard shortcuts

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