Skip to content

[plan] Fix or remove unusable strategy schema definition for custom jobs #19402

@github-actions

Description

@github-actions

Objective

Fix the strategy field in the custom jobs JSON schema — currently defined as an empty object that blocks all valid usage — and decide whether to implement compiler support or clearly remove it.

Context

From discussion #19383 (MEDIUM-2): In pkg/parser/schemas/main_workflow_schema.json, the strategy property under .properties.jobs.additionalProperties.properties is:

"strategy": {
  "type": "object",
  "description": "Matrix strategy for the job",
  "additionalProperties": false
}

additionalProperties: false with no properties means only {} is valid. Any real matrix strategy (e.g., {matrix: {os: [ubuntu, windows]}}) would fail schema validation. The compiler also does not extract strategy at all.

Approach

Option A — Remove strategy from the schema (recommended if not implementing support):

  • Delete the strategy entry from the custom jobs schema properties
  • This is honest: the compiler doesn't support it, users won't be misled by autocomplete

Option B — Add proper schema definition + compiler extraction:

  • Define strategy with full matrix, include, exclude, fail-fast, max-parallel sub-fields
  • Extract strategy in buildCustomJobs() using YAML marshal (same pattern as container/services)
  • Add Strategy string field to Job struct and render it in jobs.go

Implement Option A (remove from schema) unless there's strong reason to implement full support. Compiler support can be added in a follow-up.

Files to Modify

  • pkg/parser/schemas/main_workflow_schema.json — remove or fix strategy under custom jobs properties
  • If Option B: pkg/workflow/compiler_jobs.go, pkg/workflow/jobs.go

Acceptance Criteria

  • Schema no longer defines strategy as an empty-object-only type
  • If removed: strategy in a custom job produces a schema validation error with a helpful message
  • If implemented: strategy round-trips correctly through compilation
  • make build run after schema changes
  • Run make agent-finish before committing

Generated by Plan Command for issue #discussion #19383 ·

  • expires on Mar 5, 2026, 10:49 AM UTC

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions