Skip to content

docs: expand dispatch-repository nested fields in frontmatter-full.md#44456

Merged
pelikhan merged 3 commits into
mainfrom
copilot/deep-reportexpand-dispatch-repository-fields
Jul 9, 2026
Merged

docs: expand dispatch-repository nested fields in frontmatter-full.md#44456
pelikhan merged 3 commits into
mainfrom
copilot/deep-reportexpand-dispatch-repository-fields

Conversation

Copilot AI commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

dispatch-repository in the generated reference showed only {}, hiding all required nested keys (workflow, event_type, repository/allowed_repositories, inputs, max) from users who couldn't author a valid config without reading schema source.

Changes

  • pkg/parser/schemas/main_workflow_schema.json: Added x-example-key: "trigger-ci" annotation to dispatch-repository and x-example-key: "repo-name" to its inputs sub-property. Updated description to call out the snake_case naming (event_type, allowed_repositories) vs. kebab-case used by adjacent safe-output fields.

  • scripts/generate-schema-docs.js: Generator now handles objects annotated with x-example-key that use additionalProperties (dynamic-key maps) — renders an expanded example entry instead of bare {}. The annotation is opt-in so complex schemas like jobs are unaffected.

  • scripts/generate-schema-docs.test.js: Added 5 assertions covering the expanded output (no bare {}, correct placeholder key, required fields present).

  • docs/src/content/docs/reference/frontmatter-full.md: Regenerated.

Before / After

# Before
dispatch-repository:
  {}

# After
dispatch-repository:
  # Configuration for a single repository dispatch tool
  trigger-ci:
    description: "..."        # optional
    workflow: "example-value" # required
    event_type: "example-value" # required
    repository: "example-value" # optional (or use allowed_repositories)
    allowed_repositories: []
    inputs:
      repo-name:
        type: "string"
        ...
    max: 1
    github-token: "${{ secrets.GITHUB_TOKEN }}"
    staged: true

Copilot AI and others added 2 commits July 9, 2026 03:33
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Add x-example-key annotation to dispatch-repository schema so the
  generator expands the per-tool object shape (workflow, event_type,
  repository, allowed_repositories, inputs, max) instead of showing {}
- Update schema description to note snake_case naming convention
  (event_type, allowed_repositories) vs kebab-case on other safe-output fields
- Update generate-schema-docs.js to handle additionalProperties objects
  annotated with x-example-key, expanding them with an example entry
- Add test coverage for dispatch-repository expansion in generate-schema-docs.test.js
- Regenerate frontmatter-full.md with the expanded dispatch-repository section

Closes #44337

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Expand dispatch-repository nested fields in frontmatter-full.md docs docs: expand dispatch-repository nested fields in frontmatter-full.md Jul 9, 2026
Copilot AI requested a review from pelikhan July 9, 2026 03:42
@pelikhan
pelikhan marked this pull request as ready for review July 9, 2026 04:07
Copilot AI review requested due to automatic review settings July 9, 2026 04:07
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR #44456 does not have the 'implementation' label and has only 3 new lines of code in business logic directories (threshold: 100).

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

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 the generated frontmatter reference documentation by expanding the dispatch-repository example so users can see the required nested fields (instead of a bare {}), using an opt-in schema annotation and generator support for dynamic-key (additionalProperties) objects.

Changes:

  • Annotated dispatch-repository (and its nested inputs) with x-example-key so the doc generator can render a representative map entry.
  • Updated the schema-doc generator to expand additionalProperties objects when x-example-key is present (instead of emitting {}).
  • Added test assertions for the expanded output and regenerated frontmatter-full.md.
Show a summary per file
File Description
pkg/parser/schemas/main_workflow_schema.json Adds x-example-key annotations and clarifies snake_case nested key naming for dispatch-repository.
scripts/generate-schema-docs.js Expands annotated dynamic-key objects (via additionalProperties) to show a representative nested schema entry.
scripts/generate-schema-docs.test.js Adds assertions to prevent regressions where dispatch-repository renders as {}.
docs/src/content/docs/reference/frontmatter-full.md Regenerated reference output including expanded dispatch-repository examples.
.github/workflows/daily-elixir-credo-snippet-audit.lock.yml Includes workflow lock changes unrelated to the docs-focused PR scope.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 4/5 changed files
  • Comments generated: 3
  • Review effort level: Low

Comment on lines +140 to +150
// Test 10: Verify that dispatch-repository nested fields are expanded (not just '{}')
allPassed &= assertNotContains(output, "dispatch-repository:\n {}", "dispatch-repository should NOT render as bare '{}'");

allPassed &= assertContains(output, "trigger-ci:", "dispatch-repository should show annotated example key 'trigger-ci'");

allPassed &= assertContains(output, "event_type:", "dispatch-repository example should include required 'event_type' field");

allPassed &= assertContains(output, "workflow:", "dispatch-repository example should include required 'workflow' field");

allPassed &= assertContains(output, "allowed_repositories:", "dispatch-repository example should include 'allowed_repositories' field");

Comment on lines +8333 to +8337
# List of allowed target repositories (owner/repo). Supports glob patterns like
# 'org/*'.
# (optional)
allowed_repositories: []
# Array of strings
Comment on lines 1 to 3
# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"6cf2dc5cf3f6169a8fc2ae8262681f558655296a60ef8bc1a96550c0f7b3520f","body_hash":"2f1463b9044ab5b109d77da64d2959d9e4394f83c383cfd35a015e481cef9acb","strict":true,"agent_id":"claude","engine_versions":{"claude":"2.1.201"}}
# gh-aw-manifest: {"version":1,"secrets":["ANTHROPIC_API_KEY","COPILOT_GITHUB_TOKEN","GH_AW_CI_TRIGGER_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN"],"actions":[{"repo":"actions/cache/restore","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/cache/save","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/checkout","sha":"9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0","version":"v7.0.0"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e","version":"v6.4.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"erlef/setup-beam","sha":"fc68ffb90438ef2936bbb3251622353b3dcb2f93","version":"v1.24.0"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.27.27","digest":"sha256:bb5a0150dcff1cddf9b8045bb411b7759806bace0abcb132fb22158073e155d9","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.27.27@sha256:bb5a0150dcff1cddf9b8045bb411b7759806bace0abcb132fb22158073e155d9"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.27","digest":"sha256:01e58c4383fa9952abe76e0a134a27c970f81f744d6b7861fc9e08b7964d94c3","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.27@sha256:01e58c4383fa9952abe76e0a134a27c970f81f744d6b7861fc9e08b7964d94c3"},{"image":"ghcr.io/github/gh-aw-firewall/cli-proxy:0.27.27","digest":"sha256:70df326caf73bf5911340dca4620b529a483dd8f42142b0a41d7b9761ab4ab7a","pinned_image":"ghcr.io/github/gh-aw-firewall/cli-proxy:0.27.27@sha256:70df326caf73bf5911340dca4620b529a483dd8f42142b0a41d7b9761ab4ab7a"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.27.27","digest":"sha256:92d820df47b2eff75d93a5bec4dc183a3ec55ed7ddb4f25cb0fdda5c3e995409","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.27.27@sha256:92d820df47b2eff75d93a5bec4dc183a3ec55ed7ddb4f25cb0fdda5c3e995409"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.4.0","digest":"sha256:9dbdf42842c224a95016df1d2a85a2901e04204c242079343b302a307d2b8031","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.4.0@sha256:9dbdf42842c224a95016df1d2a85a2901e04204c242079343b302a307d2b8031"},{"image":"ghcr.io/github/gh-aw-node","digest":"sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b","pinned_image":"ghcr.io/github/gh-aw-node@sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b"},{"image":"ghcr.io/github/github-mcp-server:v1.5.0","digest":"sha256:e25564dccc9110a70a77b9df560cbde11aa392fcb5f08b9abe5c4ebc6d146ea4","pinned_image":"ghcr.io/github/github-mcp-server:v1.5.0@sha256:e25564dccc9110a70a77b9df560cbde11aa392fcb5f08b9abe5c4ebc6d146ea4"}]}
# gh-aw-manifest: {"version":1,"secrets":["ANTHROPIC_API_KEY","COPILOT_GITHUB_TOKEN","GH_AW_CI_TRIGGER_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN"],"actions":[{"repo":"actions/cache/restore","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/cache/save","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/checkout","sha":"9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0","version":"v7.0.0"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e","version":"v6.4.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"erlef/setup-beam","sha":"fc68ffb90438ef2936bbb3251622353b3dcb2f93","version":"v1.24.0"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.27.27","digest":"sha256:bb5a0150dcff1cddf9b8045bb411b7759806bace0abcb132fb22158073e155d9","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.27.27@sha256:bb5a0150dcff1cddf9b8045bb411b7759806bace0abcb132fb22158073e155d9"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.27","digest":"sha256:01e58c4383fa9952abe76e0a134a27c970f81f744d6b7861fc9e08b7964d94c3","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.27@sha256:01e58c4383fa9952abe76e0a134a27c970f81f744d6b7861fc9e08b7964d94c3"},{"image":"ghcr.io/github/gh-aw-firewall/cli-proxy:0.27.27","digest":"sha256:70df326caf73bf5911340dca4620b529a483dd8f42142b0a41d7b9761ab4ab7a","pinned_image":"ghcr.io/github/gh-aw-firewall/cli-proxy:0.27.27@sha256:70df326caf73bf5911340dca4620b529a483dd8f42142b0a41d7b9761ab4ab7a"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.27.27","digest":"sha256:92d820df47b2eff75d93a5bec4dc183a3ec55ed7ddb4f25cb0fdda5c3e995409","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.27.27@sha256:92d820df47b2eff75d93a5bec4dc183a3ec55ed7ddb4f25cb0fdda5c3e995409"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.4.1","digest":"sha256:ad2a979c2cd8b50098e84938ca9c9c1580eb8e91526f101a90adfba7859b2c32","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.4.1@sha256:ad2a979c2cd8b50098e84938ca9c9c1580eb8e91526f101a90adfba7859b2c32"},{"image":"ghcr.io/github/gh-aw-node","digest":"sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b","pinned_image":"ghcr.io/github/gh-aw-node@sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b"},{"image":"ghcr.io/github/github-mcp-server:v1.5.0","digest":"sha256:e25564dccc9110a70a77b9df560cbde11aa392fcb5f08b9abe5c4ebc6d146ea4","pinned_image":"ghcr.io/github/github-mcp-server:v1.5.0@sha256:e25564dccc9110a70a77b9df560cbde11aa392fcb5f08b9abe5c4ebc6d146ea4"}]}
# This file was automatically generated by gh-aw. DO NOT EDIT. To debug this workflow, load the skill at https://github.com/github/gh-aw/blob/main/debug.md
@github-actions github-actions Bot mentioned this pull request Jul 9, 2026
@pelikhan
pelikhan merged commit 12c510e into main Jul 9, 2026
83 of 102 checks passed
@pelikhan
pelikhan deleted the copilot/deep-reportexpand-dispatch-repository-fields branch July 9, 2026 04:19
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

🧪 Test Quality Sentinel Report

Test Quality Score: 92/100 — Excellent

Analyzed 1 test(s): 1 design, 0 implementation, 0 violation(s).

📊 Metrics (1 test)
Metric Value
Analyzed 1 (Go: 0, JS: 1)
✅ Design 1 (100%)
⚠️ Implementation 0 (0%)
Edge/error coverage 1 (100%)
Duplicate clusters 0
Inflation NO (0.39:1)
🚨 Violations 0
Test File Classification Issues
Test 10: dispatch-repository nested fields scripts/generate-schema-docs.test.js:140 ✅ Design None

Verdict

Passed. 0% implementation tests (threshold: 30%).

Quality Summary:

  • Strong design focus: The new test validates user-facing documentation output (dispatch-repository nested fields expansion)
  • Solid coverage: 5 assertions including 1 negative test (should NOT render as bare "{}") and 4 positive assertions for required fields
  • Healthy test ratio: 11 test lines vs 28 production lines (0.39:1, well below 2:1 threshold)
  • No violations: Proper assertion practices, no mocking violations

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

🧪 Test quality analysis by Test Quality Sentinel · 18.4 AIC · ⌖ 11.6 AIC · ⊞ 6.8K ·
Comment /review to run again

@github-actions github-actions Bot 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.

✅ Test Quality Sentinel: 92/100 Excellent. 0% implementation tests (threshold: 30%). The new test validates user-facing documentation output with proper edge-case coverage.

@github-actions github-actions Bot 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.

Skills-Based Review 🧠

Applied /grill-with-docs and /tdd — commenting on maintainability and test-coverage gaps. The core change (expanding dispatch-repository from {} to a fully-documented example) is correct and a clear UX win for workflow authors.

📋 Key Themes & Highlights

Issues Found

  • Duplicate logic (/grill-with-docs): The x-example-key expansion block is copy-pasted verbatim into both generateVariants and generateProperty. A shared helper would eliminate the duplication and make the feature easier to extend later.
  • Weak test scoping (/tdd): The new assertions for event_type: and workflow: test for string presence anywhere in the full ~6 000-line output; both tokens already appear elsewhere in the doc, so those assertions would pass even if the dispatch-repository block regressed.
  • Missing nested-key test (/tdd): inputs.x-example-key: "repo-name" was added to the schema but is not covered by any of the 5 new assertions.

Positive Highlights

  • x-example-key is opt-in via a schema annotation — zero impact on unrelated maps like jobs
  • ✅ The before/after in the PR description makes the improvement immediately legible
  • assertNotContains(output, "dispatch-repository:\n {}", ...) is a solid guard against the original regression
  • ✅ The schema description update calling out snake_case vs kebab-case is a nice usability note

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · 68.3 AIC · ⌖ 7.35 AIC · ⊞ 6.6K
Comment /matt to run again

}
} else {
lines.push(`${indentStr} {}`);
}

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.

[/grill-with-docs] The x-example-key expansion block added in generateProperty (here) is an exact copy of the block added in generateVariants (line 240). Future fixes must be applied twice.

💡 Suggested refactor: extract a shared helper
function expandExampleKey(prop, indent) {
  const indentStr = " ".repeat(indent);
  const lines = [];
  const exampleKey = prop["x-example-key"];
  const addlProp = resolvePropertyRef(prop.additionalProperties);
  if (addlProp.description) {
    lines.push(formatComment(addlProp.description, indent + 2));
  }
  lines.push(`${indentStr}  ${exampleKey}:`);
  if (addlProp.properties) {
    lines.push(generateProperties(addlProp.properties, addlProp.required || [], indent + 4));
  } else {
    lines.push(`${indentStr}    {}`);
  }
  return lines;
}

Then both sites become a one-liner: lines.push(...expandExampleKey(prop, indent)). This also makes the feature easy to unit-test in isolation.

@copilot please address this.


allPassed &= assertContains(output, "trigger-ci:", "dispatch-repository should show annotated example key 'trigger-ci'");

allPassed &= assertContains(output, "event_type:", "dispatch-repository example should include required 'event_type' field");

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.

[/tdd] assertContains(output, "event_type:", ...) passes as long as event_type: appears anywhere in the ~6 000-line output, not just inside the dispatch-repository block. The same is true for workflow: (line 147). Both fields appear in many other sections, so these assertions would pass even if the dispatch-repository expansion was broken.

💡 Tighter assertion approach

Capture only the dispatch-repository slice of the output before asserting on its content:

const dispatchBlock = output.slice(
  output.indexOf("\ndispatch-repository:"),
  output.indexOf("\ndispatch_repository:")
);
allPassed &= assertContains(dispatchBlock, "event_type:", "dispatch-repository example should include 'event_type' field");
allPassed &= assertContains(dispatchBlock, "workflow:",   "dispatch-repository example should include 'workflow' field");

Or at minimum add a separate assertNotContains that would fail if the fields vanish from context.

@copilot please address this.


allPassed &= assertContains(output, "workflow:", "dispatch-repository example should include required 'workflow' field");

allPassed &= assertContains(output, "allowed_repositories:", "dispatch-repository example should include 'allowed_repositories' field");

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.

[/tdd] There is no test for the nested x-example-key expansion: inputs.x-example-key: "repo-name" (added in the schema). The tests confirm allowed_repositories: is present but say nothing about whether inputs actually renders the repo-name sub-example or falls back to a bare key. A silent regression here would be invisible.

💡 Suggested additional assertion
allPassed &= assertContains(
  output,
  "repo-name:",
  "dispatch-repository inputs should show annotated example key 'repo-name'"
);

Or scoped to the dispatch block:

allPassed &= assertContains(
  dispatchBlock,
  "repo-name:",
  "dispatch-repository inputs example key should be expanded"
);

@copilot please address this.

@github-actions github-actions Bot 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.

Request Changes — Test suite does not protect the fix it ships

The doc expansion for dispatch-repository works correctly in the generated output. The schema annotation and generateProperty implementation are sound. However, the test suite added in this PR has three compounding flaws that leave the fix completely unprotected against regression:

Blocking issues
  1. Vacuously-true negative assertion (line 141): the assertNotContains pattern has no leading indent, so it never matches the indented output. Always passes regardless of whether the fix is present.

  2. Positive assertions match the deprecated alias too (lines 143–149): trigger-ci:, event_type:, workflow:, and allowed_repositories: each appear twice in the output file (once for dispatch-repository, once for the deprecated dispatch_repository alias). Tests pass even if dispatch-repository reverts to bare {}.

  3. Dead code in generateVariants (lines 227–237 in the diff): no x-example-key property exists inside any oneOf/anyOf array in the schema — confirmed by scanning the full JSON. The real fix is in generateProperty; this copy is dead and a future DRY violation.

  4. Missing coverage for nested x-example-key (inputsrepo-name): the nested path is exercised but never asserted.

🔎 Code quality review by PR Code Quality Reviewer · 153.6 AIC · ⌖ 5.53 AIC · ⊞ 5.4K
Comment /review to run again

}

// Test 10: Verify that dispatch-repository nested fields are expanded (not just '{}')
allPassed &= assertNotContains(output, "dispatch-repository:\n {}", "dispatch-repository should NOT render as bare '{}'");

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.

Negative assertion is vacuously true — provides zero regression protection for the core fix.

💡 Details

The test checks for the literal string "dispatch-repository:\n {}" (no leading spaces). But dispatch-repository is indented 2 spaces inside the tools: block, so the old broken output would have been " dispatch-repository:\n {}" — which does not match the searched-for unindented string.

assertNotContains always passes here, even if this fix is reverted. Verified: 'dispatch-repository:\n {}' in ' dispatch-repository:\n {}' → False.

Fix: include the leading indent in the assertion:

assertNotContains(output, "  dispatch-repository:\n    {}", "dispatch-repository should NOT render as bare '{}'");

} else {
lines.push(`${indentStr} {}`);
}
} else {

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.

Dead/unreachable code block — x-example-key inside generateVariants can never execute with the current schema.

💡 Details

The new block at lines 227-237 (inside generateVariants) handles variant["x-example-key"] when a variant in a oneOf/anyOf array is itself a dynamic-key object. However, dispatch-repository is a plain property, not a oneOf/anyOf variant — it's handled by generateProperty, not generateVariants.

A scan of the entire schema confirms: no property annotated with x-example-key appears inside any oneOf/anyOf array. The copy in generateProperty (lines 298-313) does the actual work; the copy here is dead code today.

Beyond the dead-code issue, the two blocks are verbatim duplicates. Any future behavioural change (e.g., rendering nested descriptions differently) must be applied in both places or they'll silently diverge. Extract into a shared helper:

function renderAdditionalPropertiesExample(exampleKey, addlProp, indentStr, indent, lines) {
  if (addlProp.description) lines.push(formatComment(addlProp.description, indent + 2));
  lines.push(`${indentStr}  ${exampleKey}:`);
  if (addlProp.properties) {
    lines.push(generateProperties(addlProp.properties, addlProp.required || [], indent + 4));
  } else {
    lines.push(`${indentStr}    {}`);
  }
}

// Test 10: Verify that dispatch-repository nested fields are expanded (not just '{}')
allPassed &= assertNotContains(output, "dispatch-repository:\n {}", "dispatch-repository should NOT render as bare '{}'");

allPassed &= assertContains(output, "trigger-ci:", "dispatch-repository should show annotated example key 'trigger-ci'");

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.

Positive assertions are too broad — they match anywhere in the file, including the deprecated dispatch_repository alias that renders identically.

💡 Details

assertContains(output, "trigger-ci:"), assertContains(output, "event_type:"), assertContains(output, "workflow:"), and assertContains(output, "allowed_repositories:") scan the entire generated file. The deprecated dispatch_repository alias is rendered with the same x-example-key expansion starting at line 8391 of the output, so all four strings appear twice in the file.

These tests would pass even if dispatch-repository itself was broken (e.g., reverted to bare {}) as long as the deprecated alias still expanded correctly.

Fix: scope assertions to the context of dispatch-repository:, not the whole file:

const drIdx = output.indexOf("  dispatch-repository:");
const drSection = output.slice(drIdx, output.indexOf("\n  dispatch_repository:", drIdx));
allPassed &= assertContains(drSection, "trigger-ci:", "...");
allPassed &= assertContains(drSection, "event_type:", "...");


allPassed &= assertContains(output, "workflow:", "dispatch-repository example should include required 'workflow' field");

allPassed &= assertContains(output, "allowed_repositories:", "dispatch-repository example should include 'allowed_repositories' field");

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.

No coverage for the nested x-example-key path (inputsrepo-name).

💡 Details

The schema adds "x-example-key": "repo-name" to the inputs sub-property of each dispatch tool entry. This exercises a second invocation of the x-example-key handling inside generateProperty (at a deeper indent level), but Test 10 never asserts that repo-name: appears in the output.

A regression in how nested x-example-key objects are indented or rendered would go undetected.

Add one assertion:

allPassed &= assertContains(output, "repo-name:", "dispatch-repository inputs should show annotated example key 'repo-name'");

@github-actions github-actions Bot 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.

Review: docs: expand dispatch-repository nested fields in frontmatter-full.md

This is a high-quality docs improvement. The dispatch-repository expansion is accurate and matches the schema; all nested fields (workflow, event_type, repository, allowed_repositories, inputs, max, github-token, staged) are correctly represented with proper comments. Key observations:

  • dispatch-repository expansion: correct and complete — resolves the {} usability gap
  • dispatch_repository (deprecated alias): correctly mirrored
  • allowed-collaborators rename: matches source (safe_outputs_config_types.go)
  • {triggering_type} removal from messages comment: aligned with JSON schema description (line 10419)
  • ✅ Wildcard slash_command / command docs: clear and accurate
  • ✅ New permission fields (attestations, copilot-requests, id-token, models, organization-projects, etc.): well described
  • restore-memory, skills additions: consistent style
  • ✅ Lock file bump (gh-aw-mcpg v0.4.0 → v0.4.1): routine container bump, skipping per lock-file conventions

One non-blocking suggestion filed inline on report-failure-as-issue.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · 80 AIC · ⌖ 6.32 AIC · ⊞ 4.8K

Comments that could not be inline-anchored

docs/src/content/docs/reference/frontmatter-full.md:9527

The Format 1 example value (report-failure-as-issue: true) was removed, leaving only a comment description but no concrete YAML example for users to copy.

Every other multi-format field in this file shows a concrete YAML value per format. Consider restoring it:

  # Format 1: A boolean value that may also be specified as a GitHub Actions
  # expression string that resolves to a boolean at runtime.
  report-failure-as-issue: true

Without it, users relying on Format 1 have no copy…

@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.82.8

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] Expand dispatch-repository nested fields in frontmatter-full.md docs

3 participants