Skip to content

fix: update stale on.command: reference to on.slash-command: in check_command_position - #48916

Merged
pelikhan merged 4 commits into
mainfrom
copilot/update-comments-on-command-syntax
Jul 29, 2026
Merged

fix: update stale on.command: reference to on.slash-command: in check_command_position#48916
pelikhan merged 4 commits into
mainfrom
copilot/update-comments-on-command-syntax

Conversation

Copilot AI commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

The denial message shown when a trigger comment fails slash-command validation still pointed users to the deprecated on.command: frontmatter key instead of the current on.slash-command: syntax.

Change

  • actions/setup/js/check_command_position.cjs: updated the user-facing hint in writeDenialSummary from `on.command:``on.slash-command:`

Migration-context references in codemod_slash_command.go and related tests (e.g. "Migrate on.command to on.slash_command") were intentionally left unchanged — they name the deprecated field accurately as the source of the migration.


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

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 30.6 AIC · ⌖ 5.38 AIC · ⊞ 7.8K ·
Comment /souschef to run again

…_position

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title fix: update on.command reference to on.slash-command in check_command_position fix: update stale on.command: reference to on.slash-command: in check_command_position Jul 29, 2026
Copilot AI requested a review from pelikhan July 29, 2026 15:06
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot update all occurrences

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

Copilot AI commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

@copilot update all occurrences

Done in commit fix: update all on.command references to on.slash-command. Updated all five locations:

  • actions/setup/js/check_command_position.cjs — user-facing denial hint
  • pkg/cli/codemod_slash_command.go — function comment, Name, Description, and log messages
  • pkg/cli/codemod_slash_command_test.goName assertion updated to match
  • pkg/workflow/frontmatter_extraction_yaml.go — legacy-format comment
  • pkg/cli/fix_command_test.go — test comment

@pelikhan
pelikhan marked this pull request as ready for review July 29, 2026 15:18
Copilot AI review requested due to automatic review settings July 29, 2026 15:18
@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based 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

Attempts to update slash-command terminology, but changes several valid slash_command references to unsupported slash-command.

Changes:

  • Updates the command-position denial hint.
  • Revises codemod metadata, logs, and tests.
  • Changes related implementation and test comments.
Show a summary per file
File Description
actions/setup/js/check_command_position.cjs Updates denial guidance.
pkg/cli/codemod_slash_command.go Revises migration terminology.
pkg/cli/codemod_slash_command_test.go Updates metadata expectation.
pkg/cli/fix_command_test.go Changes fixture commentary.
pkg/workflow/frontmatter_extraction_yaml.go Changes legacy-format commentary.

Review details

Tip

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

Comments suppressed due to low confidence (3)

pkg/cli/codemod_slash_command.go:16

  • These user-visible codemod details claim the migration produces on.slash-command, while Apply actually writes slash_command and that is the schema-supported key. Running gh aw fix will therefore describe its own output incorrectly.
		Name:         "Migrate on.command to on.slash-command",
		Description:  "Replaces deprecated 'on.command' field with 'on.slash-command'",

pkg/cli/codemod_slash_command.go:65

  • This log reports that the line was replaced with on.slash-command, but line 61 actually writes slash_command. The debug trace becomes misleading when diagnosing a migration.
							slashCommandCodemodLog.Printf("Replaced on.command with on.slash-command on line %d", i+1)

pkg/cli/codemod_slash_command.go:76

  • This completion log names on.slash-command even though the applied migration emits on.slash_command, making successful fix logs inaccurate.
				slashCommandCodemodLog.Print("Applied on.command to on.slash-command migration")
  • Files reviewed: 5/5 changed files
  • Comments generated: 5
  • Review effort level: Medium

Comment thread pkg/workflow/frontmatter_extraction_yaml.go Outdated
Comment thread pkg/cli/fix_command_test.go Outdated
Comment thread pkg/cli/codemod_slash_command.go Outdated
Comment thread pkg/cli/codemod_slash_command_test.go Outdated
Comment thread actions/setup/js/check_command_position.cjs Outdated
@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

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

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

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

Caution

agentic threat detected
Threat detection flagged this output in warn mode. Manual review is REQUIRED before any follow-up automation.

Details

The threat detection engine failed to produce results.

Review the workflow run logs for details.

@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 /diagnosing-bugs — requesting changes on two comments that were incorrectly updated.

