Skip to content

Fix schema diff workflow key extraction - #54647

Merged
pelikhan merged 3 commits into
mainfrom
copilot/deep-report-fix-schema-diff-key-extractor
Aug 21, 2026
Merged

Fix schema diff workflow key extraction#54647
pelikhan merged 3 commits into
mainfrom
copilot/deep-report-fix-schema-diff-key-extractor

Conversation

Copilot AI commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

The schema consistency checker was inflating used_in_workflows and in_used_not_schema with nested YAML keys and markdown body content. This made real schema gaps harder to spot in recurring reports.

  • Frontmatter key extraction
    • Added a dedicated extractor that reads only the YAML frontmatter document.
    • Emits only unindented top-level keys.
    • Ignores nested mappings, block scalar content, and markdown body text.
USED_FIELDS=$(bash scripts/extract-workflow-frontmatter-keys.sh .github/workflows/*.md 2>/dev/null || echo "")
  • Workflow integration

    • Updated the schema consistency checker precompute step to use the extractor.
    • Recompiled the generated workflow lock file.
  • Regression coverage

    • Added a focused shell test covering nested frontmatter keys and body key-like content.
    • Wired the test into existing script test coverage.

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 31.4 AIC · ⌖ 8.22 AIC · ⊞ 9.4K ·
Comment /souschef to run again

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix schema-diff workflow key extractor false positives Fix schema diff workflow key extraction Aug 21, 2026
Copilot AI requested a review from pelikhan August 21, 2026 23:02
@pelikhan
pelikhan marked this pull request as ready for review August 21, 2026 23:04
Copilot AI balanced review requested due to automatic review settings August 21, 2026 23:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves schema consistency reporting by extracting only top-level workflow frontmatter keys.

Changes:

  • Adds a dedicated AWK-based extractor and regression test.
  • Integrates extraction into the schema checker.
  • Regenerates the compiled workflow.
Show a summary per file
File Description
scripts/extract-workflow-frontmatter-keys.sh Extracts top-level frontmatter keys.
scripts/extract-workflow-frontmatter-keys_test.sh Tests nested and body-content filtering.
Makefile Adds the new script test.
.github/workflows/schema-consistency-checker.md Uses the dedicated extractor.
.github/workflows/schema-consistency-checker.lock.yml Regenerates the compiled workflow.

Review details

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Suppressed comments (1)

scripts/extract-workflow-frontmatter-keys.sh:23

  • This pattern skips quoted top-level YAML keys. The repository already contains a valid example (.github/workflows/mattpocock-skills-reviewer.md:22 uses "on":), so the dedicated extractor does not actually emit every unindented frontmatter key and can under-report a field when its occurrences are quoted. Accept and normalize quoted forms as well as bare keys.
  in_frontmatter && $0 ~ /^[a-z][a-z0-9_-]*:/ {
    key = $0
    sub(/:.*/, "", key)
    print key
  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment on lines +12 to +16
FNR == 1 && $0 ~ /^---[[:space:]]*$/ {
in_frontmatter = 1
next
}
in_frontmatter && $0 ~ /^---[[:space:]]*$/ {
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot Please address the current forward-progress items on this branch, then run the pr-finisher skill and leave a concise maintainer handoff.

Unresolved review follow-up:

Also refresh the branch if GitHub offers it.

Run: https://github.com/github/gh-aw/actions/runs/32537236290

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 31.4 AIC · ⌖ 8.22 AIC · ⊞ 9.4K ·
Comment /souschef to run again

@pelikhan
pelikhan merged commit 712e356 into main Aug 21, 2026
3 checks passed
@pelikhan
pelikhan deleted the copilot/deep-report-fix-schema-diff-key-extractor branch August 21, 2026 23:42
Copilot stopped work on behalf of gh-aw-bot due to an error August 21, 2026 23:42
Copilot AI requested a review from gh-aw-bot August 21, 2026 23:42
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.87.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[deep-report] Fix schema-diff workflow key extractor false positives (nested keys/body content inflate gap report)

4 participants