Skip to content

Conversation

@Ryan-Amirthan
Copy link
Contributor

@Ryan-Amirthan Ryan-Amirthan commented Dec 22, 2025

Description

Refs: Slack thread from @Ryan-Amirthan about difficulty locating YAML configuration errors

Adds line number reporting to YAML validation errors for docs.yml, product.yml, and version.yml files. Error messages now use a clean file:line: format that is clickable in VS Code, JetBrains, and other modern terminals.

Before:

[error] Invalid object at path $.navigation[1].variants[0].layout[2].contents[1]: does not match any allowed schema (has properties: page)
Did you mean to add 'path'? at /navigation/1/variants/0/layout/2/contents/1

After:

/path/to/docs.yml:42: Invalid object at path $.navigation[1].variants[0].layout[2].contents[1]: does not match any allowed schema (has properties: page)
Did you mean to add 'path'?

The file:line: format at the start of the message enables click-to-navigate in supported terminals.

Changes Made

  • Added YamlSourceMap interface and helper functions to validateAgainstJsonSchema.ts for line number lookup
  • Updated formatErrorMessageWithFilePath to use file:line: prefix format (removed redundant JSON path suffix)
  • Modified loadDocsWorkspace.ts to create a source map when parsing YAML and pass it to validation
  • Updated validateProductConfig.ts and validateVersionConfig.ts to accept optional source map parameter
  • Updated DocsConfigFileAstNodeTypes interface to include absoluteFilepath and sourceMap for version/product files
  • Added js-yaml-source-map dependency to workspace-loader and docs-validator packages
  • Added version 3.31.0 entry to CLI versions.yml

Testing

  • Unit tests added/updated
  • Manual testing completed (lint checks pass)

Human Review Checklist

  • Verify the file:line: prefix format is clear and clickable in VS Code terminal
  • Check that the interface changes to DocsConfigFileAstNodeTypes (adding required absoluteFilepath and sourceMap fields) don't break existing code
  • Verify source map lookup handles edge cases (JSON Pointer escaping with ~0 and ~1, missing properties falling back gracefully)
  • Confirm error messages are still informative when line number cannot be resolved

Link to Devin run: https://app.devin.ai/sessions/7dac2f5c0b3e4c9aab5279a854f15db8
Requested by: @Ryan-Amirthan (ryanstep@buildwithfern.com)

Co-Authored-By: ryanstep@buildwithfern.com <ryanstep@umich.edu>
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring
@devin-ai-integration devin-ai-integration bot changed the title feat: add line number reporting to YAML validation errors Dec 22, 2025
…cator

Co-Authored-By: ryanstep@buildwithfern.com <ryanstep@umich.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants