mpg: show v1 to v2 migration notices - #5133
Open
kylemclaren wants to merge 4 commits into
Open
Conversation
Cluster-scoped commands print a direct dashboard migration link when the resolved cluster is MPG v1. fly mpg list prints a general notice when the organization has v1 clusters. Messages go to stderr so JSON output stays clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016mL1h244soaT82gD6ak7y8
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016mL1h244soaT82gD6ak7y8
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016mL1h244soaT82gD6ak7y8
Uses eligible_for_v2_migration from the v1 get-cluster endpoint (superfly/ui-ex#5317). nil (older server or list endpoint) keeps the link visible; an explicit false hides it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016mL1h244soaT82gD6ak7y8
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
This change adds migration messages to the
fly mpgcommands. The messages tell users about the migration from MPG v1 to MPG v2.fly mpg listshows a general message if the organization has MPG v1 clusters.Changes
internal/command/mpg/mpg.go: This file gets the message text and two print functions. The functionClusterFromArgOrSelectprints the cluster message when it finds an MPG v1 cluster.internal/command/mpg/list.go: The list command prints the general message when the list contains an MPG v1 cluster. It does not print the message for deleted clusters.iostreams/iostreams.go: The new functionCreateLinkURLmakes a URL clickable in terminals that support hyperlinks. Other terminals show the plain URL one time.internal/command/mpg/notice_test.go: New tests examine the two print functions.Test
go test ./internal/command/mpg/ ./iostreams/. All tests pass.fly mpg status <v1-cluster-id>. The command shows the cluster message and the link.fly mpg status <v2-cluster-id>. The command shows no migration message.fly mpg list. The command shows the general message if v1 clusters are in the list.🤖 Generated with Claude Code