Skip to content

fix(config): stop save corrupting configs not indented with 2 spaces#914

Merged
JosephKav merged 1 commit into
masterfrom
fix/service-marshal-indentation
Jul 2, 2026
Merged

fix(config): stop save corrupting configs not indented with 2 spaces#914
JosephKav merged 1 commit into
masterfrom
fix/service-marshal-indentation

Conversation

@JosephKav

Copy link
Copy Markdown
Collaborator

Service.MarshalYAML pre-marshalled itself to bytes at the marshal-default 2-space indent, so on configs using any other indentation, goccy spliced a mixed-indent subtree into the document. Save's line-based cleanup (reorderYAML) then misread the indent levels and stripped all keys on the next level (e.g. options, latest_version, deployed_version, ...), flattening the service block into a config that failed to parse/validate on the next start.

Marshal Service via yaml.InterfaceMarshaler instead, returning a value for the enclosing encoder to marshal, so the document's encode options (indentation) also apply to the Service subtree.

fixes #910

Service.MarshalYAML pre-marshalled itself to bytes at the marshal-default
2-space indent, so on configs using any other indentation, goccy spliced a
mixed-indent subtree into the document. Save's line-based cleanup
(reorderYAML) then misread the indent levels and stripped all keys on the
next level (e.g. `options`, `latest_version`, `deployed_version`, ...),
flattening the service block into a config that failed to parse/validate
on the next start.

Marshal Service via yaml.InterfaceMarshaler instead, returning a value for
the enclosing encoder to marshal, so the document's encode options
(indentation) also apply to the Service subtree.
@JosephKav JosephKav added bug Something isn't working go Pull requests that update Go code labels Jul 2, 2026
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.71%. Comparing base (e91330e) to head (c4a7681).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #914   +/-   ##
=======================================
  Coverage   99.71%   99.71%           
=======================================
  Files         199      199           
  Lines       12721    12721           
=======================================
  Hits        12683    12683           
  Misses         33       33           
  Partials        5        5           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JosephKav JosephKav merged commit c0dd0f8 into master Jul 2, 2026
8 of 9 checks passed
@JosephKav JosephKav deleted the fix/service-marshal-indentation branch July 2, 2026 05:40
@Argus-Bot Argus-Bot mentioned this pull request Jul 2, 2026
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

✅ Playwright Test Results

Count
✅ Passed 304
❌ Failed 0
🔄 Flaky 0
⏭️ Skipped 4

Duration: 962.5s

View screenshots & full report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: 0.30.0 docker pakage can't start.

2 participants