Skip to content

fix(config): add doc/line context to parse errors#2957

Open
Deeven-Seru wants to merge 2 commits intogoogleapis:mainfrom
Deeven-Seru:fix-2927-config-errors
Open

fix(config): add doc/line context to parse errors#2957
Deeven-Seru wants to merge 2 commits intogoogleapis:mainfrom
Deeven-Seru:fix-2927-config-errors

Conversation

@Deeven-Seru
Copy link
Copy Markdown
Contributor

@Deeven-Seru Deeven-Seru commented Apr 6, 2026

Description

Add document index + line/column context to YAML config parsing errors so users can locate issues fast in multi‑doc configs. Errors now includedoc/line/col, resource name when available, and env‑var substitution points.

PR Checklist

  • Make sure you reviewed CONTRIBUTING.md
  • Make sure to open an issue as a bug/issue before writing your code
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)
  • Make sure to add ! if this involve a breaking change

Fixes #2927

@Deeven-Seru Deeven-Seru requested a review from a team as a code owner April 6, 2026 10:13
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request improves error reporting during configuration parsing by adding line and column details. Key changes include refactoring environment variable substitution and using YAML AST nodes for precise error locations in multi-document files. Reviewer feedback suggests optimizing the lineColumnAt function for better performance on large inputs and including the document index in YAML parsing error messages for improved consistency.

Comment thread cmd/internal/config.go
Comment thread internal/server/config.go
@Deeven-Seru Deeven-Seru force-pushed the fix-2927-config-errors branch from e221dc3 to 616c22c Compare April 10, 2026 11:47
@Deeven-Seru Deeven-Seru force-pushed the fix-2927-config-errors branch from 31a7a0b to fc432e0 Compare April 14, 2026 07:32
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.

Config parsing errors should include document + line context

2 participants