[Nitro CLI] Add --legacy-v1-archive option#9458
Merged
tobias-tengler merged 8 commits intomainfrom Apr 23, 2026
Merged
Conversation
a62700b to
1a0a26c
Compare
c3c7b91 to
a8382ae
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a --legacy-v1-archive option to Nitro’s Fusion CLI commands to support migrating from Fusion v1 (.fgp) to Fusion v2+ (.far) by merging legacy content into composition/publish/validate flows and optionally embedding the original legacy archive into the resulting .far.
Changes:
- Add
--legacy-v1-archiveoption tofusion compose|publish|validateand implement legacy.fgpmigration/merge during composition. - Introduce shared source schema reading utilities and improve/standardize missing-file error messages.
- Extend Fusion packaging to support arbitrary embedded files in
.far(used to embedlegacy-v1-archive.fgp) and update tests accordingly.
Reviewed changes
Copilot reviewed 28 out of 29 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Nitro/CommandLine/src/CommandLine/Options/OptionalLegacyFusionArchiveOption.cs | Introduces CLI option definition for --legacy-v1-archive. |
| src/Nitro/CommandLine/src/CommandLine/Messages.cs | Adds messages for schema-settings + legacy archive errors. |
| src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionCompositionHelpers.cs | New shared helper for locating/reading schema + settings files. |
| src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/LegacyFusionArchiveMigrator.cs | Reads legacy .fgp, migrates subgraph configs/settings, merges into new source schemas/settings. |
| src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionMigrationHelpers.cs | Tweaks migration to preserve existing version when present. |
| src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionComposeCommand.cs | Adds legacy option, uses shared schema reader, passes legacy archive stream into composition. |
| src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionPublishHelpers.cs | Adds PrepareComposedArchiveAsync that downloads existing config and composes with optional legacy base. |
| src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionPublishCommand.cs | Adds legacy option to publish flow; routes composition through PrepareComposedArchiveAsync. |
| src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionValidateCommand.cs | Adds legacy option to validate flow; routes composition through PrepareComposedArchiveAsync. |
| src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionUploadCommand.cs | Uses shared schema reader (better validation/messages). |
| src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionSettingsSetCommand.cs | Updates compose call signature to pass legacyArchive: null. |
| src/Nitro/CommandLine/src/CommandLine.FusionCompatibility/Nitro.CommandLine.FusionCompatibility.csproj | Exposes FusionCompatibility internals to the nitro tool assembly. |
| src/Nitro/CommandLine/src/CommandLine.FusionCompatibility/FusionGraphPackage.cs | Adds raw-byte read helpers for legacy settings/subgraph config parts. |
| src/HotChocolate/Fusion/src/Fusion.Utilities/WellKnownVersions.cs | Adds LegacyGatewayFormatVersion (v1). |
| src/HotChocolate/Fusion/src/Fusion.Packaging/FusionArchive.cs | Adds generic SetFileAsync/GetFileAsync APIs for embedded files. |
| src/HotChocolate/Fusion/src/Fusion.Packaging/FileNames.cs | Treats unknown filenames as FileKind.File (enables generic embedded files). |
| src/HotChocolate/Fusion/src/Fusion.Packaging/FileKind.cs | Adds File kind. |
| src/HotChocolate/Fusion/src/Fusion.Packaging/ArchiveSession.cs | Allows FileKind.File up to schema-size limit. |
| src/HotChocolate/Fusion/src/Fusion.Composition/CompositionHelper.cs | Persists legacy .fgp into .far as legacy-v1-archive.fgp when provided. |
| src/HotChocolate/Fusion/src/Fusion.Aspire/AspireCompositionHelper.cs | Updates compose signature to pass legacyArchive: null. |
| src/HotChocolate/Fusion/src/Fusion.Composition/PostMergeValidationRules/*.cs | Filters invalid-rule inputs to only types that exist post-merge. |
| src/HotChocolate/Fusion/src/Fusion.Composition/HotChocolate.Fusion.Composition.csproj | Adds InternalsVisibleTo for Nitro CLI tests. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Fusion/FusionCommandTestBase.cs | Adds constants/helpers for legacy archive + multiple schemas. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Fusion/FusionComposeCommandTests.cs | Adds/updates compose tests for legacy option and error messaging. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Fusion/FusionPublishCommandTests.cs | Adds extensive publish coverage for legacy migration/embedding behavior. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Fusion/FusionValidateCommandTests.cs | Adds validate coverage for mutual exclusivity + legacy behavior. |
| src/Nitro/CommandLine/test/CommandLine.Tests/Commands/Fusion/FusionMigrationHelpersTests.cs | New unit tests for JSON migration helpers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4fd9fc9 to
07ed52f
Compare
This was referenced May 1, 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.
No description provided.