π― Repository Quality Improvement Report β Validation Error Architecture Consistency #17164
Replies: 2 comments
-
|
π€ The smoke test agent was here! Just swinging by to say hello from the automation pipeline. Everything's running smoothly... or at least we hope so! πβ¨
|
Beta Was this translation helpful? Give feedback.
-
|
π₯ WHOOOOSH! π¦Έ KAPOW! The Claude Smoke Test Agent was HERE! π€β‘ ZAP! β Swept through BZZZT! All core checks: β β β β β β β β β β β TEN FOR TEN! POW! Even PR reviews? CRUSHED IT! πͺ ...thwip... β The Smoke Test Agent (Run Β§22226202391)
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Analysis Date: 2026-02-20
Focus Area: Validation Error Architecture Consistency (Custom)
Strategy Type: Custom β first run, repository-specific focus area
Rationale: gh-aw has 45+ dedicated validation files in
pkg/workflow/and a well-designedWorkflowValidationErrorstruct with structured fields (Field,Value,Reason,Suggestion). However, the majority of validation files still use rawfmt.Errorf()instead of this structured type, creating inconsistent error quality and missed opportunities for helpful, actionable feedback to workflow authors.Executive Summary
gh-aw has invested in a strong validation infrastructure β the
WorkflowValidationErrortype (pkg/workflow/error_helpers.go) provides structured errors with field context, reason text, and aSuggestionfield. Yet only ~52 of the 230+ non-chained errors inpkg/workflow/use this structured type. Many validation files with 10+ error returns (strict_mode_validation.go,mcp_config_validation.go,dispatch_workflow_validation.go,repository_features_validation.go) still use unstructuredfmt.Errorf.The impact is real: workflow authors see inconsistent error quality depending on which validation path triggered β some errors include "To fix:" sections and URLs, while others provide only a terse single-line message. Migrating the highest-traffic validation files to
NewValidationErrorwould standardize the developer experience and make errors easier to test, localize, and extend.Full Analysis Report
Focus Area: Validation Error Architecture Consistency
Current State Assessment
Metrics Collected:
pkg/workflow/NewValidationErrorusagesfmt.Errorfin validation filesFiles with Highest Migration Opportunity:
fmt.ErrorfCountNewValidationErrorCountdispatch_workflow_validation.gostrict_mode_validation.gomcp_config_validation.gorepository_features_validation.goengine_validation.goschema_validation.goFiles Already Fully Using Structured Errors (Exemplars):
concurrency_validation.goβ 10/10 structuredsandbox_validation.goβ 4/4 structuredruntime_validation.goβ 4/4 structuredFindings
Strengths
WorkflowValidationErroris well-designed with Field, Value, Reason, Suggestion, and Timestamp fieldscompiler_error_formatter.goprovides file-position-aware error formatting withformatCompilerError()fmt.Errorfmessages indispatch_workflow_validation.goalready contain inline "To fix:" sections β good intent, just needs structured formAreas for Improvement
Suggestionfield ofWorkflowValidationErroris only useful if populated β rawfmt.Errorfmessages that embed suggestions inline bypass this entirelystrict_mode_validation.goembeds documentation URLs at the end of raw error strings; these could be standardized into aDocURLfield or appended uniformlyDetailed Analysis
The inconsistency has a clear historical pattern: the
WorkflowValidationErrortype was added after many validation files were written. New files likeconcurrency_validation.goadopted the structured approach; older files likestrict_mode_validation.gowere not updated.The
dispatch_workflow_validation.gofile is an interesting case β it already has very high-quality error messages with embedded "To fix:" multi-line blocks. Migrating these toNewValidationErrorwould put the suggestion content into the dedicatedSuggestionfield, making them programmatically testable while preserving the content.Example of inconsistency (current state):
π€ Tasks for Copilot Agent
Task 1: Migrate
strict_mode_validation.goto Structured Validation ErrorsPriority: High
Estimated Effort: Medium
Focus Area: Validation Error Architecture Consistency
Code Region:
pkg/workflow/strict_mode_validation.goDescription:
strict_mode_validation.gohas 12fmt.Errorferror returns that validate user-authored workflow frontmatter. These should be migrated to useNewValidationError(field, value, reason, suggestion)for consistency with the rest of the validation system. Each error message already contains a reason and often a documentation URL β extract these into theReasonandSuggestionfields.Acceptance Criteria:
strict_mode_validation.gouseNewValidationError()fmt.Errorf(these are not user validation errors)Suggestionfield is non-empty for every migrated errormake test-unitandmake lintwith no new failuresTask 2: Migrate
mcp_config_validation.goto Structured Validation ErrorsPriority: High
Estimated Effort: Medium
Focus Area: Validation Error Architecture Consistency
Code Region:
pkg/workflow/mcp_config_validation.goDescription:
mcp_config_validation.gohas 10fmt.Errorferror returns that validate MCP server configuration in workflow frontmatter. These should be migrated toNewValidationError()following the same pattern used inconcurrency_validation.go(exemplar). The structured errors will improve user feedback quality when workflow authors misconfigure MCP servers.Acceptance Criteria:
mcp_config_validation.gouseNewValidationError()Fieldparameter accurately identifies the MCP configuration field being validated (e.g.,"tools.mcp-server-name.url","tools.mcp-server-name.type")Suggestionfield is non-empty for every migrated user-facing error%w) remain asfmt.Errorfmake test-unitandmake lintTask 3: Add Validation Quality Test β Ensure Suggestion Fields Are Non-Empty
Priority: Medium
Estimated Effort: Small
Focus Area: Validation Error Architecture Consistency
Code Region:
pkg/workflow/(new test file)Description:
There is no test that verifies
WorkflowValidationErrorinstances have non-emptySuggestionfields. This means future regressions (creating validation errors with empty suggestions) are invisible. Add a test that asserts all validation errors returned by the key validation functions include a non-empty suggestion β creating a quality gate.Acceptance Criteria:
pkg/workflow/validation_error_quality_test.gois created//go:build !integrationbuild tagWorkflowValidationError.Suggestion != ""WorkflowValidationError.Reason != ""make test-unitandmake lintwith no failuresTask 4: Migrate
repository_features_validation.goUser-Facing Errors to Structured FormatPriority: Medium
Estimated Effort: Small
Focus Area: Validation Error Architecture Consistency
Code Region:
pkg/workflow/repository_features_validation.goDescription:
repository_features_validation.gohas 10fmt.Errorfcalls. The key user-facing errors (e.g., "workflow uses safe-outputs.create-issue but repository does not have issues enabled") are high-value targets for structured migration β workflow authors encounter these when their repository is misconfigured, and actionable suggestions would help them resolve the issue without searching docs.Acceptance Criteria:
NewValidationError()%w) remain asfmt.ErrorfSuggestionfield provides a clear action (e.g., "Enable issues in repository Settings β Features or remove create-issue from safe-outputs")make test-unitandmake lintπ Historical Context
Previous Focus Areas
WorkflowValidationError, 4 actionable migration tasks generatedπ― Recommendations
Immediate Actions (This Week)
strict_mode_validation.go(Task 1) β Priority: High. This is the most impactful file since strict mode errors are user-visible security guidance.mcp_config_validation.go(Task 2) β Priority: High. MCP server configuration errors are common for new workflow authors.Short-term Actions (This Month)
repository_features_validation.go(Task 4) β Priority: Medium. Improves DX for users with misconfigured repositories.Long-term Actions (This Quarter)
NewValidationErrorDocURLfield toWorkflowValidationErrorfor standardized documentation link attachmentmake lint-validation-errorstarget to CI that fails iffmt.Errorfis used in*_validation.gofiles without%wchainingπ Success Metrics
Track these metrics to measure improvement in validation error consistency:
Next Steps
NewValidationErroradoption across all validation filesReferences:
Beta Was this translation helpful? Give feedback.
All reactions