Skip to content

Consolidate workflow FieldLocation onto console ErrorPosition#34123

Merged
pelikhan merged 3 commits into
mainfrom
copilot/deep-report-consolidate-source-locations
May 22, 2026
Merged

Consolidate workflow FieldLocation onto console ErrorPosition#34123
pelikhan merged 3 commits into
mainfrom
copilot/deep-report-consolidate-source-locations

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 22, 2026

pkg/workflow.FieldLocation and pkg/console.ErrorPosition were structurally identical (File, Line, Column) and represented the same source-location concept. This PR removes the duplicate definition and makes workflow location handling use the console canonical type.

  • Canonical source-location type

    • Replaced FieldLocation struct definition in pkg/workflow/workflow_errors.go with a type alias to console.ErrorPosition.
    • This preserves existing workflow call sites while unifying parser → workflow → console location semantics.
  • Workflow package wiring

    • Added the pkg/console import in workflow_errors.go to support the alias.
    • Kept NewValidationErrorWithLocation(..., loc FieldLocation) API shape unchanged for compatibility.
  • Type-level compatibility guard

    • Added a focused test (TestFieldLocationAlias) in pkg/workflow/error_helpers_test.go to assert direct assignability between workflow and console location types.
// pkg/workflow/workflow_errors.go
type FieldLocation = console.ErrorPosition

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 FieldLocation and ErrorPosition duplicate types Consolidate workflow FieldLocation onto console ErrorPosition May 22, 2026
Copilot AI requested a review from pelikhan May 22, 2026 22:33
@pelikhan pelikhan marked this pull request as ready for review May 22, 2026 22:34
Copilot AI review requested due to automatic review settings May 22, 2026 22:34
@pelikhan pelikhan merged commit 7ba76d2 into main May 22, 2026
@pelikhan pelikhan deleted the copilot/deep-report-consolidate-source-locations branch May 22, 2026 22:35
Copilot AI review requested due to automatic review settings May 22, 2026 22:57
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.

[deep-report] Consolidate FieldLocation (workflow) and ErrorPosition (console) duplicate source-location types

2 participants