Skip to content

[Nitro CLI] Add --legacy-v1-archive option#9458

Merged
tobias-tengler merged 8 commits intomainfrom
tte/auto-migrate-legacy-archives
Apr 23, 2026
Merged

[Nitro CLI] Add --legacy-v1-archive option#9458
tobias-tengler merged 8 commits intomainfrom
tte/auto-migrate-legacy-archives

Conversation

@tobias-tengler
Copy link
Copy Markdown
Member

No description provided.

@tobias-tengler tobias-tengler changed the title [Nitro CLI] Add --fusion-v1-archive option [Nitro CLI] Add --legacy-v1-archive option Apr 7, 2026
@tobias-tengler tobias-tengler force-pushed the tte/auto-migrate-legacy-archives branch from a62700b to 1a0a26c Compare April 7, 2026 13:31
@tobias-tengler tobias-tengler force-pushed the tte/auto-migrate-legacy-archives branch from c3c7b91 to a8382ae Compare April 22, 2026 17:23
@tobias-tengler tobias-tengler marked this pull request as ready for review April 22, 2026 20:43
Copilot AI review requested due to automatic review settings April 22, 2026 20:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-archive option to fusion compose|publish|validate and implement legacy .fgp migration/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 embed legacy-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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants