[Schema Consistency] Error Recovery vs Schema Strictness: 'on' field marked required but auto-generated #6384
Closed
Replies: 1 comment
-
|
⚓ Avast! This discussion be marked as outdated by Schema Consistency Checker. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Overview
This analysis discovered a fundamental gap between schema strictness and compiler forgiveness. The schema defines 'on' as a required field, yet the compiler auto-generates elaborate default configurations when it's missing. This pattern extends to at least 6 major fields that silently receive default values, creating a significant inconsistency between documented requirements and actual behavior.
Key Discovery: The gh-aw compiler is MORE PERMISSIVE than the schema indicates, accepting workflows with missing "required" fields and auto-generating sensible defaults. This graceful degradation makes workflows "just work" but creates validation gaps where external schema validators will reject workflows that gh-aw accepts.
Full Analysis Report
Summary
Critical Issues
1. Schema 'required' Field Not Enforced⚠️ HIGHEST PRIORITY
Issue: The schema marks
"on"as the only required field, but the compiler auto-generates defaults when it's missing.Evidence:
pkg/parser/schemas/main_workflow_schema.jsonline 3:"required": ["on"]pkg/workflow/tools.go:43-124- whendata.On == "", generates elaborate defaultReal-world validation:
.github/workflows/exist without 'on' field:code-health-file-diet.campaign.mdincident-response.campaign.mdorg-modernization.campaign.mdsecurity-compliance.campaign.mdImpact:
Files affected:
pkg/parser/schemas/main_workflow_schema.json:3- Schema definitionpkg/workflow/tools.go:43-124- Default generation logic.github/workflows/*.campaign.md- Real workflows without 'on'2. Permissions Field Auto-Generates Undocumented Default
Issue: When 'permissions' field is omitted, compiler silently generates
read-allpermissions without schema documentation.Evidence:
pkg/workflow/tools.go:133-136"default": "read-all"fieldImpact:
3. Concurrency Always Auto-Generated
Issue: Concurrency field is ALWAYS generated, never truly optional, but schema doesn't indicate this.
Evidence:
pkg/workflow/tools.go:139if data.Concurrency == ""blockImpact:
4. Timeout-Minutes Defaults Silently to 6 Hours
Issue: When timeout-minutes is omitted, compiler defaults to 360 minutes (6 hours) without schema documentation.
Evidence:
pkg/workflow/tools.go:145-147pkg/constants/constants.go:DefaultAgenticWorkflowTimeoutMinutes = 360(6 hours)5. Runs-On Defaults to Ubuntu-Latest
Issue: When runs-on is omitted, compiler defaults to
ubuntu-latestwithout schema documentation.Evidence:
pkg/workflow/tools.go:149-1516. Run-Name Auto-Generated from Workflow Name
Issue: When run-name is omitted, compiler generates it from workflow name without schema documentation.
Evidence:
pkg/workflow/tools.go:141-143Key Insights
1. Schema "Required" is Misleading
2. Runtime is a Forgiving Superset
on- elaborate schedule + eventspermissions- read-allconcurrency- intelligent based on triggerstimeout-minutes- 360 minutesruns-on- ubuntu-latestrun-name- from workflow name3. External Tooling Will Break
Recommendations
Priority 1: Critical - Fix Schema Required Fields
Option A (Recommended): Remove from required, document default
{ "required": [], "$comment": "The 'on' field is optional. If omitted, a default configuration with schedule, issues, pull_request, and push triggers will be generated.", "properties": { "on": { "description": "GitHub Actions trigger configuration. If omitted, defaults to a schedule (every 10 minutes) plus common event triggers (issues, pull_request, push to main).", "type": ["string", "object"] } } }Priority 2: High - Document All Auto-Generated Defaults
Add explicit
"default"fields to schema:{ "properties": { "permissions": { "type": ["string", "object"], "default": "read-all", "description": "GitHub Actions permissions. Defaults to 'read-all' if omitted." }, "timeout-minutes": { "type": "integer", "default": 360, "description": "Maximum workflow execution time in minutes. Defaults to 360 (6 hours)." }, "runs-on": { "type": "string", "default": "ubuntu-latest", "description": "Runner image. Defaults to 'ubuntu-latest'." } } }Priority 3: Medium - Add Documentation Table
Create table in
docs/reference/frontmatter.md:onpermissionsread-allconcurrencytimeout-minutes360runs-onubuntu-latestrun-nameAction Items
Impact Assessment
Methodology
New Strategy 023: Error Recovery vs Schema Strictness Analysis
pkg/workflow/tools.go:applyDefaults()Files Analyzed:
pkg/parser/schemas/main_workflow_schema.json- Schema requirementspkg/workflow/tools.go- Default generation logicpkg/workflow/compiler_safe_outputs.go- Field clearing patternspkg/constants/constants.go- Default values.github/workflows/*.campaign.md- Real workflowsStrategy Performance: ⭐⭐⭐⭐⭐ VERY HIGH - Completely unique angle reveals undocumented runtime behavior invisible to all static analysis strategies. Should reuse every 6-8 analyses.
Beta Was this translation helpful? Give feedback.
All reactions