All files / features / pipelines pipelinesCrudConfig.ts

100% Statements 3/3
100% Branches 0/0
100% Functions 0/0
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 3040x                                                          
import type { CrudFieldConfig, CrudFieldType } from '@/layers/interfaces'
 
export const PIPELINE_FIELD_SET: CrudFieldConfig[] = [
  { field: 'name', title: 'Name', validation: { required: true, minLength: 3, maxLength: 100 } },
  { field: 'description', title: 'Description', validation: { maxLength: 5000 } },
  { field: 'code_repo_id', title: 'Code Repository' },
  { field: 'manifest_repo_id', title: 'Manifest Repository' },
  { field: 'manifest_path', title: 'Manifest Path', validation: { required: true, minLength: 1 } },
  {
    field: 'output_branch',
    title: 'Output Branch',
    description: 'Branch suffix for pipeline output. Full branch: agent-platform/{name}/{run_id}/{output_branch}. Pipeline never writes to the default branch directly.',
    tooltip: 'Use only letters, numbers, hyphens, underscores, dots, and forward slashes.',
    validation: { required: true, minLength: 1, pattern: '^[a-zA-Z0-9._/-]+$', patternMessage: 'Use only letters, numbers, hyphens, underscores, dots, and slashes' },
  },
  { field: 'enabled', title: 'Enabled' },
]
 
export const PIPELINE_FIELD_TYPES: Record<string, CrudFieldType> = {
  description: 'textarea',
  code_repo_id: 'entity-select',
  manifest_repo_id: 'entity-select',
  enabled: 'checkbox',
}
 
export const PIPELINE_ENTITY_SELECT_SOURCES = {
  code_repo_id: { entityPath: 'repositories' as const, nameField: 'name' as const, descriptionField: 'description' as const },
  manifest_repo_id: { entityPath: 'repositories' as const, nameField: 'name' as const, descriptionField: 'description' as const },
}