Documentation
¶
Overview ¶
Package provider defines the CI/CD provider interface and related types.
Index ¶
- func AppendFile(path, content string, sentinel error) error
- func FormatCheckRunName(action, stack, component string) string
- func FormatOutputLine(key, value string) string
- func FormatStatusContext(prefix string, parts ...string) (string, error)
- func LabelsReviewNumber(run *Context) int
- func MaskPublishedContent(content string) string
- func ValidateLabelsContext(run *Context) error
- func ValidatePostCommentOptions(opts *PostCommentOptions) error
- func ValidatePostCommitCommentOptions(opts *PostCommitCommentOptions) error
- type Annotation
- type AnnotationLevel
- type Annotator
- type ApplyOutputOptions
- type BaseResolution
- type BranchStatus
- type CacheProvider
- type CheckRun
- type CheckRunState
- type CheckStatus
- type CheckStatusState
- type Comment
- type CommentBehavior
- type CommentTarget
- type CommitCommenter
- type ConfigValidator
- type Context
- type CreateCheckRunOptions
- type DebugModeDetector
- type EnvExporter
- type FileOutputWriter
- type LabelReader
- type LogGrouper
- type LogGroupingSuppressor
- type MergeQueueInfo
- type NoopOutputWriter
- type OutputBinder
- type OutputHelpers
- type OutputWriter
- type PRInfo
- type PRStatus
- type PlanOutputOptions
- type PostCommentOptions
- type PostCommitCommentOptions
- type Provider
- type SARIFReport
- type SARIFReporter
- type SBOMReport
- type SBOMUpload
- type SBOMUploader
- type Status
- type StatusOptions
- type UpdateCheckRunOptions
- type ValueMasker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendFile ¶
AppendFile appends content to the file at path, creating it when needed. Open and write failures are wrapped in sentinel so callers get the right CI error kind.
func FormatCheckRunName ¶
FormatCheckRunName creates a standardized check run name for Atmos. Deprecated: Use FormatStatusContext instead.
func FormatOutputLine ¶
FormatOutputLine renders key=value for CI output files. Multiline values use a heredoc whose delimiter is EOF, extended with underscores until it no longer appears in the value. The GitHub Actions runner accepts any delimiter; this scheme is kept because pipelines and golden tests parse it.
func FormatStatusContext ¶
FormatStatusContext creates a standardized status context string for Atmos. Parts are joined with "/" separator. Example: FormatStatusContext("atmos", "plan", "dev", "vpc") -> "atmos/plan/dev/vpc". Example: FormatStatusContext("atmos", "plan", "dev", "vpc", "add") -> "atmos/plan/dev/vpc/add". A status context is always about a specific, fully-resolved target: every part (including prefix) must be non-empty, or the result would silently collapse into a differently-malformed but still-wrong name (e.g. "atmos/plan/dev/" or "atmos/plan") that looks like a valid, coarser-grained status instead of a bug.
func LabelsReviewNumber ¶
LabelsReviewNumber identifies the review supplying labels for this run.
func MaskPublishedContent ¶ added in v1.229.0
MaskPublishedContent applies the global secret masker before CI content leaves the process through a human-facing provider surface.
func ValidateLabelsContext ¶
ValidateLabelsContext requires a complete review identity before reading its labels.
func ValidatePostCommentOptions ¶
func ValidatePostCommentOptions(opts *PostCommentOptions) error
ValidatePostCommentOptions rejects nil or incomplete option structs, and enforces the marker-in-body invariant so repeat runs can reliably reconcile against the same comment. An upsert that writes a body without its marker would leave a comment that future runs cannot match — breaking idempotency and causing duplicate comments on subsequent plans.
func ValidatePostCommitCommentOptions ¶
func ValidatePostCommitCommentOptions(opts *PostCommitCommentOptions) error
ValidatePostCommitCommentOptions rejects nil or incomplete option structs and enforces the marker-in-body invariant, as ValidatePostCommentOptions does for pull request comments.
Types ¶
type Annotation ¶ added in v1.222.0
type Annotation struct {
Path string
StartLine int
EndLine int
Level AnnotationLevel
Title string
Message string
}
Annotation is a provider-neutral, line-anchored finding. Scanner hooks build these from parsed SARIF findings and hand them to the active provider's Annotator; the provider renders them inline on the change (GitHub: workflow annotations on the PR diff). StartLine is 1-based; 0 means "unknown", in which case the annotation anchors at the file level.
type AnnotationLevel ¶ added in v1.222.0
type AnnotationLevel string
AnnotationLevel is the severity bucket a CI annotation renders as. The values mirror the three levels GitHub Actions workflow commands support (`::error` / `::warning` / `::notice`); other providers map them to their nearest equivalent.
const ( // AnnotationError is the highest level (GitHub: ::error). AnnotationError AnnotationLevel = "error" // AnnotationWarning is the middle level (GitHub: ::warning). AnnotationWarning AnnotationLevel = "warning" // AnnotationNotice is the lowest level (GitHub: ::notice). AnnotationNotice AnnotationLevel = "notice" )
type Annotator ¶ added in v1.222.0
type Annotator interface {
// Annotate renders the given annotations in the current run. It is
// best-effort from the caller's perspective: a returned error is logged,
// never fatal.
Annotate(annotations []Annotation) error
}
Annotator is an optional capability for providers that can render line-anchored annotations in the current run (GitHub Actions: `::error` / `::warning` workflow commands shown inline on the PR diff). Providers implement this when their platform surfaces per-line annotations from log output without needing GitHub Advanced Security.
type ApplyOutputOptions ¶
ApplyOutputOptions contains options for writing apply outputs.
type BaseResolution ¶ added in v1.214.0
type BaseResolution struct {
// Ref is a git reference (branch/tag). Mutually exclusive with SHA.
Ref string
// SHA is a git commit hash. Mutually exclusive with Ref.
SHA string
// HeadSHA is the PR head commit SHA for upload correlation with Atmos Pro.
// Populated for pull_request events from event.pull_request.head.sha.
// Empty for non-PR events (push, merge_group, etc.).
HeadSHA string
// TargetBranch is the PR target branch name (e.g., "main") when known.
// Used by callers to recover from missing local refs by running a
// targeted git fetch. Empty when the event has no notion of a target
// branch (e.g., push events on the default branch).
TargetBranch string
// Source describes where the base was resolved from (for logging).
Source string
// EventType describes the CI event (e.g., "pull_request", "push").
EventType string
// Checkout classifies what commit the workflow actually checked out,
// relative to the event payload (e.g., "head.sha", "merge-commit",
// "synthetic-merge", "unknown"). Base-resolution strategies are only
// correct for specific checkouts, so surfacing the classification in
// logs makes wrong-base incidents diagnosable from a single line.
// Empty for events where the distinction does not apply.
Checkout string
}
BaseResolution contains the resolved base commit for affected detection.
type BranchStatus ¶
type BranchStatus struct {
// Branch is the branch name.
Branch string
// PullRequest is the PR associated with this branch (nil if none).
PullRequest *PRStatus
// CommitSHA is the HEAD commit SHA.
CommitSHA string
// Checks are the status checks for this branch/commit.
Checks []*CheckStatus
}
BranchStatus contains status information for a specific branch.
type CacheProvider ¶ added in v1.222.0
type CacheProvider interface {
// Cache returns the provider's cache backend.
Cache() (cache.Backend, error)
}
CacheProvider is an optional capability for CI providers that expose a remote build cache (for example, the GitHub Actions cache). Providers implement this when their platform offers a documented cache store reachable from within a run. Cache() returns errUtils.ErrCacheUnavailable when the provider is active but the cache cannot be reached in the current environment (e.g. the runtime cache token is absent).
type CheckRun ¶
type CheckRun struct {
// ID is the unique identifier for this check run.
ID int64
// Name is the check run name (e.g., "atmos/plan: plat-ue2-dev/vpc").
Name string
// Status is the current state of the check run.
Status CheckRunState
// Conclusion is the final conclusion (success, failure, etc.).
Conclusion string
// Title is a short title for the check run output.
Title string
// Summary is a markdown summary of the check run results.
Summary string
// DetailsURL is a link back to the CI run details.
DetailsURL string
// StartedAt is when the check run started.
StartedAt time.Time
// CompletedAt is when the check run completed.
CompletedAt time.Time
}
CheckRun represents a status check on a commit (like Atlantis status checks).
type CheckRunState ¶
type CheckRunState string
CheckRunState represents the state of a check run.
const ( // CheckRunStatePending indicates the check run has not started. CheckRunStatePending CheckRunState = "pending" // CheckRunStateInProgress indicates the check run is in progress. CheckRunStateInProgress CheckRunState = "in_progress" // CheckRunStateSuccess indicates the check run completed successfully. CheckRunStateSuccess CheckRunState = "success" // CheckRunStateFailure indicates the check run failed. CheckRunStateFailure CheckRunState = "failure" // CheckRunStateError indicates an error occurred during the check run. CheckRunStateError CheckRunState = "error" // CheckRunStateCancelled indicates the check run was cancelled. CheckRunStateCancelled CheckRunState = "cancelled" )
type CheckStatus ¶
type CheckStatus struct {
// Name is the check name.
Name string
// Status is the check status (e.g., "queued", "in_progress", "completed").
Status string
// Conclusion is the check conclusion (e.g., "success", "failure", "neutral").
Conclusion string
// DetailsURL is a link to the check details.
DetailsURL string
}
CheckStatus contains status information for a single check.
func (*CheckStatus) CheckState ¶
func (c *CheckStatus) CheckState() CheckStatusState
CheckState returns the simplified state for display.
type CheckStatusState ¶
type CheckStatusState string
CheckStatusState represents the simplified state for display.
const ( // CheckStatusStatePending indicates the check is pending or in progress. CheckStatusStatePending CheckStatusState = "pending" // CheckStatusStateSuccess indicates the check passed. CheckStatusStateSuccess CheckStatusState = "success" // CheckStatusStateFailure indicates the check failed. CheckStatusStateFailure CheckStatusState = "failure" // CheckStatusStateCancelled indicates the check was cancelled. CheckStatusStateCancelled CheckStatusState = "cancelled" // CheckStatusStateSkipped indicates the check was skipped. CheckStatusStateSkipped CheckStatusState = "skipped" )
type Comment ¶ added in v1.218.0
type Comment struct {
// ID is the provider-specific comment ID.
ID int64
// URL is the HTML URL of the comment (if known).
URL string
// Body is the final body that was written.
Body string
// Created indicates whether a new comment was created (true) or an
// existing one was updated (false).
Created bool
// Target is where the comment landed: CommentTargetPR or CommentTargetCommit.
// The reporter sets it; providers need not.
Target CommentTarget
}
Comment represents a PR/MR comment returned by PostComment.
type CommentBehavior ¶ added in v1.218.0
type CommentBehavior string
CommentBehavior controls how PostComment reconciles an incoming comment against existing comments on the same PR/MR.
const ( // CommentBehaviorCreate always creates a new comment, even if a comment // with the same marker already exists. CommentBehaviorCreate CommentBehavior = "create" // CommentBehaviorUpdate updates an existing comment matched by marker. // Returns ErrCICommentNotFound when no matching comment exists. CommentBehaviorUpdate CommentBehavior = "update" // CommentBehaviorUpsert updates an existing comment matched by marker, // creating a new one when none matches. This is the default. CommentBehaviorUpsert CommentBehavior = "upsert" )
func NormalizeBehavior ¶
func NormalizeBehavior(b CommentBehavior) (CommentBehavior, error)
NormalizeBehavior resolves the configured behavior. An empty value defaults to upsert; any other value must be one of the declared CommentBehavior constants. Unknown values fail fast so typos in ci.comments.behavior surface immediately rather than silently behaving as upsert.
type CommentTarget ¶
type CommentTarget string
CommentTarget selects where a comment lands: on the pull request or on the commit.
const ( // CommentTargetAuto posts to the pull request when one is known and to the commit otherwise. // An empty target means auto. CommentTargetAuto CommentTarget = "auto" // CommentTargetPR posts to the pull request and fails when none is known. CommentTargetPR CommentTarget = "pr" // CommentTargetCommit posts a commit comment on the run's commit SHA. CommentTargetCommit CommentTarget = "commit" )
func NormalizeTarget ¶
func NormalizeTarget(t CommentTarget) (CommentTarget, error)
NormalizeTarget resolves the configured target. An empty value means auto; any other value must be one of the declared CommentTarget constants.
type CommitCommenter ¶
type CommitCommenter interface {
// PostCommitComment posts or upserts a comment on a commit, matching an existing comment
// by the marker as PostComment does.
PostCommitComment(ctx context.Context, opts *PostCommitCommentOptions) (*Comment, error)
}
CommitCommenter is an optional capability for providers that can comment on a commit, which is how a run with no pull request (a push) reports in the same place a pull request comment would. Providers without it make a commit-targeted comment fall back to local rendering.
type ConfigValidator ¶
type ConfigValidator interface {
// ValidateConfig returns an error when the provider's environment is unusable.
ValidateConfig() error
}
ConfigValidator is an optional capability for providers whose environment can be misconfigured in a way that must stop the run before any write is attempted, for example an unparsable API base URL that would otherwise send the token nowhere useful.
type Context ¶
type Context struct {
// Provider is the name of the CI provider (e.g., "github-actions").
Provider string
// RunID is the unique identifier for this CI run.
RunID string
// RunNumber is the run number (increments per workflow).
RunNumber int
// RunURL links to this CI run's page (e.g. the GitHub Actions run URL). Empty when the provider cannot determine it.
RunURL string
// Workflow is the name of the workflow.
Workflow string
// Job is the name of the current job.
Job string
// Actor is the user or app that triggered the workflow.
Actor string
// EventName is the event that triggered the workflow (e.g., "push", "pull_request").
EventName string
// ElevatedEvent reports whether the triggering event runs with the base
// repository's secrets while the workspace may contain untrusted fork
// content (GitHub's pull_request_target and workflow_run). Providers set
// this so the provider-agnostic fork-checkout safety gate can refuse to
// clone fork content under these events without an explicit opt-in.
// See docs/prd/native-ci/framework/fork-pr-trust-gate.md.
ElevatedEvent bool
// Ref is the git ref (e.g., "refs/heads/main").
Ref string
// Branch is the branch name (e.g., "main", "feature/foo").
Branch string
// SHA is the git commit SHA.
SHA string
// Repository is the full repository name (e.g., "owner/repo").
Repository string
// RepoOwner is the repository owner.
RepoOwner string
// RepoName is the repository name.
RepoName string
// ServerURL is the base URL of the SCM host running this CI
// (e.g., "https://github.com" or a GitHub Enterprise URL).
// Empty when the provider cannot determine it.
ServerURL string
// CloneURL is the URL to clone the current repository, used by
// `atmos git clone` for CI checkout replacement. Each provider
// constructs it from its own metadata; empty when the provider
// cannot determine it.
CloneURL string
// PullRequest contains PR info if this is a pull request event.
PullRequest *PRInfo
// MergeQueue identifies the review associated with a merge-queue check run.
// It is separate from PullRequest: the checkout and status target are still
// the synthetic queue commit, not the pull request's head commit.
MergeQueue *MergeQueueInfo
}
Context contains CI run metadata.
type CreateCheckRunOptions ¶
type CreateCheckRunOptions struct {
// Owner is the repository owner.
Owner string
// Repo is the repository name.
Repo string
// SHA is the commit SHA to create the check run on.
SHA string
// Name is the check run name (e.g., "atmos/plan: plat-ue2-dev/vpc").
Name string
// Status is the initial status (typically "queued" or "in_progress").
Status CheckRunState
// Title is a short title for the check run output.
Title string
// Summary is a markdown summary of the check run.
Summary string
// DetailsURL is a link back to the CI run.
DetailsURL string
// ExternalID is an optional external reference ID.
ExternalID string
}
CreateCheckRunOptions contains options for creating a new check run.
type DebugModeDetector ¶ added in v1.220.0
type DebugModeDetector interface {
// IsDebugMode reports whether the current run has debug logging enabled
// at the CI provider level. Callers use this to auto-promote their own
// log level.
IsDebugMode() bool
}
DebugModeDetector is an optional capability for providers that expose a "debug mode" signal set at the runner / step / job level (for example, GitHub Actions' ACTIONS_RUNNER_DEBUG and ACTIONS_STEP_DEBUG). Providers implement this when their platform has a documented way for users to opt into verbose diagnostic logging for a run.
type EnvExporter ¶
type EnvExporter interface {
// WriteEnv makes key=value visible to subsequent steps.
WriteEnv(key, value string) error
// AddPath prepends dir to PATH for subsequent steps.
AddPath(dir string) error
}
EnvExporter exports values to later steps of the same job (GitHub Actions: $GITHUB_ENV and $GITHUB_PATH).
type FileOutputWriter ¶
FileOutputWriter writes outputs to a file (like $GITHUB_OUTPUT).
func NewFileOutputWriter ¶
func NewFileOutputWriter(outputPath, summaryPath string) *FileOutputWriter
NewFileOutputWriter creates a new FileOutputWriter.
func (*FileOutputWriter) WriteOutput ¶
func (w *FileOutputWriter) WriteOutput(key, value string) error
WriteOutput writes a key-value pair to the output file. Format: key=value (single line) or key<<EOF\nvalue\nEOF (multiline).
func (*FileOutputWriter) WriteSummary ¶
func (w *FileOutputWriter) WriteSummary(content string) error
WriteSummary appends content to the job summary file.
type LabelReader ¶
LabelReader is an optional capability for reading live labels on a CI review (PR/MR). Context identifies the review; implementations must not discover unrelated branch reviews.
type LogGrouper ¶ added in v1.223.0
type LogGrouper interface {
// StartLogGroup opens a collapsible log group with the given title.
StartLogGroup(title string) error
// EndLogGroup closes the current log group.
EndLogGroup() error
}
LogGrouper is an optional capability for providers that can group log output in the current run (for example, GitHub Actions' ::group:: workflow command).
type LogGroupingSuppressor ¶ added in v1.231.0
type LogGroupingSuppressor interface {
// SuppressLogGrouping reports whether log grouping must be disabled for the
// current run to keep stdout free of CI workflow-command metadata.
SuppressLogGrouping() bool
}
LogGroupingSuppressor is an optional capability for providers that run in a context where log grouping must be disabled because stdout has to stay free of CI workflow-command metadata.
A log group's `::group::`/`::endgroup::` markers have to bracket the stdout content they fold, and the CI runner does not guarantee ordering between stdout and stderr, so group markers cannot simply be moved to stderr the way standalone annotations can. The only safe option in such a context is to not emit them at all. The canonical case is a deprecated GitHub Action that captures the atmos process's stdout and parses it as JSON (e.g. cloudposse/github-action-atmos-get-settings): a `::group::` line on stdout would corrupt that JSON.
When a detected provider reports true here, ci grouping is disabled for the whole run (every dimension and both grouping entry points). Annotations are unaffected — they remain on stderr regardless. See issue #3309.
type MergeQueueInfo ¶
MergeQueueInfo identifies the individual review whose queue checks are running. Earlier reviews may contribute code to the checkout, but do not supply its labels.
type NoopOutputWriter ¶
type NoopOutputWriter struct{}
NoopOutputWriter is an OutputWriter that does nothing. Used when not running in CI or when CI outputs are disabled.
func (*NoopOutputWriter) WriteOutput ¶
func (w *NoopOutputWriter) WriteOutput(_, _ string) error
WriteOutput implements OutputWriter.
func (*NoopOutputWriter) WriteSummary ¶
func (w *NoopOutputWriter) WriteSummary(_ string) error
WriteSummary implements OutputWriter.
type OutputBinder ¶
type OutputBinder interface {
// BindOutput returns a provider that writes its local renderings to w.
BindOutput(w io.Writer) Provider
}
OutputBinder is implemented by providers that render locally and can be bound to a specific writer (for example a script step's stderr) instead of the global UI channel.
type OutputHelpers ¶
type OutputHelpers struct {
Writer OutputWriter
}
OutputHelpers provides helper methods for common CI output patterns.
func NewOutputHelpers ¶
func NewOutputHelpers(writer OutputWriter) *OutputHelpers
NewOutputHelpers creates a new OutputHelpers.
func (*OutputHelpers) WriteApplyOutputs ¶
func (h *OutputHelpers) WriteApplyOutputs(opts ApplyOutputOptions) error
WriteApplyOutputs writes standard apply output variables.
func (*OutputHelpers) WritePlanOutputs ¶
func (h *OutputHelpers) WritePlanOutputs(opts PlanOutputOptions) error
WritePlanOutputs writes standard plan output variables.
type OutputWriter ¶
type OutputWriter interface {
// WriteOutput writes a key-value pair to CI outputs (e.g., $GITHUB_OUTPUT).
WriteOutput(key, value string) error
// WriteSummary writes content to the job summary (e.g., $GITHUB_STEP_SUMMARY).
WriteSummary(content string) error
}
OutputWriter writes CI outputs (environment variables, job summaries, etc.).
type PRInfo ¶
type PRInfo struct {
// Number is the PR number.
Number int
// HeadRef is the source branch.
HeadRef string
// BaseRef is the target branch.
BaseRef string
// URL is the PR URL.
URL string
// Fork reports whether the pull request head lives in a fork of the base repository.
Fork bool
}
PRInfo contains pull request metadata.
type PRStatus ¶
type PRStatus struct {
// Number is the PR number.
Number int
// Title is the PR title.
Title string
// Branch is the head branch name.
Branch string
// BaseBranch is the target branch name.
BaseBranch string
// URL is the PR URL.
URL string
// Checks are the status checks for this PR.
Checks []*CheckStatus
// AllPassed is true if all checks have passed.
AllPassed bool
}
PRStatus contains status information for a pull request.
type PlanOutputOptions ¶
type PlanOutputOptions struct {
HasChanges bool
HasAdditions bool
AdditionsCount int
ChangesCount int
HasDestructions bool
DestructionsCount int
ExitCode int
ArtifactKey string
}
PlanOutputOptions contains options for writing plan outputs.
type PostCommentOptions ¶ added in v1.218.0
type PostCommentOptions struct {
// Owner is the repository owner (GitHub) or namespace (GitLab).
Owner string
// Repo is the repository name.
Repo string
// PRNumber is the pull/merge request number.
PRNumber int
// Marker is an HTML/Markdown marker string used to find existing comments
// on repeat runs. It must appear in Body. Typical value:
// "<!-- atmos:ci:plan:<component>:<stack> -->".
Marker string
// Body is the full comment body (including Marker).
Body string
// Behavior controls create/update/upsert semantics. Empty defaults to
// CommentBehaviorUpsert.
Behavior CommentBehavior
}
PostCommentOptions contains options for posting or upserting a PR/MR comment.
type PostCommitCommentOptions ¶
type PostCommitCommentOptions struct {
// Owner is the repository owner (GitHub) or namespace (GitLab).
Owner string
// Repo is the repository name.
Repo string
// SHA is the commit the comment is attached to.
SHA string
// Marker is the HTML/Markdown marker used to find an existing comment on repeat runs.
// It must appear in Body.
Marker string
// Body is the full comment body (including Marker).
Body string
// Behavior controls create/update/upsert semantics. Empty defaults to
// CommentBehaviorUpsert.
Behavior CommentBehavior
}
PostCommitCommentOptions contains options for posting or upserting a comment on a commit.
type Provider ¶
type Provider interface {
// Name returns the provider name (e.g., "github-actions", "generic").
Name() string
// Detect returns true if this provider is active in the current environment.
Detect() bool
// Context returns CI metadata (run ID, PR info, etc.).
Context() (*Context, error)
// GetStatus returns PR/commit status for the current branch.
GetStatus(ctx context.Context, opts StatusOptions) (*Status, error)
// CreateCheckRun creates a new check run on a commit (like Atlantis status checks).
CreateCheckRun(ctx context.Context, opts *CreateCheckRunOptions) (*CheckRun, error)
// UpdateCheckRun updates an existing check run.
UpdateCheckRun(ctx context.Context, opts *UpdateCheckRunOptions) (*CheckRun, error)
// PostComment posts or upserts a PR/MR comment. Providers that do not
// support comments should return errUtils.ErrCIOperationNotSupported.
// Implementations use the marker string to find and update existing
// comments on repeat runs (upsert); callers embed the marker in Body.
PostComment(ctx context.Context, opts *PostCommentOptions) (*Comment, error)
// OutputWriter returns a writer for CI outputs ($GITHUB_OUTPUT, etc.).
OutputWriter() OutputWriter
// ResolveBase returns the base commit for affected detection.
// Returns nil if the provider cannot determine the base.
ResolveBase() (*BaseResolution, error)
}
Provider represents a CI/CD provider (GitHub Actions, GitLab CI, etc.).
type SARIFReport ¶ added in v1.222.0
type SARIFReport struct {
Body []byte
Category string
// Path is the file the report was read from, when it came from one. It is informational: providers
// that render a report locally name it so the user can tell which file was not uploaded.
Path string
// SkipReason is set by the reporter when it routes the report to local rendering because a switch
// is off (for example "ci.results.enabled is off"). Providers that render locally state it instead
// of claiming no CI provider was detected.
SkipReason string
}
SARIFReport is a provider-neutral request to publish a SARIF document to the provider's security-findings store. Body is the raw SARIF 2.1.0 bytes the scanner produced (passed through unmodified for full fidelity); Category identifies the analysis so multiple uploads for the same commit (e.g. one per component) coexist instead of overwriting each other.
type SARIFReporter ¶ added in v1.222.0
type SARIFReporter interface {
// ReportSARIF uploads the SARIF document to the provider's findings store.
// Best-effort from the caller's perspective; a returned error is logged,
// never fatal.
ReportSARIF(ctx context.Context, report SARIFReport) error
}
SARIFReporter is an optional capability for providers that ingest SARIF into a security-findings store (GitHub: Code Scanning / the Security tab — which requires GitHub Advanced Security on private repos). Providers implement this when their platform exposes a documented SARIF ingestion endpoint.
type SBOMReport ¶ added in v1.225.0
SBOMReport is a generated software bill of materials ready for publication. Content is already serialized in the declared format.
type SBOMUpload ¶ added in v1.225.0
SBOMUpload identifies a provider-side publication of an SBOM.
type SBOMUploader ¶ added in v1.225.0
type SBOMUploader interface {
UploadSBOM(ctx context.Context, report SBOMReport) (*SBOMUpload, error)
}
SBOMUploader is an optional CI capability for publishing an SBOM generated by Atmos. Providers define the destination; callers must not assume that an SBOM publication imports dependencies into a provider's dependency graph.
type Status ¶
type Status struct {
// Repository is the full repository name (e.g., "owner/repo").
Repository string
// CurrentBranch contains status for the current branch.
CurrentBranch *BranchStatus
// CreatedByUser contains PRs created by the authenticated user.
CreatedByUser []*PRStatus
// ReviewRequests contains PRs requesting review from the user.
ReviewRequests []*PRStatus
}
Status represents the CI status for display (like gh pr status).
type StatusOptions ¶
type StatusOptions struct {
// Owner is the repository owner.
Owner string
// Repo is the repository name.
Repo string
// Branch is the branch to check (optional, defaults to current branch).
Branch string
// SHA is the commit SHA to check (optional, defaults to HEAD).
SHA string
// IncludeUserPRs includes PRs created by the authenticated user.
IncludeUserPRs bool
// IncludeReviewRequests includes PRs requesting review from the user.
IncludeReviewRequests bool
}
StatusOptions contains options for fetching CI status.
type UpdateCheckRunOptions ¶
type UpdateCheckRunOptions struct {
// Owner is the repository owner.
Owner string
// Repo is the repository name.
Repo string
// SHA is the commit SHA (used for fallback creation when no prior CreateCheckRun).
SHA string
// Name is the check run name (used as correlation key).
Name string
// ID is the identifier of the check run being updated, as returned by CreateCheckRun.
// Providers that address check runs by ID use it; those that correlate by Name ignore it.
// Zero means unknown.
ID int64
// Status is the new status.
Status CheckRunState
// Conclusion is the final conclusion (required when status is "completed").
Conclusion string
// Title is the output title (distinct from the check run name).
Title string
// Summary is an updated markdown summary.
Summary string
// DetailsURL is a link back to the CI run.
DetailsURL string
// CompletedAt is when the check run completed.
CompletedAt *time.Time
}
UpdateCheckRunOptions contains options for updating an existing check run.
type ValueMasker ¶
type ValueMasker interface {
// MaskValue registers value for redaction in the provider's logs.
MaskValue(value string) error
}
ValueMasker asks the provider to redact a value in its own log output (GitHub Actions: ::add-mask::).