Skip to content

Normalize YAML export formatting for repo-backed namespaces#1947

Merged
shangyian merged 3 commits intoDataJunction:mainfrom
shangyian:yaml-consistency
Apr 2, 2026
Merged

Normalize YAML export formatting for repo-backed namespaces#1947
shangyian merged 3 commits intoDataJunction:mainfrom
shangyian:yaml-consistency

Conversation

@shangyian
Copy link
Copy Markdown
Collaborator

@shangyian shangyian commented Apr 2, 2026

Summary

The YAML files generated through the UI (e.g., when creating a node on a branch) are now formatted identically to files written by hand in various repos that use yamlfix as a pre-commit hook. Previously, the server's ruamel.yaml output could diverge from what yamlfix (used as a pre-commit hook in deployment repos) would produce, causing spurious diffs on the first commit.

List fields (owners, tags, column attributes) were also serialized in arbitrary order, producing non-deterministic output across server restarts or DB query reorderings.

The fix sorts owners, tags, and column attributes alphabetically before serialization, then runs yamlfix (already a server dependency) on the output with explicit_start=False and line_length=120, matching the standard repo config. Short lists now render inline (tags: [abc, def]) and multiline queries retain |- block style.

Test Plan

  • PR has an associated issue: #
  • make check passes
  • make test shows 100% unit test coverage

Deployment Plan

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 2, 2026

Deploy Preview for thriving-cassata-78ae72 canceled.

Name Link
🔨 Latest commit 67419ba
🔍 Latest deploy log https://app.netlify.com/projects/thriving-cassata-78ae72/deploys/69ce7f172c8e3800095a082d

@shangyian shangyian changed the title Make sure that the generated YAML has consistent ordering to prevent … Normalize YAML export formatting for repo-backed namespaces Apr 2, 2026
@shangyian shangyian marked this pull request as ready for review April 2, 2026 15:30
@shangyian shangyian merged commit 44d1e63 into DataJunction:main Apr 2, 2026
17 checks passed
@shangyian shangyian deleted the yaml-consistency branch April 2, 2026 15:31
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