Add diagnostic logging to qmd_index.cjs for empty index debugging#22665
Add diagnostic logging to qmd_index.cjs for empty index debugging#22665
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> Agent-Logs-Url: https://github.com/github/gh-aw/sessions/704fa458-f56c-4549-8fb6-c4e0e7b4f755
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> Agent-Logs-Url: https://github.com/github/gh-aw/sessions/704fa458-f56c-4549-8fb6-c4e0e7b4f755
There was a problem hiding this comment.
Pull request overview
Adds diagnostic logging to the qmd indexing action so misconfigured checkout paths and glob patterns are visible, and emits an actionable warning when indexing results in zero files.
Changes:
- Log per-checkout raw vs resolved paths, plus an existence check on the resolved path.
- Log a summary of registered collections (name/path/pattern) before creating the qmd store.
- Warn via
core.warningwhenstore.update()results in zero indexed/updated/unchanged files.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| actions/setup/js/qmd_index.cjs | Adds collection diagnostics (paths/patterns/existence), collection registration summary, and a zero-file warning after update. |
| .github/workflows/test-dispatcher.lock.yml | Updates the aw_context input description in generated Safe Outputs tool metadata. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const collectionNames = Object.keys(collections); | ||
| core.info(`Registering ${collectionNames.length} collection(s): ${collectionNames.join(", ")}`); | ||
| for (const [name, col] of Object.entries(collections)) { | ||
| core.info(` [${name}] path="${col.path}" pattern="${col.pattern || "(default)"}"`); |
There was a problem hiding this comment.
The collection summary log uses col.pattern || "(default)", which will report "(default)" when col.pattern is the empty string (e.g., when checkout.patterns is an empty array and patterns.join(",") yields ""). That’s misleading for debugging and hides an actual misconfiguration (an empty pattern typically matches nothing). Consider logging the actual value (even if empty) and/or normalizing empty patterns back to the default (e.g., treat [] or "" as "**/*.md").
| core.info(` [${name}] path="${col.path}" pattern="${col.pattern || "(default)"}"`); | |
| const patternForLog = col.pattern === undefined ? "(default)" : col.pattern; | |
| core.info(` [${name}] path="${col.path}" pattern="${patternForLog}"`); |
The qmd index silently produced 0 indexed files with no actionable output to diagnose why — resolved paths, pattern values, and collection registration were all invisible.
Changes
${ENV_VAR}expansion), and whether the resolved path exists on disk — immediately surfaces${GITHUB_WORKSPACE}expansion failures or missing checkoutscreateStore— exposes malformed comma-joined patterns likedocs/src/content/docs/**,.github/agents/**,.github/aw/**core.warningwith actionable hints whenstore.update()returns 0 files, covering the known failure modes: missing path, dotfile glob exclusion, unsupported comma-separated patterns, unresolved env varsExample output on a misconfigured run: