Skip to content

Update Sarif reporter to provide region info based on validator findings#442

Merged
kehoecj merged 7 commits intomainfrom
feat/action-integration
Apr 9, 2026
Merged

Update Sarif reporter to provide region info based on validator findings#442
kehoecj merged 7 commits intomainfrom
feat/action-integration

Conversation

@kehoecj
Copy link
Copy Markdown
Collaborator

@kehoecj kehoecj commented Apr 9, 2026

SARIF Region Support, Multi-Error Reporting, and Error Type Classification

This PR adds structured error position data, separates multiple validation errors across all reporters, and introduces error type classification to distinguish syntax from schema failures.

SARIF Inline Annotations

  • SARIF reporter now emits region with startLine/startColumn on each result, enabling GitHub Actions to post inline PR annotations on the affected lines
  • 10 validators return structured position info (JSON, YAML, TOML, XML, HCL, CSV, ENV, HOCON, TOON, PList)
  • 4 validators without position info (INI, EditorConfig, Properties, SARIF) fall back to file-level annotations
  • Added ValidationError type with optional Line/Column fields

Multi-Error Separation

Previously, multiple schema validation errors were joined into a single string. Each reporter now handles them individually:

  • Standard: each error on its own indented line
  • JSON: "errors" array instead of a single "error" string
  • SARIF: each error as its own result entry (one annotation per error)
  • JUnit: each error on its own line within the <failure> message

Added SchemaErrors type to carry individual error messages from JSONSchemaValidate, ValidateXSD, and SARIF schema validation.

Error Type Classification

  • All errors are prefixed with syntax: or schema: across every reporter
  • New -groupby error-type option groups output into syntax, schema, and Passed categories
  • Works with all existing groupby combinations (e.g. -groupby error-type,filetype)

XSD Error Improvements

  • XSD validation now reports detailed diagnostics via helium ErrorCollector instead of the generic "xsd: validation failed"
  • Error format cleaned up from (string):5: Schemas validity error : ... to line 5: ...

Documentation

  • Added GitHub Action section to README and index referencing Boeing/validate-configs-action@v2.0.0
  • Updated groupby documentation to include error-type
  • Updated CHANGELOG for 2.1.0

kehoecj added 2 commits April 9, 2026 09:44
Add ValidationError type with optional Line/Column fields to enable
GitHub Actions inline annotations on affected lines.

- 10 validators now return structured position info (JSON, YAML, TOML,
  XML, HCL, CSV, ENV, HOCON, TOON, PList)
- 4 validators without position info (INI, EditorConfig, Properties,
  SARIF) fall back to file-level annotations
- SARIF reporter emits region only when line info is available
- Report struct carries StartLine/StartColumn from ValidationError
- Remove dead getCustomErr function (logic moved into JSON ValidateSyntax)
- Add GitHub Action section to README.md and index.md
@kehoecj kehoecj requested a review from a team as a code owner April 9, 2026 14:48
kehoecj added 4 commits April 9, 2026 10:57
Use helium ErrorCollector to capture individual validation errors
instead of the generic 'xsd: validation failed' message. Errors now
include the line number and specific schema violation details.
- Standard: each error on its own indented line
- JSON: errors as an array instead of a single joined string
- SARIF: each error as its own result entry for per-error annotations
- JUnit: each error on its own line within the failure message

Add SchemaErrors type to carry individual error messages from
JSONSchemaValidate, ValidateXSD, and SARIF schema validation.
The CLI populates ValidationErrors slice on Report for reporters
to consume.
Reformat helium XSD errors from
  (string):5: Schemas validity error : Element 'port': ...
to
  line 5: Element 'port': ...

Consistent with the error format used by other validators.
- Prefix each validation error with 'syntax:' or 'schema:' to
  distinguish error types across all reporters
- Add ErrorType field to Report struct
- Add 'error-type' as a new groupby option that groups results
  into syntax, schema, and Passed categories
- Update flag help text, README, and index
@kehoecj kehoecj force-pushed the feat/action-integration branch from 2767e66 to 98a993f Compare April 9, 2026 16:51
@kehoecj kehoecj merged commit 5d5bd83 into main Apr 9, 2026
16 checks passed
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.

1 participant