reporter

package
v0.0.0-...-6b0088a Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package reporter provides interface implementation for reporting provenance information as useful library.

Index

Constants

This section is empty.

Variables

View Source
var ErrServiceUnavailable = errors.New("local provenance service unavailable")

Functions

This section is empty.

Types

type Report

type Report struct {
	RClient snooperpb.SelfReportClient
}

Report implements all provenance interfaces.

This can be used as a caching opportunity by users for storing client for longer use. TODO(crbug/1269830): Implement a custom retry logic for transient errors. Custom retry is needed because grpc status `Unavailable` is tagged as transient. In this application, `ErrServiceUnavailable` is a permanent but acceptable error code.

func (*Report) ReportCipdAdmission

func (r *Report) ReportCipdAdmission(ctx context.Context, pkgName, iid string) (bool, error)

ReportCipdAdmission reports a local cipd admission to provenance.

It returns a success status and annotated error. Status is to indicate user whether to block further execution. If local provenance service is unavailable, it will return an ok status and annotated error. This is to indicate, the user should continue normal execution. All other errors are annotated to indicate permanent failures.

func (*Report) ReportCipdDigest

func (r *Report) ReportCipdDigest(ctx context.Context, digest, pkgName, iid string) (bool, error)

ReportCipdDigest reports digest of built cipd package to provenance.

It returns a success status and annotated error. Status is to indicate user whether to block further execution. If local provenance service is unavailable, it will return an ok status and annotated error. This is to indicate, the user should continue normal execution. All other errors are annotated to indicate permanent failures.

func (*Report) ReportGcsDigest

func (r *Report) ReportGcsDigest(ctx context.Context, digest, gcsURI string) (bool, error)

ReportGcsDigest reports digest of a built gcs app to provenance.

It returns a success status and annotated error. Status is to indicate user whether to block further execution. If local provenance service is unavailable, it will return an ok status and annotated error. This is to indicate, the user should continue normal execution. All other errors are annotated to indicate permanent failures.

func (*Report) ReportGcsDownload

func (r *Report) ReportGcsDownload(ctx context.Context, uri, digest string) (bool, error)

ReportGcsDownload reports a local gcs download to provenance.

It returns a success status and annotated error. Status is to indicate user whether to block further execution. If local provenance service is unavailable, it will return an ok status and annotated error. This is to indicate, the user should continue normal execution. All other errors are annotated to indicate permanent failures.

func (*Report) ReportGitCheckout

func (r *Report) ReportGitCheckout(ctx context.Context, repo, commit, ref string) (bool, error)

ReportGitCheckout reports a local git checkout/fetch to provenance.

It returns a success status and annotated error. Status is to indicate user whether to block further execution. If local provenance service is unavailable, it will return an ok status and annotated error. This is to indicate, the user should continue normal execution. All other errors are annotated to indicate permanent failures.

func (*Report) ReportPID

func (r *Report) ReportPID(ctx context.Context, pid int64) (bool, error)

ReportPID reports process id to provenance local server for tracking.

It returns a success status and annotated error. Status is to indicate user whether to block further execution.

If local provenance service is unavailable, it will return an ok status and annotated error. This is to indicate that the user should continue normal execution. All other errors are annotated to indicate permanent failures.

func (*Report) ReportSbomDigest

func (r *Report) ReportSbomDigest(ctx context.Context, digest, gcsURI string, subjectDigests []string) (bool, error)

ReportSbomDigest reports digest of a built gcs SBOM to provenance.

It returns a success status and annotated error. Status is to indicate user whether to block further execution. If local provenance service is unavailable, it will return an ok status and annotated error. This is to indicate, the user should continue normal execution. All other errors are annotated to indicate permanent failures.

func (*Report) ReportStage

func (r *Report) ReportStage(ctx context.Context, stage snooperpb.TaskStage, recipe string, pid int64) (bool, error)

ReportStage reports task stage via provenance local server.

It returns a success status and annotated error. Status is to indicate user whether to block further execution. If local provenance service is unavailable, it will return an ok status and annotated error. This is to indicate, the user should continue normal execution. All other errors are annotated to indicate permanent failures. TODO: Use go struct when a new parameter is added.

Jump to

Keyboard shortcuts

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