📋 Key Themes & Highlights

Issues Found

  • Inverted deprecation comment (frontmatter_extraction_yaml.go): The comment was changed to label on.slash-command as the legacy/deprecated format — but it is the current format. The legacy format is on.command. This misleads maintainers.
  • Inaccurate test fixture comment (fix_command_test.go): The comment was changed to say the fixture uses on.slash-command, but the fixture deliberately uses the deprecated on.command field so the codemod can migrate it. The original comment was correct.

Positive Highlights

  • ✅ The user-facing hint in check_command_position.cjs is correctly updated
  • ✅ Codemod Name, Description, and log messages are consistently updated to use on.slash-command
  • ✅ Test assertion in codemod_slash_command_test.go correctly tracks the name change

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 · 30.3 AIC · ⌖ 5.01 AIC · ⊞ 7K
Comment /matt to run again

frontmatterLog.Print("Extracting command configuration from frontmatter")
// Check new format: on.slash_command or on.slash_command.name (preferred)
// Also check legacy format: on.command or on.command.name (deprecated)
// Also check legacy format: on.slash-command or on.slash-command.name (deprecated)

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.

[/diagnosing-bugs] Incorrect comment: on.slash-command is the current preferred syntax, not the legacy/deprecated one — the legacy format is on.command. This edit inverts the comment's meaning and will mislead maintainers.

💡 Suggested fix

Revert this line to the original:

// Also check legacy format: on.command or on.command.name (deprecated)

The code itself correctly falls back to command (not slash-command) when slash_command is absent, so the original comment accurately described the behaviour.

@copilot please address this.

Comment thread pkg/cli/fix_command_test.go Outdated
workflowFile := filepath.Join(tmpDir, "test-workflow.md")

// Create a workflow with deprecated on.command field
// Create a workflow with deprecated on.slash-command 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.

[/diagnosing-bugs] Inaccurate test comment: the test creates a workflow with the deprecated on.command field (that's the whole point — the codemod migrates away from it). Changing the comment to say on.slash-command describes the output, not the input fixture being set up.

💡 Suggested fix

Revert to the original comment:

// Create a workflow with deprecated on.command field

This comment correctly describes the test fixture. The test validates that the codemod transforms on.commandon.slash-command; describing the fixture as already using on.slash-command is misleading.

@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.

Review Summary

The core intent is correct: replacing stale on.command: references with on.slash-command:. However, two code comments were changed incorrectly, inverting what is deprecated vs. what is new.

Blocking issues (2):

  1. pkg/workflow/frontmatter_extraction_yaml.go line 225 — The updated comment now says on.slash-command is the legacy/deprecated format, but on.slash-command is the new preferred format. The deprecated trigger is on.command; revert this comment.
  2. pkg/cli/fix_command_test.go line 560 — The comment now says the test uses a deprecated on.slash-command field, but the test fixture actually uses the command: YAML key. The original comment was accurate; revert it.

All other changes (user-facing error message, codemod metadata, log messages, unit test assertion) look correct.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 · 23.4 AIC · ⌖ 4.9 AIC · ⊞ 5.3K

frontmatterLog.Print("Extracting command configuration from frontmatter")
// Check new format: on.slash_command or on.slash_command.name (preferred)
// Also check legacy format: on.command or on.command.name (deprecated)
// Also check legacy format: on.slash-command or on.slash-command.name (deprecated)

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.

The updated comment is incorrect. The legacy/deprecated trigger is on.command (not on.slash-command). on.slash-command is actually the new preferred format. The comment should remain as it was:

// Also check legacy format: on.command or on.command.name (deprecated)

@copilot please address this.

Comment thread pkg/cli/fix_command_test.go Outdated
workflowFile := filepath.Join(tmpDir, "test-workflow.md")

// Create a workflow with deprecated on.command field
// Create a workflow with deprecated on.slash-command 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.

The comment was incorrectly changed. The test creates a workflow with the deprecated on.command field (the YAML key command: is on line 563), not on.slash-command. Revert this comment to:

// Create a workflow with deprecated on.command field

@copilot please address this.

@github-actions

Copy link
Copy Markdown
Contributor

Caution

agentic threat detected
Threat detection flagged this output in warn mode. Manual review is REQUIRED before any follow-up automation.

Details

The threat detection engine failed to produce results.

Review the workflow run logs for details.

🧪 Test Quality Sentinel Report

Test Quality Score: N/A — Maintenance

This PR contains only maintenance updates to test string assertions. No new test functions were added or modified.

📊 Analysis Summary
Metric Value
Test files modified 2
New test functions 0
Modified test functions 0
Changes String assertion updates only
Type Maintenance (fixing stale references)
Violations 0

Changed test files:

  • pkg/cli/codemod_slash_command_test.go: 1 string in assertion updated
  • pkg/cli/fix_command_test.go: 1 comment updated

Verdict

passed. No new tests added. Existing test assertions updated to match corrected production strings. No violations detected.

🧪 Test quality analysis by Test Quality Sentinel · haiku45 · 19.5 AIC · ⊞ 8.4K ·
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: N/A — Maintenance. No new tests added; existing assertions updated to match corrected production strings. No violations detected.

@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.

Verdict: Request Changes — the fix replaces one wrong string with another wrong string

This PR's stated goal is to correct a stale on.command: reference, but it consistently substitutes on.slash-command: (hyphen) where the actual, schema-defined frontmatter key is on.slash_command: (underscore). This error is repeated across all 5 changed files, including in a user-facing denial message, a codemod's name/description/log strings (which now contradict the codemod's own findAndReplaceInLine call using the underscore), and two code comments that now describe the legacy field incorrectly.

💡 Details and evidence
  • pkg/parser/schemas/main_workflow_schema.json line 531 defines "slash_command" (underscore) as the schema key — confirmed no slash-command (hyphen) key exists anywhere in the schema or extraction code.
  • pkg/workflow/frontmatter_extraction_yaml.go calls extractOnTriggerValue(frontmatter, "slash_command") and extractOnTriggerValue(frontmatter, "command") — never slash-command.
  • pkg/cli/codemod_slash_command.go's findAndReplaceInLine(line, "command", "slash_command") still replaces with the underscored field, but the surrounding Name/Description/log text now claims it produces slash-command.

All four issues are inline. Recommend reverting every slash-command (hyphen) substitution to slash_command (underscore) and re-verifying only the specific check_command_position.cjs denial message (which genuinely was stale) against the schema before resubmitting.

🔎 Code quality review by PR Code Quality Reviewer · aut00 · 39.1 AIC · ⌖ 4.88 AIC · ⊞ 7.8K
Comment /review to run again

await writeDenialSummary(
`The trigger comment did not start with a required command. Expected one of: ${expectedCommands}. Found: \`${firstWord}\`.`,
"Make sure the trigger comment starts with the required command defined in `on.command:` in the workflow frontmatter."
"Make sure the trigger comment starts with the required command defined in `on.slash-command:` in the workflow frontmatter."

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.

This introduces a new incorrect reference: the actual frontmatter key is on.slash_command: (underscore), not on.slash-command: (hyphen).

💡 Why this is wrong

The PR aims to fix a stale reference but swaps one wrong string for another. Per pkg/parser/schemas/main_workflow_schema.json (line 531) and pkg/workflow/frontmatter_extraction_yaml.go, the field is defined as slash_command with an underscore, e.g.:

on:
  slash_command: my-bot

There is no hyphenated slash-command key anywhere in the schema or extraction code. This user-facing message will now direct users to a syntax that will not parse/match, defeating the purpose of the fix.

Fix:

"Make sure the trigger comment starts with the required command defined in `on.slash_command:` in the workflow frontmatter."

Comment thread pkg/cli/codemod_slash_command.go Outdated
var slashCommandCodemodLog = logger.New("cli:codemod_slash_command")

// getCommandToSlashCommandCodemod creates a codemod for migrating on.command to on.slash_command
// getCommandToSlashCommandCodemod creates a codemod for migrating on.command to on.slash-command

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.

Same underscore-vs-hyphen error repeated in comments/log strings — the target field is slash_command, not slash-command.

💡 Why this is wrong

The codemod itself calls findAndReplaceInLine(line, "command", "slash_command") (line 61) — i.e. the actual code correctly produces slash_command with an underscore. But this PR changes the surrounding comments, Name, Description, and log messages to say slash-command (hyphen), which now contradicts the code's own behavior. Anyone reading the codemod name/description or debug logs will be told the tool replaces with a hyphenated key when it actually writes an underscored one.

Fix: revert these five string changes to slash_command (underscore) to match what findAndReplaceInLine actually produces, and instead fix only the truly stale hint in check_command_position.cjs.

frontmatterLog.Print("Extracting command configuration from frontmatter")
// Check new format: on.slash_command or on.slash_command.name (preferred)
// Also check legacy format: on.command or on.command.name (deprecated)
// Also check legacy format: on.slash-command or on.slash-command.name (deprecated)

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.

This comment now states the legacy field is on.slash-command, but the code two lines below calls extractOnTriggerValue(frontmatter, "command") — the legacy key is command, not slash-command.

💡 Why this is wrong

Before this change the comment read "Also check legacy format: on.command or on.command.name (deprecated)" which correctly matched the code (extractOnTriggerValue(frontmatter, "command") at line 227). The edit replaces the accurate legacy field name (command) with a nonexistent one (slash-command), making the comment actively misleading and disconnected from the code it documents. This is a case of "fixing" a comment by making it wrong in a new way.

Fix: revert to // Also check legacy format: on.command or on.command.name (deprecated).


func TestFixCommand_CommandToSlashCommandMigration(t *testing.T) {
// Create a temporary directory for test files
tmpDir := t.TempDir()

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.

This comment change is also incorrect: the test literally uses command: (line below), not slash-command: — the comment now contradicts the test fixture directly above it.

💡 Why this is wrong

The test content is:

on:
  command: my-bot

The comment was changed from "Create a workflow with deprecated on.command field" to "Create a workflow with deprecated on.slash-command field", but the fixture never contains slash-command — it contains command. This mislabels the very fixture it precedes and will confuse future maintainers reading the test.

Fix: revert to // Create a workflow with deprecated on.command field.

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot run pr-finisher skill

…oss all files

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

Copilot AI commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

@copilot run pr-finisher skill

Addressed in commit fix: correct slash-command (hyphen) to slash_command (underscore) across all files. The previous commit had introduced slash-command (hyphen) in several places, but the correct frontmatter key is slash_command (underscore). All five files are now corrected:

  • check_command_position.cjs — denial hint now uses `on.slash_command:`
  • codemod_slash_command.go — comment, Name, Description, and log messages all use on.slash_command
  • codemod_slash_command_test.goName assertion matches "Migrate on.command to on.slash_command"
  • fix_command_test.go — test comment correctly says on.command (the actual deprecated key the fixture creates)
  • frontmatter_extraction_yaml.go — legacy format comment correctly says on.command or on.command.name

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, address unresolved review feedback, and rerun checks once the branch is up to date.

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

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 30.6 AIC · ⌖ 5.38 AIC · ⊞ 7.8K ·
Comment /souschef to run again

Copilot AI commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please run the pr-finisher skill, address unresolved review feedback, and rerun checks once the branch is up to date.

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

All review threads are resolved and the branch is up to date with main. Local validation is green — make fmt produces no changes, and targeted tests pass. No further code changes are needed.

CI must be re-triggered by a maintainer (close/reopen the PR or workflow_dispatch) before merge.

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot make sure all "on.command" are changed to "on.slash_command" to match proper syntax

Copilot AI commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

@copilot make sure all "on.command" are changed to "on.slash_command" to match proper syntax

The user-facing reference in check_command_position.cjs already uses `on.slash_command:` (updated in a prior commit).

The remaining on.command occurrences are all in migration/legacy contexts where the term is intentionally correct:

  • codemod_slash_command.go — the codemod migrates from on.command to on.slash_command; its name, description, and log messages must reference both keys. "Migrate on.slash_command to on.slash_command" would be meaningless.
  • codemod_slash_command_test.go — asserts the codemod's Name field, which correctly names the migration direction.
  • frontmatter_extraction_yaml.go:225 — comment documents the fallback code path on line 229 that actually reads "command" from the YAML; the comment accurately reflects what the code does.
  • fix_command_test.go:560 — test fixture literally creates on: command: my-bot (the deprecated YAML key); the comment accurately identifies it as the deprecated field.

No changes are needed beyond what's already been done.

@pelikhan
pelikhan merged commit 79572fd into main Jul 29, 2026
8 of 10 checks passed
@pelikhan
pelikhan deleted the copilot/update-comments-on-command-syntax branch July 29, 2026 16:19
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.84.0

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants