impl

package
v2.0.49 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const SearchField = "search"

SearchField is the synthetic filter field behind the console's run search box. A filter on it matches runs whose run name OR task name satisfies the predicate, which the flat, AND-ed common.Filter list cannot express on its own. It is not a column: the run service resolves it with SplitSearchFilters before the generic allow-list conversion (ConvertProtoFilters) sees the request. The Union cloud run service accepts the same field, so one console request works against both backends.

Variables

This section is empty.

Functions

func ConvertProtoFilters added in v2.0.12

func ConvertProtoFilters(protoFilters []*common.Filter, allowedColumns sets.Set[string]) (interfaces.Filter, error)

ConvertProtoFilters converts proto filters to our Filter interfaces. allowedColumns is checked to prevent SQL injection via user-supplied field names.

func GetSortByFieldsV2

func GetSortByFieldsV2(request *common.ListRequest, allowedSortColumns sets.Set[string]) ([]interfaces.SortParameter, error)

GetSortByFieldsV2 converts proto sort fields to our SortParameter interfaces with validation. It prefers sort_by_fields; if empty, it falls back to the deprecated sort_by field.

func NewActionRepo

func NewActionRepo(db *sqlx.DB, dbConfig database.DbConfig) (interfaces.ActionRepo, error)

NewActionRepo creates a new PostgreSQL repository

func NewDeployedByFilter

func NewDeployedByFilter(deployedBy string) interfaces.Filter

NewDeployedByFilter creates a filter for deployed_by = value

func NewEqualFilter

func NewEqualFilter(field string, value interface{}) interfaces.Filter

NewEqualFilter creates a filter for field = value

func NewHasPausedActionFilter added in v2.0.30

func NewHasPausedActionFilter() interfaces.Filter

NewHasPausedActionFilter matches root actions whose run contains at least one action in the PAUSED phase (e.g. a human-in-the-loop gate node awaiting input).

func NewIsRootActionFilter added in v2.0.14

func NewIsRootActionFilter() interfaces.Filter

NewIsRootActionFilter creates a filter for root actions (runs) only.

func NewListResourceInputFromProto

func NewListResourceInputFromProto(request *common.ListRequest, allowedColumns sets.Set[string]) (interfaces.ListResourceInput, error)

NewListResourceInputFromProto converts a proto ListRequest to ListResourceInput for querying DB

func NewNotEqualFilter added in v2.0.8

func NewNotEqualFilter(field string, value interface{}) interfaces.Filter

NewNotEqualFilter creates a filter for field != value.

func NewProjectIdFilter

func NewProjectIdFilter(projectId *common.ProjectIdentifier) interfaces.Filter

NewProjectIdFilter creates a filter for project identifier (project, domain)

func NewProjectRepo added in v2.0.8

func NewProjectRepo(db *sqlx.DB) interfaces.ProjectRepo

func NewRawFilter added in v2.0.30

func NewRawFilter(query string, args ...interface{}) interfaces.Filter

NewRawFilter creates a filter from a raw SQL predicate and its bind arguments.

func NewRunActionsFilter added in v2.0.14

func NewRunActionsFilter(runID *common.RunIdentifier) interfaces.Filter

NewRunActionsFilter creates a filter for all actions belonging to a specific run.

func NewRunTaskIdFilter added in v2.0.14

func NewRunTaskIdFilter(taskId *task.TaskIdentifier) interfaces.Filter

NewRunTaskIdFilter creates a filter matching runs by full task identifier on the actions table.

func NewRunTaskNameFilter added in v2.0.14

func NewRunTaskNameFilter(taskName *task.TaskName) interfaces.Filter

NewRunTaskNameFilter creates a filter matching runs by task name columns on the actions table.

func NewSearchFilter added in v2.0.49

func NewSearchFilter(fn common.Filter_Function, values []string) (interfaces.Filter, error)

NewSearchFilter builds the `run_name <op> ? OR task_name <op> ?` predicate for a SearchField filter. The OR is parenthesized by compositeFilter, so it composes safely with the AND-ed scope filters callers add around it.

func NewSettingsRepo added in v2.0.43

func NewSettingsRepo(db *sqlx.DB) interfaces.SettingsRepo

NewSettingsRepo returns a SettingsRepo backed by Postgres.

func NewSortParameter

func NewSortParameter(field string, order interfaces.SortOrder) interfaces.SortParameter

NewSortParameter creates a new sort parameter

func NewTaskNameFilter

func NewTaskNameFilter(taskName *task.TaskName) interfaces.Filter

NewTaskNameFilter creates a filter for task name on the tasks table (project, domain, name).

func NewTaskRepo

func NewTaskRepo(db *sqlx.DB) interfaces.TaskRepo

func NewTriggerNameFilter added in v2.0.14

func NewTriggerNameFilter(triggerName *common.TriggerName) interfaces.Filter

NewTriggerNameFilter creates a filter matching runs by trigger_name on the actions table.

func NewTriggerRepo added in v2.0.12

func NewTriggerRepo(db *sqlx.DB) interfaces.TriggerRepo

func ParseStringFilters added in v2.0.8

func ParseStringFilters(filterString string, allowedColumns sets.Set[string]) (interfaces.Filter, error)

ParseStringFilters parses a compact filter DSL like eq(state,1)+contains(name,foo).

func SplitSearchFilters added in v2.0.49

func SplitSearchFilters(filters []*common.Filter) (interfaces.Filter, []*common.Filter, error)

SplitSearchFilters partitions proto filters into a single combined SearchField predicate (nil when there is none; several are AND-ed) and the remaining plain column filters. Callers pass the remaining filters to ConvertProtoFilters, which validates fields against the column allow-list and would otherwise reject the synthetic field, and AND the returned predicate in separately.

Types

This section is empty.

Jump to

Keyboard shortcuts

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