api

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultParallelization = 10

Variables

View Source
var BuiltinActions = make(map[string]ActionStep)

Functions

func AutoProtectValues

func AutoProtectValues(key string, original string, decoded string)

func DecodeEnvValue

func DecodeEnvValue(value string) string

func GetCIDEnvironment

func GetCIDEnvironment(configEnv map[string]string, projectDirectory string) map[string]string

GetCIDEnvironment returns the normalized ci variables

func RegisterBuiltinAction

func RegisterBuiltinAction(action ActionStep)

RegisterBuiltinAction registers a builtin action

Types

type ActionDetails

type ActionDetails struct {
	Name             string
	Version          string
	UsedTools        []string
	ToolDependencies map[string]string
}

ActionDetails holds details about the action

type ActionExecutionContext

type ActionExecutionContext struct {
	// Paths holds the path configuration
	Paths config.PathConfig

	// ProjectDir holds the project directory
	ProjectDir string

	// WorkDir holds the current working directory
	WorkDir string

	// Config holds the json configuration passed to this action
	Config string

	// Args holds the arguments passed to the action
	Args []string

	// Env contains the environment that is visible to the action
	Env map[string]string

	// Parallelization defines how many tasks can be run in parallel inside an action
	Parallelization int

	// CurrentUser holds information about the user running this process
	CurrentUser user.User

	// Modules contains the project modules
	Modules []*analyzerapi.ProjectModule

	// CurrentModule contains the module that is currently being build
	CurrentModule *analyzerapi.ProjectModule
}

ActionExecutionContext holds runtime information for the actions

func GetActionContext

func GetActionContext(modules []*analyzerapi.ProjectModule, projectDir string, env map[string]string, access *catalog.ActionAccess) ActionExecutionContext

GetActionContext gets the action context, this operation is expensive and should only be called once per execution

type ActionStep

type ActionStep interface {
	// GetDetails retrieves information about the action
	GetDetails(ctx *ActionExecutionContext) ActionDetails

	// Execute runs the action
	Execute(ctx *ActionExecutionContext, localState *state.ActionStateContext) error
}

ActionStep is the interface that needs to be implemented by all builtin actions

type CoverageReport

type CoverageReport struct {
	Language string
	Percent  float64
}

CoverageReport contains a generic coverage report

type MissingRequirement

type MissingRequirement struct {
	Message string
}

MissingRequirement contains a record about a missing requirement for a action

Jump to

Keyboard shortcuts

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