Skip to content

fix(parser): isolate formatted import resolution errors - #73817

Merged
pelikhan merged 1 commit into
mainfrom
pelikhan/parser-error-isolation
Nov 1, 2026
Merged

pelikhan merged 1 commit into
mainfrom
pelikhan/parser-error-isolation

Conversation

@pelikhan

@pelikhan pelikhan commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

Why

TestUserFacingErrorsDontLeakInternals/import_resolution_error fails because formatted import-resolution errors retain their underlying cause, allowing errors.As to expose a filesystem PathError. This is a separate follow-up to the pre-existing failure observed on #73586.

Approach

Return a display-ready FormattedParserError without an underlying cause from FormatImportError. Preserve source location, YAML context, and fix hints, as well as formatted-error detection that prevents double formatting. Import-cycle and YAML parse error traversal remain unchanged.

Add regression coverage for direct and wrapped filesystem errors, sentinel errors, and nil causes, and document the import formatter's error-chain boundary.

Validation

  • Build and formatting passed.
  • Focused parser and workflow tests passed, including the original failing test, import-cycle tests, and formatted-error detection.
  • Serialized golangci-lint passed with zero issues.
  • The final make agent-report-progress gate remains blocked by pre-existing custom-linter diagnostics on unchanged indexing expressions in pkg/parser/import_error.go. Its impacted Go tests and schema freshness check passed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review November 1, 2026 15:50
Copilot AI dynamic review requested due to automatic review settings November 1, 2026 15:50
@pelikhan
pelikhan merged commit 4cd03aa into main Nov 1, 2026
40 of 48 checks passed
@pelikhan
pelikhan deleted the pelikhan/parser-error-isolation branch November 1, 2026 15:50
@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Ponytail Reviewer · gpt56 · ~10 AIC · ⌖ ~6 AIC · ⊞ 15.1K · ◷

Generated by Ponytail Reviewer for #73817

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

Design Decision Gate 🏗️

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Design Decision Gate 🏗️ · routed: opus55 xhigh · ~12 AIC · ⌖ ~1 AIC · ◇ ~1 AIC · ⊞ 7.7K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Test Quality Sentinel · haiku45 · ~6 AIC · ⌖ ~8 AIC · ◇ ~3 AIC · ⊞ 9.2K · ◷

🧪 Test quality analysis by Test Quality Sentinel

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.

🟢 Approval recommended

No active review issues remain for the change to isolate underlying causes in formatted import errors.

No open issues 🎉

What changed in this PR

This PR isolates formatted import-resolution errors from their underlying causes, preventing errors.Is and errors.As from exposing internal filesystem errors while preserving user-facing diagnostics and formatted-error detection.

Changes:

  • Return a cause-free FormattedParserError from FormatImportError.
  • Add regression coverage for direct, wrapped, sentinel, and nil causes.
  • Document the error-chain boundary without changing import-cycle or YAML parse error traversal.
File Description
pkg/​parser/​README.md Documents that formatted import errors hide the underlying error chain.
pkg/​parser/​import_error.go Uses the cause-free constructor and clarifies error-chain comments.
pkg/​parser/​import_error_test.go Verifies cause isolation, formatted-error detection, and retained diagnostic content.

Review effort: Balanced (auto)

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.2.0

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.

2 participants