Repository navigation
Lock in release-notes configuration and bundle behaviour with snapshots - #4877
Merged
Merged
Conversation
Adds 85 changelog.yml loading snapshots, 26 bundle loading and amend merge snapshots, and tables for entry validation and lifecycle inference. They record what the code does today, ahead of the domain-model refactor in #4530. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Contributor
Docs preview (local build)Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4877/ |
On Windows the mock file system reports bundle paths with a drive and backslashes, and the raw string fixtures carry CRLF, which moves the character offsets in YAML error messages. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds snapshot tests that record how changelog.yml loading, bundle loading, amend merging, entry validation and lifecycle inference behave today, so the domain-model refactor in #4530 can show it changes nothing.
Affects: Release notes, Configuration
Prompt summary: Add behaviour-locking snapshot tests for release-notes configuration and bundles ahead of #4530. Product code stays untouched.
Why
The refactor in #4530 must not change behaviour, but the loaders and mergers have few tests that pin their full output. Long
Should()chains cover a few properties each.What
changelog.yml loading
85 snapshots, one per YAML shape (pivot, products, rules, bundle profiles, filename strategies, lenient lists, unknown keys, wrong types, empty file, the shipped example). Each records the whole loaded model (dumped by reflection, so a new property appears automatically), the diagnostics in order, and any exception. The existing tests stay.
Bundle loading and amend merging
26 snapshots run each file set through folder loading, content loading and merge-by-target. They cover same-target bundles in both path orders, amends out of order, repeated and re-added, notes sidecars, description patches, and invalid entries.
Validator and inference tables
Text snapshots for
ChangelogEntryValidator(37 cases in 5 contexts, plus filename parsing) andVersionLifecycleInference.Out of scope: Some recorded behaviours look unintended, for example a config error that still returns a configuration and a few odd lifecycle inferences. They are recorded, not fixed.
Verify
mise run test mise run lint mise run snap:orphansEach new class failed when the product code it covers was changed on purpose, then passed again after the revert. The fixtures use synthetic names only.