Skip to content

Consolidate CLI validation issue types - #51098

Merged
pelikhan merged 6 commits into
mainfrom
copilot/consolidate-validation-issue
Aug 7, 2026
Merged

Consolidate CLI validation issue types#51098
pelikhan merged 6 commits into
mainfrom
copilot/consolidate-validation-issue

Conversation

Copilot AI commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

ErrorInfo and CompileValidationError modeled the same validation issue shape separately in pkg/cli, with only audit reports carrying an optional file field. This PR consolidates them while preserving existing JSON field names.

  • Shared type
    • Adds ValidationIssue with common type, message, line, and optional file fields.
    • Updates audit-report and compile-validation results to use the shared type.
type ValidationIssue struct {
    Type    string `json:"type"`
    Message string `json:"message"`
    Line    int    `json:"line,omitempty"`
    File    string `json:"file,omitempty"`
}
  • Call-site cleanup

    • Replaces ErrorInfo and CompileValidationError usages across audit extraction/rendering, findings generation, compile validation, MCP validation injection, and tests.
  • Compatibility coverage

    • Adds focused JSON serialization coverage for compile validation and audit-report issue payloads.
    • Keeps file omitted for compile issues unless set.

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 9.99 AIC · ⊞ 8.4K ·
Comment /souschef to run again

Copilot AI and others added 2 commits August 7, 2026 14:50
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Consolidate ErrorInfo and CompileValidationError into ValidationIssue type Consolidate CLI validation issue types Aug 7, 2026
Copilot AI requested a review from pelikhan August 7, 2026 14:53
@pelikhan
pelikhan marked this pull request as ready for review August 7, 2026 15:41
Copilot AI balanced review requested due to automatic review settings August 7, 2026 15:41

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

Consolidates duplicate CLI validation models into the shared ValidationIssue type while preserving JSON fields.

Changes:

  • Replaces ErrorInfo and CompileValidationError.
  • Updates compile, audit, MCP, rendering, and analysis paths.
  • Adds JSON compatibility tests and documentation.
Show a summary per file
File Description
pkg/cli/validation_issue.go Defines the shared type.
pkg/cli/validation_issue_test.go Tests JSON compatibility.
pkg/cli/README.md Updates exported-type documentation.
pkg/cli/mcp_tools_readonly.go Migrates MCP validation warnings.
pkg/cli/compile_workflow_processor.go Migrates workflow validation issues.
pkg/cli/compile_validation.go Migrates validation sanitization.
pkg/cli/compile_repository_manifest.go Migrates manifest issues.
pkg/cli/compile_pipeline.go Migrates pipeline issues.
pkg/cli/compile_config.go Updates validation result fields.
pkg/cli/compile_command_test.go Updates compile tests.
pkg/cli/audit_test.go Updates audit tests.
pkg/cli/audit_report.go Migrates audit issue handling.
pkg/cli/audit_report_test.go Updates audit-report tests.
pkg/cli/audit_report_render.go Migrates console rendering.
pkg/cli/audit_report_analysis.go Migrates audit analysis.
pkg/cli/audit_agent_output_test.go Updates findings tests.

Review details

Tip

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

  • Files reviewed: 16/16 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment on lines +251 to 254
return ValidationIssue{
Type: e.Type,
Message: stringutil.SanitizeErrorMessage(e.Message),
Line: e.Line,
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot Please address the remaining review feedback, refresh the branch if GitHub can update it cleanly, and run the pr-finisher skill before handing back to maintainers.

Open items to address (newest first):

Branch refresh was requested.

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

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 9.99 AIC · ⊞ 8.4K ·
Comment /souschef to run again

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Please address the remaining review feedback, refresh the branch if GitHub can update it cleanly, and run the pr-finisher skill before handing back to maintainers.

Open items to address (n...

Fixed in the latest commit. sanitizeValidationResults now copies e.File into the reconstructed ValidationIssue, so the file field is preserved through the sanitization boundary.

Copilot AI requested a review from gh-aw-bot August 7, 2026 16:40
@pelikhan
pelikhan merged commit ac528c9 into main Aug 7, 2026
2 checks passed
@pelikhan
pelikhan deleted the copilot/consolidate-validation-issue branch August 7, 2026 17:25
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.86.1

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Code Quality] Consolidate ErrorInfo and CompileValidationError into shared ValidationIssue type

4 participants