[Schema Consistency] Schema Consistency Check — 2026-03-31 #23638
Closed
Replies: 1 comment
-
|
This discussion has been marked as outdated by Schema Consistency Checker. A newer discussion is available at Discussion #23823. |
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.
-
Schema consistency analysis across four layers:
main_workflow_schema.json, parser/compiler Go structs (pkg/workflow/*.go), documentation (docs/src/content/docs/reference/), and actual workflows (.github/workflows/*.md).Strategy used: Cross-Layer Field Diff (proven, day-of-year 90 % 10 = 0 → reuse strategy)
Run: §23780462593
Summary
Critical Issues
1.
versionandincludefields inFrontmatterConfigbut absent from schemaFrontmatterConfig(pkg/workflow/frontmatter_types.go:134,179) defines:The top-level schema (
pkg/parser/schemas/main_workflow_schema.json) sets"additionalProperties": falseand does not includeversionorincludeas properties. With schema validation enabled (skipValidation: false), any workflow using these fields would fail validation. Validation is currently skipped by default (skipValidation: trueincompiler_types.go:159), masking the issue.Impact: High — if validation is ever enabled globally, existing workflows using
version:orinclude:at the top level will break.Recommendation: Either add
versionandincludeto the schema, or remove them fromFrontmatterConfig.2.
copilot-requestspermission: implemented in parser but missing from schemapermissions.go:156defines:and
permissions.go:47handles it inconvertStringToPermissionScope. However,copilot-requestsis not listed under$defs.github_actions_permissions.propertiesin the schema.Impact: Medium — schema validation would reject
permissions: { copilot-requests: write }even though the parser handles it correctly. Also, IDE/editor autocompletion powered by the schema would not suggest this permission.Recommendation: Add
copilot-requeststo$defs.github_actions_permissions.propertiesin the schema.3.
GitHubActionsPermissionsConfigstruct missing newer GITHUB_TOKEN scopesSchema
$defs.github_actions_permissions.propertiesincludesattestations,metadata,models, andall. These are not inGitHubActionsPermissionsConfig(frontmatter_types.go:40–54):PermissionScopeconstantsattestationsmetadatamodelsallparsePermissionsConfigSince permissions are processed via
NewPermissionsParser(data.Permissions)using the raw YAML string, there is no functional breakage. However,parsePermissionsConfig(frontmatter_types.go:342) lackscasebranches for these scopes, meaningPermissionsTypedwill silently drop them on round-trip viaToMap().Recommendation: Add these scopes to
GitHubActionsPermissionsConfigandparsePermissionsConfig.4.
create-code-scanning-alertnaming: singular in schema/parser, plural in struct yaml tagSchema key:
create-code-scanning-alert(singular)Parser reads:
outputMap["create-code-scanning-alert"](create_code_scanning_alert.go:38)Struct yaml tag:
yaml:"create-code-scanning-alerts,omitempty"(plural,compiler_types.go:463)The struct uses
create-code-scanning-alerts(plural) for its yaml tag, while the schema and parser usecreate-code-scanning-alert(singular). Since parsing is done via direct map access (not yaml unmarshaling), there is no runtime breakage. However, ifSafeOutputsConfigwere ever serialized to YAML and parsed back, the key name would be wrong.Recommendation: Align the struct yaml tag to
yaml:"create-code-scanning-alert,omitempty"(singular).Documentation Gaps
5.
activation-commentsplacement: top-level in schema vs nested in structThe schema places
activation-commentsatsafe-outputs.activation-comments(top-level). The struct stores it asSafeOutputMessagesConfig.ActivationComments(nested undermessages). Crucially, the schema'smessagesblock does not includeactivation-commentsin its properties (additionalProperties: false).This creates a confusing situation:
safe-outputs.activation-comments: false✅ (works in parser, validated by schema)safe-outputs.messages.activation-comments: false✅ (works via struct yaml tag) but ❌ (schema rejects it —messages.additionalProperties: false)Recommendation: Either add
activation-commentsto the schema'smessagesproperties, or clarify in docs that it must only be used at thesafe-outputstop level (not undermessages).6.
FirewallConfigyaml tags use snake_case; schema and docs use kebab-caseFirewallConfig(firewall.go:19–21) defines:Schema (
main_workflow_schema.json) uses:log-level,ssl-bump,allow-urls(kebab-case)Docs (
docs/src/content/docs/reference/network.md:219,234,235) use:log-level,ssl-bump,allow-urlsParsing is done manually in
frontmatter_extraction_security.go:145–163using the kebab-case keys, so there is no functional issue. However, the struct yaml tags are misleading — they do not match what the YAML parser would expect if the struct were ever used withyaml.Unmarshaldirectly.Recommendation: Update struct yaml tags to use kebab-case to match schema/docs convention:
Convention Inconsistencies
7.
dispatch_repositoryuses underscore while all other safe-outputs keys use kebab-caseIn
SafeOutputsConfig(compiler_types.go:485):Schema:
dispatch_repository(underscore)All other safe-outputs keys: kebab-case
The parser explicitly accepts both
dispatch_repositoryanddispatch-repository(dispatch_repository.go:38–39). This was likely intentional (matching the GitHub Actions event typerepository_dispatch), but creates a convention inconsistency.Recommendation: Document this explicitly in the schema description and docs. Consider whether to make
dispatch-repositorythe primary key anddispatch_repositoryan alias, or vice versa.8.
runtimesConfigToMapdropsaction-repoandaction-versionon round-tripRuntimeConfig(frontmatter_types.go:14–19) hasActionRepoandActionVersionfields.parseRuntimesConfig(frontmatter_types.go:299–308) correctly reads them. However,runtimesConfigToMap(frontmatter_types.go:676–761) only serializesversionandif, silently droppingaction-repoandaction-version.Since the compiler uses the raw
Runtimes map[string]any(notRuntimesTyped) for actual YAML generation, there is no functional breakage. But the typed struct has a lossy round-trip.Recommendation: Add
action-repoandaction-versionserialization toruntimesConfigToMap.Schema Improvements Needed
9.
botstop-level schema property vs compiler readingon.botsThe schema defines
botsas both:properties.bots) — describes a bot allowlistontrigger configurationThe compiler (
role_checks.go:143–159) exclusively readson.bots. A top-levelbots:field would pass schema validation but be silently ignored by the compiler.Recommendation: Remove the top-level
botsschema property, or make the compiler also checkfrontmatter["bots"].10.
envfield type mismatch: schema allowsstring | object, struct only handles objectSchema (
properties.env.oneOf): allows eitherobject(map of string→string) or plainstringFrontmatterConfig.Env(frontmatter_types.go:162):map[string]string(object only)If a user writes
env: "some-value", schema validation would pass, but JSON unmarshaling intoFrontmatterConfigwould fail silently (the field would be empty).Recommendation: Either remove the
stringvariant from theenvschemaoneOf, or update the struct to handle the string case.Schema Fields Not Used in Any Current Workflow
The following schema fields exist and are handled by the parser, but are not used in any
.github/workflows/*.mdfile in this repository. They may need documentation or example workflows:bots,check-for-updates,command,container,dependencies,disable-model-invocation,environment,github-app,import-schema,infer,labels,mcp-scripts,mcp-servers,metadata,observability,post-steps,private,resources,run-name,runs-on-slim,secret-masking,secrets,servicesDeprecated/Removed Schema Fields
tools.grep: Markeddeprecated: truein schema — now a no-op (grep is part of default bash tools). Not handled as a struct field; falls intoToolsConfig.Custommap.tools.serena: Markeddeprecated: true, x-removed: true— built-in support removed. Users should importshared/mcp/serena.md.safe-outputs.create-agent-task: Deprecated alias forcreate-agent-session. Parser emits a warning and redirects tocreate-agent-session.network.firewall: Markeddeprecated: true— firewall is now always enabled. Usesandbox.agentinstead.Recommendations (Prioritized)
versionandincludemissing from schema first, then enable validation.copilot-requeststo schema — One-line addition togithub_actions_permissions.properties.create-code-scanning-alertsyaml tag — Change to singular to match schema.GitHubActionsPermissionsConfig— Addattestations,metadata,modelsfields.FirewallConfigyaml tags — Switch to kebab-case.activation-commentsplacement — Update schema or docs to remove ambiguity.runtimesConfigToMap— Includeaction-repoandaction-version.botsfrom schema (or handle it in compiler).Strategy Performance
References:
Beta Was this translation helpful? Give feedback.
All reactions