Fix YAML sequence indentation in manifest and mock data files#286
Open
nicomiguelino wants to merge 7 commits intomasterfrom
Open
Fix YAML sequence indentation in manifest and mock data files#286nicomiguelino wants to merge 7 commits intomasterfrom
nicomiguelino wants to merge 7 commits intomasterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to ensure YAML written by the CLI follows a more conventional indentation style for sequences (e.g., list items indented under their parent key) by formatting serde_yaml::to_string output before writing manifests and mock data.
Changes:
- Added a shared YAML formatter helper (
format_yaml) and applied it to all YAML write paths for edge-app manifests and mock data generation. - Updated manifest serialization tests to match the new sequence indentation.
- Introduced the
pretty_yamldependency (and corresponding lockfile updates) to perform the formatting.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/commands/serde_utils.rs | Adds format_yaml helper based on pretty_yaml for post-processing YAML text. |
| src/commands/edge_app/server.rs | Formats generated mock-data.yml output before writing to disk. |
| src/commands/edge_app/manifest.rs | Formats serialized screenly.yml and updates YAML string assertions for indented sequences. |
| src/commands/edge_app/instance_manifest.rs | Formats serialized instance.yml before writing to disk. |
| Cargo.toml | Adds pretty_yaml dependency. |
| Cargo.lock | Locks transitive dependencies introduced by pretty_yaml. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
salmanfarisvp
approved these changes
May 7, 2026
salmanfarisvp
suggested changes
May 7, 2026
Contributor
Author
|
@salmanfarisvp, please see #287 for the fix on Nix builds. |
rusko124
approved these changes
May 8, 2026
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.
Summary
serde_yamlemits block sequences flush with the parent key (e.g.- itemat the same indent level askey:), which does not conform to standard YAML style.pretty_yamlas a dependency and introduces a sharedformat_yamlhelper inserde_utils.rsthat post-processesserde_yaml::to_stringoutput withQuotes::PreferSingleandindent_block_sequence_in_map: true(thepretty_yamldefault).EdgeAppManifest::save_to_file,InstanceManifest::save_to_file, andEdgeAppCommand::generate_mock_data.manifest.rsto reflect the corrected indentation.Before:
After:
Test plan
cargo test— 185 tests pass; one pre-existing failure (test_read_token_correct_token_is_returned) is unrelated to this change and fails onmasteras well.help_text(nested mappings with sequences) round-trips correctly through the formatter.screenly edge-app createand confirmed the generatedscreenly.ymlhas properly indented sequence items.cargo audit— all findings are pre-existing;pretty_yamlintroduces no new vulnerabilities.