Skip to content

YAML display key ordering is non-deterministic in hve-core-all collection manifest #702

@WilliamBerryiii

Description

@WilliamBerryiii

Summary

Update-HveCoreAllCollection in PluginHelpers.psm1 produces non-deterministic YAML output for the display section of collection manifests. The featured and ordering keys appear in inconsistent order across runs because ConvertTo-Yaml (from the powershell-yaml module) serializes regular hashtables with non-deterministic key iteration order.

Expected Behavior

The display section in hve-core-all.collection.yml should always serialize featured before ordering:

display:
  featured: true
  ordering: alpha

Actual Behavior

Key order varies between runs, sometimes producing ordering before featured:

display:
  ordering: alpha
  featured: true

This causes unnecessary diffs and non-reproducible output.

Root Cause

The display property is stored as a regular PowerShell hashtable. ConvertTo-Yaml iterates hashtable keys in undefined order. The fix is to rebuild the display section as [ordered]@{} with explicit key insertion order before serialization.

Fix

Rebuild the display section as an ordered hashtable with featured inserted before ordering in Update-HveCoreAllCollection.

🔧 - Generated by Copilot

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions