[repository-quality] Repository Quality Improvement Report - Error Message UX & Actionability #33307
Closed
Replies: 2 comments 1 reply
-
|
/plan |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
This discussion was automatically closed because it expired on 2026-05-20T13:58:51.787Z.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
🎯 Repository Quality Improvement Report - Error Message UX & Actionability
Analysis Date: 2026-05-19
Focus Area: Error Message User Experience & Actionability
Strategy Type: Custom
Custom Area: Yes — Error message quality is critical for developer tools like gh-aw but not covered by standard categories
Executive Summary
gh-aw processes 4,817 error sites across the codebase, with 560+
fmt.Errorfcalls in the workflow package alone. While the project has a strong foundation with structured error types (WorkflowValidationError,OperationError,ConfigurationError) that include suggestions fields, only 44 workflow package errors (~7.9%) use the structuredNewValidationErrorpattern. The remaining 695+ errors use genericfmt.Errorfwithout actionable guidance.Key Findings:
%wwrapping for error chain preservationNewValidationError(with suggestions), most uses plainfmt.ErrorfImpact: When compilation or validation fails, users must interpret cryptic error messages and guess solutions. This increases support burden, slows development velocity, and creates friction in the developer experience.
Full Analysis Report
Focus Area: Error Message User Experience & Actionability
Current State Assessment
Error Infrastructure:
WorkflowValidationError: Structured errors with field/value/reason/suggestion (44 uses)OperationError: Operation failures with entity context and suggestionsConfigurationError: Config errors with actionable suggestionsErrorCollector: Aggregates multiple errors with fail-fast or collect-all modesMetrics Collected:
fmt.Errorfcalls%wwrappingFindings
Strengths
WorkflowValidationErrorincludes structured Field/Value/Reason/Suggestion fields with timestampspkg/stringutil/pat_validation.goprovides exemplary error messages:pkg/cli/run_workflow_validation.gosuggests similar input names when validation fails%wpreserve error chains for debuggingconsole.FormatErrorMessage()for consistent terminal outputpkg/workflow/cache_validation.goshows best practice:Areas for Improvement
Low adoption of structured errors (High severity)
NewValidationErrorfmt.Errorf("failed to X: %w", err)without suggestionsMissing actionable suggestions (High severity)
fmt.Errorf("failed to build activation job: %w", err)— what should the user do?Generic negative language (Medium severity)
"invalid repo format: %s"vs better:"invalid repo format '%s' — expected 'owner/repo' format (e.g., 'github/gh-aw')"Inconsistent error context (Medium severity)
NewValidationError(field, value, reason, suggestion)fmt.Errorf("failed to parse YAML: %w", err)Missing file/line context (Low severity)
Detailed Analysis
Error Pattern Distribution:
NewValidationError, but most usefmt.ErrorfExamples of Good Error UX:
Examples of Poor Error UX:
Migration Path:
pkg/workflow/*validation*.go(148 files) to useNewValidationErrorpkg/workflow/compiler*.goto structured errors🤖 Tasks for Copilot Agent
NOTE TO PLANNER AGENT: Split the following tasks into individual work items.
Improvement Tasks
Task 1: Migrate High-Impact Validation Errors to Structured Format
Priority: High
Estimated Effort: Medium
Focus Area: Error Message UX & Actionability
Description: Migrate the 10 most frequently hit validation error paths to use
NewValidationErrorwith actionable suggestions. Focus on errors that users encounter during initial workflow setup and compilation.Target files:
pkg/workflow/compiler_filters_validation.go— Event filter validation (branches/paths conflicts)pkg/workflow/strict_mode_network_validation.go— Network permission errorspkg/workflow/mcp_property_validation.go— MCP server configuration errorspkg/workflow/pip_validation.go— Python dependency validationpkg/cli/run_workflow_validation.go— Workflow input validationAcceptance Criteria:
NewValidationError(field, value, reason, suggestion)make agent-finishsuccessfully before committingCode Region:
pkg/workflow/*validation*.go,pkg/cli/run_workflow_validation.goTarget pattern:
Requirements:
NewValidationErrorfrompkg/workflow/workflow_errors.gopkg/workflow/cache_validation.go(lines 38-47)Example transformation:
Run
make agent-finishbefore creating the PR to ensure all tests pass.Step 2: Apply fuzzy matching to engine validation (example location:
pkg/workflow/compiler.goor similar):Step 3: Add fuzzy matching to:
Step 4: Write tests in
pkg/stringutil/fuzzy_test.go:Reference implementation:
pkg/cli/run_workflow_validation.golines 55-62 (input name suggestions).Run
make agent-finishbefore creating the PR.Step 2: Update
NewValidationErrorsignature (backward compatible):Step 3: Modify parser to track line numbers during frontmatter extraction (
pkg/parser/frontmatter_extractor.goor similar):Step 4: Update validators to use context when available:
Step 5: Update tests to verify line numbers appear in error messages.
Note: Line number tracking adds complexity to the parser. Start with high-impact validators (engine, on, tools) and expand coverage incrementally.
Run
make agent-finishbefore creating the PR.❌ DON'T:
Operation Errors
✅ DO:
❌ DON'T:
Language Patterns
Suggestions
Every suggestion should:
✅ GOOD:
❌ BAD:
Step 3: Integrate into Makefile:
Step 4: Add tests in
pkg/linters/error_messages/error_messages_test.go:Step 5: Document in
CONTRIBUTING.md:Reference: Existing linter pattern in
pkg/linters/(if any exist, or reference Go analysis examples).Run
make agent-finishbefore creating the PR.Step 2: Update validation call sites to use priority:
Step 3: Update CLI output to use summary:
Step 4: Add tests for prioritization and summarization.
Example output:
Run
make agent-finishbefore creating the PR.Beta Was this translation helpful? Give feedback.
All reactions