Centralize slash-command routing#8460
Conversation
Set `on.slash_command.strategy: centralized` on the 6 workflows that respond to slash commands: - add-tests.md (/add-tests) - autofix.agent.md (/autofix) - build-failure-analysis-command.md (/analyze-build-failure) - daily-perf-improver.md (/perf-assist) - daily-test-improver.md (/test-assist) - review.agent.md (/review) With centralized routing, the compiler generates a single `.github/workflows/agentic_commands.yml` router that listens to merged slash-command events and dispatches matching target workflows with `aw_context`. Each target workflow compiles as `workflow_dispatch`-centric instead of embedding its own slash matching logic, eliminating duplicate issue/PR/comment event triggers and addressing the only remaining `gh aw compile --strict` warning from #8458. Also includes minor regenerations of `build-failure-analysis.lock.yml` and `issue-arborist.lock.yml`: the compiler now preserves the explicit env var names from the source `.md` files (e.g. `BINLOG_PATH`, `GH_AW_GITHUB_REPOSITORY`) instead of substituting auto-generated `GH_AW_EXPR_*` hashed names. No behavior change. Verified with `gh aw compile --strict`: 21 workflow(s) compiled, 0 error(s), 0 warning(s). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR adopts gh-aw’s centralized slash-command routing to eliminate the remaining gh aw compile --strict warning by routing all slash commands through a single generated .github/workflows/agentic_commands.yml dispatcher, while regenerating the affected workflow lock files accordingly.
Changes:
- Add
on.slash_command.strategy: centralizedto the 6 slash-command source workflows. - Introduce the generated
agentic_commands.ymlrouter workflow and regenerate the 6 corresponding*.lock.ymlworkflows to beworkflow_dispatch-centric. - Regenerate/update additional lock workflows (
build-failure-analysis.lock.yml,issue-arborist.lock.yml) due to compiler output differences.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/add-tests.md | Enables centralized slash-command routing for /add-tests. |
| .github/workflows/add-tests.lock.yml | Regenerated lock output for centralized routing / workflow_dispatch invocation. |
| .github/workflows/autofix.agent.md | Enables centralized slash-command routing for /autofix. |
| .github/workflows/autofix.agent.lock.yml | Regenerated lock output for centralized routing / workflow_dispatch invocation. |
| .github/workflows/build-failure-analysis-command.md | Enables centralized slash-command routing for /analyze-build-failure. |
| .github/workflows/build-failure-analysis-command.lock.yml | Regenerated lock output for centralized routing / workflow_dispatch invocation. |
| .github/workflows/daily-perf-improver.md | Enables centralized slash-command routing for /perf-assist. |
| .github/workflows/daily-perf-improver.lock.yml | Regenerated lock output for centralized routing / workflow_dispatch invocation. |
| .github/workflows/daily-test-improver.md | Enables centralized slash-command routing for /test-assist. |
| .github/workflows/daily-test-improver.lock.yml | Regenerated lock output for centralized routing / workflow_dispatch invocation. |
| .github/workflows/review.agent.md | Enables centralized slash-command routing for /review. |
| .github/workflows/review.agent.lock.yml | Regenerated lock output for centralized routing / workflow_dispatch invocation. |
| .github/workflows/agentic_commands.yml | New centralized router workflow generated by gh-aw to dispatch slash commands. |
| .github/workflows/build-failure-analysis.lock.yml | Regenerated lock output (includes env-var name preservation changes). |
| .github/workflows/issue-arborist.lock.yml | Regenerated lock output (includes env-var name preservation / formatting changes). |
Copilot's findings
- Files reviewed: 15/15 changed files
- Comments generated: 1
Evangelink
left a comment
There was a problem hiding this comment.
✅ 21/21 dimensions clean — no findings.
Review Summary
This PR is a clean refactoring of GitHub Actions workflow infrastructure that centralizes slash-command routing. All changes are compiler-generated by gh-aw v0.74.8 and behaviorally equivalent to the original implementation.
What Changed
Architecture improvement:
- Before: Each workflow listened to
issue_commentevents directly and parsed slash commands independently (6 duplicate listeners) - After: A single
agentic_commands.ymlrouter listens to all comment events, parses commands, and dispatches to target workflows viaworkflow_dispatchwithaw_context
File changes:
- ✅ 6 source
.mdfiles: Addedstrategy: centralized(one line each) - ✅ 6 target
.lock.ymlfiles: Regenerated withworkflow_dispatchtriggers - ✅ 1 new router:
agentic_commands.yml(81 lines, declarative routing configuration) - ✅ 2 other
.lock.ymlfiles: Minor env var name improvements (BINLOG_PATHvsGH_AW_EXPR_*)
Review Assessment
Applicable dimensions (3):
- ✅ Algorithmic Correctness — Command-matching logic correctly moved to router; authorization still enforced in
pre_activation; operator precedence in complexifconditions is correct - ✅ Build Infrastructure & Dependencies — Compiler-generated output validated with
gh aw compile --strict(0 errors, 0 warnings per PR description); actions pinned to SHA hashes; permissions properly scoped - ✅ Scope & PR Discipline — Single concern (centralize routing), well-documented, addresses #8458 compiler warning
Non-applicable dimensions (18):
- No production code changes (MSTest/MTP)
- No test changes
- No API surface changes
- No threading/concurrency code
- No security boundary changes (workflows run in sandboxed environments)
- No localization, performance, or cross-TFM concerns
Key Observations
✅ Security preserved: The router has minimal permissions and only dispatches workflows; team membership and command authorization remain in each workflow's pre_activation job
✅ Behavioral equivalence: Command matching moved from individual workflows to the router, but the end result is identical — same commands trigger same workflows with same authorization checks
✅ Quality improvement: Env var names now use semantic names (BINLOG_PATH, GH_AW_GITHUB_REPOSITORY) instead of compiler-generated hashes (GH_AW_EXPR_DA06E2FF), making generated workflows more readable
✅ JSON safety: aw_context parsing uses fromJSON(... || '{}') fallback pattern to safely handle empty/missing input
✅ Operator precedence: Complex if conditions correctly rely on && binding tighter than || — e.g., event == 'pull_request' && repo.id == repo_id is properly grouped
Verdict
This is a straightforward, compiler-validated infrastructure refactoring with no behavioral changes to MSTest or MTP runtime code. All dimensions are clean.
Generated by Expert Code Review (on open) for issue #8460 · ● 8.7M
|
@copilot resolve the merge conflicts in this pull request |
…lize-slash-commands Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Merge conflicts are resolved in commit |
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
What
Address the only remaining
gh aw compile --strictwarning from #8458:Adds
strategy: centralizedto the 6 slash-command workflows so the compiler generates a single shared.github/workflows/agentic_commands.ymlrouter that listens to merged slash-command events and dispatches matching target workflows viaworkflow_dispatch+aw_context.Source workflow changes (6 files)
add-tests.md/add-testsautofix.agent.md/autofixbuild-failure-analysis-command.md/analyze-build-failuredaily-perf-improver.md/perf-assistdaily-test-improver.md/test-assistreview.agent.md/reviewGenerated changes
.github/workflows/agentic_commands.yml— central router emitted bygh aw compile. Its embedded "Routing summary" header documents which slash command dispatches which workflow..lock.ymlfiles regenerated — each target now compiles asworkflow_dispatch-centric.build-failure-analysis.lock.ymlandissue-arborist.lock.yml: the compiler now preserves the explicit env-var names from the source.mdfiles (e.g.BINLOG_PATH,GH_AW_GITHUB_REPOSITORY) instead of substituting auto-generatedGH_AW_EXPR_*hashed names. No behavior change.How to verify
Notes
issues,issue_comment, andpull_requesttriggers in the same workflow (not exercised here, but enabled for future workflows).