generic

package
v1.233.0 Latest Latest
Warning

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

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

Documentation

Overview

Package generic provides a fallback CI provider for when --ci flag is used but no specific CI platform is detected.

Index

Constants

View Source
const (
	// ProviderName is the name of the generic CI provider.
	ProviderName = "generic"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type OutputWriter

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

OutputWriter writes CI outputs for the generic provider.

func (*OutputWriter) WriteOutput

func (w *OutputWriter) WriteOutput(key, value string) error

WriteOutput writes a key-value pair to CI outputs. Without ATMOS_CI_OUTPUT it renders the line to the UI channel, using the heredoc form for multiline values.

func (*OutputWriter) WriteSummary

func (w *OutputWriter) WriteSummary(content string) error

WriteSummary writes content to the job summary.

type Provider

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

Provider is a fallback CI provider for when --ci flag is used but no specific CI platform is detected. It writes summaries to stdout and outputs to environment file or stdout.

func NewProvider

func NewProvider() *Provider

NewProvider creates a new generic CI provider. ATMOS_CI_OUTPUT and ATMOS_CI_SUMMARY are read when OutputWriter is called, not here, so a change to the environment after construction is honored.

func (*Provider) AddPath

func (p *Provider) AddPath(dir string) error

AddPath prepends dir to PATH for later steps. With ATMOS_CI_PATH set it appends dir to that file; otherwise it renders a shell `export PATH=` line.

func (*Provider) Annotate

func (p *Provider) Annotate(annotations []provider.Annotation) error

Annotate renders each annotation as one line: path:line: level: message, locating it by path and line when known.

func (*Provider) BindOutput

func (p *Provider) BindOutput(w io.Writer) provider.Provider

BindOutput returns a copy of the provider whose local renderings go to w instead of the global UI channel. The copy shares the check-run and comment counters and the comment ledger.

func (*Provider) Context

func (p *Provider) Context() (*provider.Context, error)

Context returns CI metadata from environment variables.

func (*Provider) CreateCheckRun

func (p *Provider) CreateCheckRun(_ context.Context, opts *provider.CreateCheckRunOptions) (*provider.CheckRun, error)

CreateCheckRun writes check run status to stderr and returns a synthetic CheckRun.

func (*Provider) Detect

func (p *Provider) Detect() bool

Detect returns false - this provider is never auto-detected. It's only used when CI mode is forced via --ci flag.

func (*Provider) EndLogGroup

func (p *Provider) EndLogGroup() error

EndLogGroup is a no-op: a plain terminal has nothing to close.

func (*Provider) GetStatus

GetStatus is not supported by the generic provider.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

func (*Provider) OutputWriter

func (p *Provider) OutputWriter() provider.OutputWriter

OutputWriter returns an OutputWriter for the generic provider.

func (*Provider) PostComment added in v1.218.0

PostComment renders a preview of the PR comment locally instead of posting it. A laptop run usually has no pull request number and often no owner/repo, so unlike platform providers this does not require them; it validates only the body and the marker-in-body invariant, then renders the masked body (raw when the provider is unbound, as terminal markdown when bound via BindOutput).

The provider remembers the markers it rendered, so behavior=update fails with ErrCICommentNotFound when no earlier comment in the process carries the marker, as it does on GitHub.

func (*Provider) PostCommitComment

func (p *Provider) PostCommitComment(_ context.Context, opts *provider.PostCommitCommentOptions) (*provider.Comment, error)

PostCommitComment renders a preview of a commit comment locally instead of posting it. Like PostComment it needs no owner or repository, only a body and the marker-in-body invariant.

func (*Provider) ReportSARIF

func (p *Provider) ReportSARIF(_ context.Context, report provider.SARIFReport) error

ReportSARIF notes that the report was produced but not uploaded. It names the report's file when known, and says why: the switch that is off when the reporter routed here because of a gate, otherwise that no CI provider is detected.

func (*Provider) ResolveBase added in v1.214.0

func (p *Provider) ResolveBase() (*provider.BaseResolution, error)

ResolveBase returns the base commit for affected detection in the generic provider. It reads the ATMOS_CI_BASE_REF environment variable for explicit base override. Returns nil when no env var is set (falls through to default behavior).

func (*Provider) StartLogGroup

func (p *Provider) StartLogGroup(title string) error

StartLogGroup renders the group title as a heading line.

func (*Provider) UpdateCheckRun

func (p *Provider) UpdateCheckRun(_ context.Context, opts *provider.UpdateCheckRunOptions) (*provider.CheckRun, error)

UpdateCheckRun writes check run status to stderr and returns an updated CheckRun.

func (*Provider) WriteEnv

func (p *Provider) WriteEnv(key, value string) error

WriteEnv exports key=value for later steps. With ATMOS_CI_ENV set it appends to that file in GitHub Actions format; otherwise it renders a shell `export` line.

ATMOS_CI_ENV and ATMOS_CI_PATH are read at call time, as are ATMOS_CI_OUTPUT and ATMOS_CI_SUMMARY (when OutputWriter is called).

Jump to

Keyboard shortcuts

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