-
Notifications
You must be signed in to change notification settings - Fork 127
Enhance dispatch-workflow validation errors with actionable guidance #14447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…uidance Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…ow validation Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
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 developer/user experience of dispatch-workflow configuration validation by making key errors more actionable, and adds unit tests to lock in the improved messaging.
Changes:
- Expanded several
dispatch-workflowvalidation errors with troubleshooting steps and examples. - Added new unit tests validating the presence of actionable guidance in these error messages.
- Updated golangci-lint configuration to exclude staticcheck ST1005 for specific files.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pkg/workflow/dispatch_workflow_validation.go | Enhances multiple validation error messages with multi-line guidance. |
| pkg/workflow/dispatch_workflow_validation_test.go | Adds tests asserting the improved error message content and aggregation behavior. |
| .golangci.yml | Adjusts staticcheck ST1005 exclusion rules for relevant files. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| text: "ST1005: error strings should not end with punctuation or newlines" # Allow multiline user-facing error messages with formatting | ||
| path: pkg/workflow/compiler_orchestrator\.go | ||
| - linters: | ||
| - staticcheck | ||
| text: "ST1005: error strings should not end with punctuation or newlines" # Allow multiline user-facing error messages with formatting |
Copilot
AI
Feb 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This staticcheck exclusion matches the full ST1005 message text. Staticcheck’s wording has changed across versions (e.g., including “should not be capitalized…” and “a newline”), so this exact match is brittle and may stop excluding ST1005 unexpectedly. Prefer matching on the code only (e.g., "ST1005:" or "^ST1005:") or using a broader regex so the exclusion remains stable across toolchain updates.
| text: "ST1005: error strings should not end with punctuation or newlines" # Allow multiline user-facing error messages with formatting | |
| path: pkg/workflow/compiler_orchestrator\.go | |
| - linters: | |
| - staticcheck | |
| text: "ST1005: error strings should not end with punctuation or newlines" # Allow multiline user-facing error messages with formatting | |
| text: "^ST1005:" # Allow multiline user-facing error messages with formatting | |
| path: pkg/workflow/compiler_orchestrator\.go | |
| - linters: | |
| - staticcheck | |
| text: "^ST1005:" # Allow multiline user-facing error messages with formatting |
|
|
||
| if len(config.Workflows) == 0 { | ||
| return fmt.Errorf("dispatch-workflow: must specify at least one workflow in the list") | ||
| return fmt.Errorf("dispatch-workflow: must specify at least one workflow in the list\n\nExample configuration in workflow frontmatter:\nsafe-outputs:\n dispatch-workflow:\n workflows: [workflow-name-1, workflow-name-2]\n\nWorkflow names should match the filename without the .md extension") |
Copilot
AI
Feb 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The empty-workflows error guidance says names should match the filename without the ".md" extension, but dispatch-workflow validation also accepts ".yml" and compiled ".lock.yml" targets. To avoid misleading users, update this line to say "filename without extension" (or mention both .md and .yml explicitly).
| return fmt.Errorf("dispatch-workflow: must specify at least one workflow in the list\n\nExample configuration in workflow frontmatter:\nsafe-outputs:\n dispatch-workflow:\n workflows: [workflow-name-1, workflow-name-2]\n\nWorkflow names should match the filename without the .md extension") | |
| return fmt.Errorf("dispatch-workflow: must specify at least one workflow in the list\n\nExample configuration in workflow frontmatter:\nsafe-outputs:\n dispatch-workflow:\n workflows: [workflow-name-1, workflow-name-2]\n\nWorkflow names should match the filename without the extension (for example, 'my-workflow' for 'my-workflow.md' or 'my-workflow.yml').") |
Validation errors in dispatch-workflow configuration provided minimal context, forcing users to search documentation or source code to understand resolution steps.
Changes
Enhanced 4 validation error messages (
pkg/workflow/dispatch_workflow_validation.go):Added comprehensive test coverage (
pkg/workflow/dispatch_workflow_validation_test.go):Fixed linter compliance (
.golangci.yml):Example
Before:
After:
Original prompt
This section details on the original issue you should resolve
<issue_title>[Code Quality] Enhance dispatch-workflow validation error messages with actionable guidance</issue_title>
<issue_description>## Description
Validation error messages in
pkg/workflow/dispatch_workflow_validation.goprovide basic error descriptions without actionable guidance on how to fix issues. Users encountering these errors must search documentation or source code to understand resolution steps.Current Problem:
Suggested Changes
Enhance 3-4 key error messages to include:
Example Enhancement #1 - Empty workflows list
Before:
After:
Example Enhancement #2 - Workflow not found
Before:
After:
Example Enhancement #3 - Self-reference error
Before:
After:
Files Affected
pkg/workflow/dispatch_workflow_validation.go(lines 26-28, 42, 60-68, 103, 123, 152)Success Criteria
make test-unit)make agent-finish)User Impact
Expected improvement: Reduces support requests and debugging time by 60-80% (typical for actionable error messages)
Before: User encounters error → searches docs → reads source code → trial and error → 15-30 minutes lost
After: User encounters error → reads error message → applies fix → 2-3 minutes to resolution
Source
Extracted from User Experience Analysis Report discussion github/gh-aw#14428
Quality Assessment:
Priority
Medium - Improves user experience and reduces support burden, aligns with quality focus
Comments on the Issue (you are @copilot in this section)
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.