checks

package
v0.1.3 Latest Latest
Warning

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

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

Documentation

Overview

Package checks holds the Githome web front's commit-checks surface: the page at /{owner}/{repo}/checks/{ref} that shows the status-check rollup for a ref, its check-run rows, and its commit-status rows. It is the backed slice of the Actions UI Spec 2005 doc 11 describes. Githome's domain models the check-run, check-suite, and commit-status state machines and their combined rollup (Spec 2003 docs 05 and 10), not the full Actions run engine (workflow runs, the needs job graph, live log streaming, artifacts, caches, deployments); those have no store behind them, so the front renders the checks it can back and leaves the run engine absent rather than faking it, the same honest absence the settings and search surfaces took for what they cannot yet back.

The page is read-only and read-gated: the Resolve middleware loads the repository for the viewer, turning a missing or invisible repository into a 404 so the surface never confirms a private repository's existence (the 404-not-403 rule). A ref that does not resolve is the repo-scoped soft 404. The page never mutates, so it carries no CSRF form; the re-run, cancel, approve, and dispatch controls doc 11 sketches need the unbacked run engine and are absent.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deps

type Deps struct {
	Checks *domain.ChecksService
	Repos  *domain.RepoService
	Render *render.Set
	View   *view.Builder
	Logger *slog.Logger
}

Deps are the checks handlers' dependencies: the domain checks service for the rollup read, the repo service to resolve and read-gate the repository for the header bar, the render set, the view builder for the shell chrome, and a logger.

type Handlers

type Handlers struct {
	// contains filtered or unexported fields
}

Handlers is the checks handler set. One is built at boot and shared; it holds no per-request state.

func New

func New(d Deps) *Handlers

New wires the handler set from its dependencies.

func (*Handlers) Index

func (h *Handlers) Index(c *mizu.Ctx) error

Index renders the checks page for a ref. The ref is the whole greedy tail, so a branch with slashes resolves as one ref; an empty or unresolvable ref is the soft 404 (the service reports ErrValidation when the ref does not resolve to a sha). The rollup folds the ref's statuses and check runs into the page model.

func (*Handlers) Resolve

func (h *Handlers) Resolve(next mizu.Handler) mizu.Handler

Resolve loads the repository named by the {owner} and {repo} path parameters, read-gated for the viewer, and stores it on the context. A missing repository and a private one the viewer cannot see both render the same 404, so the surface never leaks a repository's existence through the status code. The handler reads the repository back with repoFromContext for the header bar; the checks service re-authorizes the read again on the rollup call, so this gate is the front door, never the only lock.

Jump to

Keyboard shortcuts

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