Skip to content

fix: replace inline python3 -c blocks and bare heredocs with run: | block scalars in two workflows#6

Merged
TMHSDigital merged 1 commit intomainfrom
fix/yaml-quoting-cluster
Apr 25, 2026
Merged

fix: replace inline python3 -c blocks and bare heredocs with run: | block scalars in two workflows#6
TMHSDigital merged 1 commit intomainfrom
fix/yaml-quoting-cluster

Conversation

@TMHSDigital
Copy link
Copy Markdown
Owner

Fixes #5. Same root cause class as the CFX YAML quoting cluster (TMHSDigital/CFX-Developer-Tools#5, #6, #7, fixed in CFX PR #8).

What was broken

Unity had two distinct flavors of the same YAML scanner bug, both causing the workflow files to be rejected before any job ran:

  1. 3 multiline python3 -c "..." blocks in validate-plugin-manifest (validate.yml lines 100-130). Same bug as CFX#5 — embedded for n in data: and assert ...: colons terminate the YAML implicit scalar.
  2. 7 python3 << 'PYEOF' blocks with python body at column 0 and no run: | block-scalar marker. The run value was parsed as the single-line plain scalar python3 << 'PYEOF', then the column-0 python body was treated as top-level YAML tokens and produced ScannerError: while scanning a simple key, could not find expected ':'.

What this PR does

Wraps every offending run in run: | literal block scalar with the python heredoc body indented to match. Heredoc delimiter PYEOF preserved for consistency with the original file.

  • validate.yml: 9 blocks fixed (1 huge MCP data validator + 3 plugin manifest checks + skills/rules/snippets/templates/counts validators).
  • update-unity-api.yml: 1 block fixed (the validate-updated-data step).

Net diff: 2 files changed, 266 insertions, 256 deletions (mostly indentation changes — the python content itself is untouched apart from leading whitespace).

Local verification

  • Both files parse cleanly under PyYAML safe_load with newlines preserved in every script body (10 blocks total).
  • Every python validation block runs successfully against the actual repo data:
    • 5 MCP data JSONs valid: unity_api_common.json (59 entries), deprecated_patterns.json (17), lifecycle_order.json (25), shader_properties.json (6), platform_defines.json (9).
    • plugin manifest schema valid (name kebab-case, version semver, author has name, keywords array).
    • All 18 skills pass frontmatter checks.
    • All 8 rules pass frontmatter checks.
    • All 20 snippets non-empty.
    • All 5 templates have README.md + at least one .cs file.
    • validate-counts: 18 skills, 8 rules, 20 snippets, 5 templates — all match plugin.json and README.md.
  • Representative heredocs exercised end-to-end via bash to confirm the heredoc-to-python pipe works at runtime.

So once this lands, the validate workflow should go green for the first time since it last ran. The scheduled update-unity-api.yml will actually run its validation step when next triggered (Mondays at 06:00 UTC).

Context

Surfaced during ecosystem audit on 2026-04-25 (TMHSDigital/Developer-Tools-Directory#1 close-out). Same fix pattern applied here as in CFX PR #8 fifteen minutes earlier.

…lock scalars in two workflows

Fixes #5. Same root cause class as the CFX YAML quoting cluster
(TMHSDigital/CFX-Developer-Tools#5, #6, #7, fixed in CFX PR #8).

`validate.yml` and `update-unity-api.yml` had two distinct flavors of
the same bug, both producing YAML scanner errors that prevented all
jobs from running:

1. Three `python3 -c "..."` blocks in `validate-plugin-manifest`
   (lines 100-130 of validate.yml). The unquoted multiline form is
   parsed as a plain scalar and the embedded colons (`for n in data:`,
   `assert ...:`) terminate the scalar prematurely.

2. Seven `python3 << 'PYEOF'` blocks across both files where the python
   body started at column 0 with no `run: |` block-scalar marker. The
   `run` value is parsed as the single-line plain scalar
   `python3 << 'PYEOF'` and the column-0 python body is then treated as
   top-level YAML tokens, producing
   `ScannerError: while scanning a simple key, could not find expected ':'`.

Both flavors are fixed by wrapping each `run` value in a `run: |`
literal block scalar with the python heredoc body indented to match.
Heredoc delimiter `PYEOF` is preserved across both files for
consistency with the rest of the original file.

Surfaced during ecosystem audit on 2026-04-25
(TMHSDigital/Developer-Tools-Directory#1 close-out, audit report
ecosystem-audit-2026-04-25.md).

Verified locally:
- Both workflow files parse cleanly under PyYAML safe_load with
  newlines preserved in every python script body (10 blocks total).
- Every python validation block runs successfully against the actual
  repo data:
  - 5 MCP data JSONs validated (unity_api_common 59, deprecated_patterns
    17, lifecycle_order 25, shader_properties 6, platform_defines 9).
  - plugin manifest schema (name, version, author, keywords) valid.
  - All 18 skills + 8 rules pass frontmatter checks.
  - All 20 snippets non-empty.
  - All 5 templates have README.md and C# scripts.
  - Counts confirmed: 18 skills, 8 rules, 20 snippets, 5 templates
    match plugin.json and README.md.
- Representative heredocs exercised end-to-end via bash to confirm
  the heredoc-to-python pipe works.

Closes #5.

Signed-off-by: 154358121+TMHSDigital@users.noreply.github.com
Made-with: Cursor
@github-actions github-actions Bot added the ci label Apr 25, 2026
@TMHSDigital TMHSDigital merged commit 4d8ff27 into main Apr 25, 2026
12 checks passed
@TMHSDigital TMHSDigital deleted the fix/yaml-quoting-cluster branch April 25, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

validate.yml and update-unity-api.yml chronic failures - investigate for shared root cause

1 participant