Repository navigation
Add tests for Manifest serialization and deserialization - #1899
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the ImageBuilder project by adding comprehensive serialization tests for Manifest models and applying consistent code formatting. The tests ensure that JSON serialization/deserialization behavior remains stable, which will facilitate future migrations (e.g., to System.Text.Json) and model improvements. The PR also standardizes file headers and converts to file-scoped namespaces.
Key changes:
- Added 9 new test files with comprehensive serialization/deserialization tests for all Manifest model classes
- Converted 12 Manifest model files to use file-scoped namespaces
- Updated .editorconfig to match the most common file header format across the codebase
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/ImageBuilder/Models/Manifest/TagSyndication.cs | Converted to file-scoped namespace |
| src/ImageBuilder/Models/Manifest/TagDocumentationType.cs | Converted to file-scoped namespace |
| src/ImageBuilder/Models/Manifest/Tag.cs | Converted to file-scoped namespace |
| src/ImageBuilder/Models/Manifest/Repo.cs | Converted to file-scoped namespace |
| src/ImageBuilder/Models/Manifest/Readme.cs | Added missing third line to file header |
| src/ImageBuilder/Models/Manifest/Platform.cs | Converted to file-scoped namespace |
| src/ImageBuilder/Models/Manifest/OS.cs | Converted to file-scoped namespace |
| src/ImageBuilder/Models/Manifest/Manifest.cs | Converted to file-scoped namespace |
| src/ImageBuilder/Models/Manifest/Image.cs | Converted to file-scoped namespace |
| src/ImageBuilder/Models/Manifest/CustomBuildLegGroup.cs | Converted to file-scoped namespace |
| src/ImageBuilder/Models/Manifest/CustomBuildLegDependencyType.cs | Converted to file-scoped namespace |
| src/ImageBuilder/Models/Manifest/Architecture.cs | Converted to file-scoped namespace |
| src/ImageBuilder.Tests/Models/SerializationHelper.cs | Added helper utilities for testing serialization behavior |
| src/ImageBuilder.Tests/Models/TagSyndicationSerializationTests.cs | Added tests for TagSyndication serialization |
| src/ImageBuilder.Tests/Models/TagSerializationTests.cs | Added tests for Tag serialization |
| src/ImageBuilder.Tests/Models/RepoSerializationTests.cs | Added tests for Repo serialization |
| src/ImageBuilder.Tests/Models/ReadmeSerializationTests.cs | Added tests for Readme serialization |
| src/ImageBuilder.Tests/Models/PlatformSerializationTests.cs | Added tests for Platform serialization |
| src/ImageBuilder.Tests/Models/ManifestSerializationTests.cs | Added tests for Manifest serialization |
| src/ImageBuilder.Tests/Models/ImageSerializationTests.cs | Added tests for Image serialization |
| src/ImageBuilder.Tests/Models/CustomBuildLegGroupSerializationTests.cs | Added tests for CustomBuildLegGroup serialization |
| src/ImageBuilder.Tests/GetStaleImagesCommandTests.cs | Simplified type references by removing redundant namespace qualification |
| src/ImageBuilder.Models/Manifest.cs | Added missing third line to file header |
| .editorconfig | Updated file header template to match most common format in codebase |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
mthalman
reviewed
Dec 19, 2025
mthalman
approved these changes
Dec 19, 2025
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.
This PR adds tests that assert all of the functionality around ImageBuilder's
Manifestmodels. They make sure required properties are actually required, ensure that string-enum conversion works correctly, and ensure that serialization/deserialization is consistent in both directions as well as round-trip serialization.With these tests in place, we can be more confident with the following types of changes in the future:
Also included some minor formatting changes: