Skip to content

feat: reimplement tools.qmd as parameterized shared import, remove builtin presets#23366

Open
Copilot wants to merge 3 commits intomainfrom
copilot/reimplement-tools-shared-agentic-workflow
Open

feat: reimplement tools.qmd as parameterized shared import, remove builtin presets#23366
Copilot wants to merge 3 commits intomainfrom
copilot/reimplement-tools-shared-agentic-workflow

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 28, 2026

tools.qmd was only accessible via two hardcoded non-parameterized shared presets (shared/mcp/qmd.md, shared/mcp/qmd-docs.md). This replaces them with a single parameterized shared/qmd.md using import-schema, making qmd configuration composable and explicitly configurable per workflow.

New shared/qmd.md

Exposes all qmd fields via typed import-schema parameters:

imports:
  - uses: shared/qmd.md
    with:
      gpu: true
      runs-on: aw-gpu-runner-T4
      checkouts:
        - name: docs
          pattern: "docs/src/**/*.{md,mdx}"
          context: "Project documentation"
      searches:
        - name: issues
          type: issues
          max: 500
          github-token: ${{ secrets.GITHUB_TOKEN }}
      cache-key: "qmd-${{ hashFiles('docs/**') }}"

All parameters are optional — unset inputs leave expression placeholders that parseQmdTool now silently ignores.

Changes

  • Removed shared/mcp/qmd.md and shared/mcp/qmd-docs.md
  • Created shared/qmd.md with import-schema for checkouts, searches, cache-key, gpu, runs-on
  • Updated dev.md, smoke-codex.md, and 8 doc workflows to use the new import
  • Schema (main_workflow_schema.json): extended with: to allow arrays of objects, not just primitives — required for passing checkouts/searches as with parameters
  • parseQmdTool: guards cache-key and runs-on against unsubstituted ${{...}} expression strings using strings.Contains to avoid them being treated as literal values when optional inputs are omitted

Copilot AI and others added 2 commits March 28, 2026 17:01
…mport-schema

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/58293861-6689-4b35-a114-76ee2ff1ceb3

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…in parseQmdTool

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/58293861-6689-4b35-a114-76ee2ff1ceb3

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review March 28, 2026 17:57
Copilot AI review requested due to automatic review settings March 28, 2026 17:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Reimplements tools.qmd as a single parameterized shared import (shared/qmd.md) using import-schema, replacing the previous hardcoded shared presets and updating workflows accordingly.

Changes:

  • Added shared/qmd.md with import-schema-driven parameters for checkouts, searches, cache-key, gpu, and runs-on.
  • Updated multiple workflows to import shared/qmd.md (and regenerated corresponding .lock.yml manifests).
  • Extended main_workflow_schema.json to allow with: parameters to include arrays containing object elements; updated parseQmdTool to ignore unexpanded import-schema placeholders.

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/workflow/tools_parser.go Adds guards for qmd cache-key / runs-on to avoid treating unsubstituted import placeholders as literals.
pkg/parser/schemas/main_workflow_schema.json Allows imports[].with to pass arrays that include objects (needed for qmd checkouts / searches).
.github/workflows/shared/qmd.md New parameterized shared qmd import with import-schema and qmd guidance text.
.github/workflows/shared/mcp/qmd.md Removes legacy hardcoded qmd preset.
.github/workflows/shared/mcp/qmd-docs.md Removes legacy hardcoded qmd-docs preset.
.github/workflows/weekly-blog-post-writer.md Switches qmd setup to shared/qmd.md with explicit parameters.
.github/workflows/weekly-blog-post-writer.lock.yml Regenerated lock manifest reflecting new qmd import.
.github/workflows/unbloat-docs.md Switches qmd setup to shared/qmd.md with explicit parameters.
.github/workflows/unbloat-docs.lock.yml Regenerated lock manifest reflecting new qmd import.
.github/workflows/technical-doc-writer.md Switches qmd setup to shared/qmd.md with explicit parameters.
.github/workflows/technical-doc-writer.lock.yml Regenerated lock manifest reflecting new qmd import.
.github/workflows/smoke-codex.md Replaces inline tools.qmd config with shared/qmd.md import parameters.
.github/workflows/smoke-codex.lock.yml Regenerated lock manifest reflecting new qmd import.
.github/workflows/glossary-maintainer.md Switches qmd setup to shared/qmd.md with explicit parameters.
.github/workflows/glossary-maintainer.lock.yml Regenerated lock manifest reflecting new qmd import.
.github/workflows/dictation-prompt.md Switches qmd setup to shared/qmd.md with explicit parameters.
.github/workflows/dictation-prompt.lock.yml Regenerated lock manifest reflecting new qmd import.
.github/workflows/developer-docs-consolidator.md Switches qmd setup to shared/qmd.md with explicit parameters.
.github/workflows/developer-docs-consolidator.lock.yml Regenerated lock manifest reflecting new qmd import.
.github/workflows/dev.md Switches from inline tools.qmd to shared/qmd.md import parameters.
.github/workflows/dev.lock.yml Regenerated lock manifest reflecting new qmd import.
.github/workflows/daily-doc-updater.md Switches qmd setup to shared/qmd.md with explicit parameters.
.github/workflows/daily-doc-updater.lock.yml Regenerated lock manifest reflecting new qmd import.
.github/workflows/daily-doc-healer.md Switches qmd setup to shared/qmd.md with explicit parameters.
.github/workflows/daily-doc-healer.lock.yml Regenerated lock manifest reflecting new qmd import.

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

