Skip to content

strict yaml unmarshal loading test files - #93

Merged
cainelli merged 2 commits into
mainfrom
strict-yaml-loading
Nov 16, 2026
Merged

cainelli merged 2 commits into
mainfrom
strict-yaml-loading

Conversation

@cainelli

@cainelli cainelli commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Problem

YAML unmarshaling was not validating unknown fields in test configuration files, allowing malformed test data to silently pass through and causing confusing test failures downstream.

Solution

  • Switched from yaml.Unmarshal to yaml.UnmarshalStrict to reject unknown fields during test loading
  • Added test case validating that strict unmarshaling rejects files with unknown fields
  • Added example test data file demonstrating the rejected schema (unknown field nested incorrectly)

Signed-off-by: Fernando Cainelli <fernando.cainelli@getyourguide.com>
Signed-off-by: Fernando Cainelli <fernando.cainelli@getyourguide.com>
@coderabbitai

coderabbitai Bot commented Nov 16, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central TS config (base), Organization UI (inherited); Enforced overrides: Organization
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: daed2a34-ca54-423e-a8aa-a4eefdda8487
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@clue-gyg clue-gyg left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Auto-approved

The change is test-only and about 30 lines in total, which is under the 50-line limit. It switches yaml.Unmarshal to UnmarshalStrict in test/testcases.go, adds one test in test/testcases_test.go, and adds one testdata fixture. It touches no production code, dependencies, or security-sensitive files.

@cainelli
cainelli merged commit c989815 into main Nov 16, 2026
10 of 12 checks passed
@cainelli
cainelli deleted the strict-yaml-loading branch November 16, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants