Skip to content

Conversation

@tonur
Copy link

@tonur tonur commented Aug 21, 2025

Solves one part of this issue:

With some additional features added to solve machine readable feature request in this PR:

YAML comparison to avoid non-deterministic random output:

  • The getNonStandardIdentifierFromNamedLists function in pkg/dyff/core.go now sorts keys before iterating, ensuring deterministic order when comparing named lists. This prevents inconsistent results due to map iteration order.

Test fixture updates:

  • The test fixture files assets/issues/issue-525/from.yaml and assets/issues/issue-525/to.yaml have been updated with new and modified entries, reflecting changes in image tags, digests, and additional images for more comprehensive testing. [1] [2]

Output formatting:

  • The generateHumanDetailOutputAddition method in pkg/dyff/output_human.go now uses the report's configured indent value instead of a hardcoded value, ensuring consistent output formatting.

Example that this is deterministic:
One sample:
image

Many samples:
image

@tonur
Copy link
Author

tonur commented Aug 26, 2025

I don't know if this is a fix or a feat.
I will use fix in the PR title, but please tell me to change it if you disagree.

@tonur tonur changed the title Deterministic sort list fix fix: Deterministic sort list in output to avoid random order Aug 26, 2025
@tonur
Copy link
Author

tonur commented Oct 26, 2025

Any chance that this could get a review?

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