Comment on lines 430 to 435
// Handle cache-key field. Skip values that contain unexpanded import-schema expressions
// (e.g. "${{ github.aw.import-inputs.cache-key }}") which are left as literal strings
// when the caller does not supply the optional input.
if cacheKey, ok := configMap["cache-key"].(string); ok && cacheKey != "" && !strings.Contains(cacheKey, "${{") {
config.CacheKey = cacheKey
toolsParserLog.Printf("qmd tool cache-key: %s", cacheKey)
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

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

The new guard skips any cache-key containing "${{", but cache keys commonly (and per qmd.go docs) legitimately include GitHub Actions expressions like qmd-index-${{ hashFiles('docs/**') }}. This will silently drop user-provided cache keys and change behavior. Consider only filtering the specific unexpanded import-schema placeholder (e.g. strings that reference github.aw.import-inputs.cache-key, or exact-match the placeholder), while allowing other ${{ ... }} expressions through unchanged.

Copilot uses AI. Check for mistakes.
Comment on lines +446 to 452
// Handle runs-on field (override runner image for the indexing job). Skip values that
// contain unexpanded import-schema expressions which are left as literal strings when
// the caller does not supply the optional input.
if runsOnVal, exists := configMap["runs-on"]; exists {
if runsOnStr, ok := runsOnVal.(string); ok && runsOnStr != "" {
if runsOnStr, ok := runsOnVal.(string); ok && runsOnStr != "" && !strings.Contains(runsOnStr, "${{") {
config.RunsOn = runsOnStr
toolsParserLog.Printf("qmd tool runs-on: %s", runsOnStr)
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

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

Same issue as cache-key: skipping any runs-on value containing "${{" will also drop legitimate GitHub Actions expressions (e.g. matrix/inputs-based runner selection). If the intent is to ignore only unexpanded import-schema placeholders, narrow the check to github.aw.import-inputs.runs-on (or exact placeholder matching) rather than all expressions.

Copilot uses AI. Check for mistakes.
@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot review comments

…rt-inputs. prefix

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/501188f0-c734-4ea3-8f94-7657e08f0135

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 28, 2026

@copilot review comments

Fixed in 859cb0a. Replaced the over-broad strings.Contains(val, "${{") check with a targeted isUnexpandedImportInput helper that only skips values containing github.aw.import-inputs. — so legitimate expressions like qmd-index-${{ hashFiles('docs/**') }} pass through unchanged.

Copilot AI requested a review from pelikhan March 28, 2026 18:18
@pelikhan pelikhan added the smoke label Mar 28, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 28, 2026

❌ Tool validation failed! Agent Container Smoke Test detected missing tools: failed

@github-actions
Copy link
Copy Markdown
Contributor

📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing...

@github-actions github-actions bot removed the smoke label Mar 28, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 28, 2026

🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation...

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 28, 2026

💫 TO BE CONTINUED... Smoke Claude failed! Our hero faces unexpected challenges...

@github-actions
Copy link
Copy Markdown
Contributor

📰 DEVELOPING STORY: Smoke Copilot reports failed. Our correspondents are investigating the incident...

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.

3 participants