-
Notifications
You must be signed in to change notification settings - Fork 164
Migrate legacy setup to default profile #259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| // Only create a default profile if there are existing installed servers | ||
| if len(registry.ServerNames()) > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question
I think I have been benefiting from a happy accident where I've been able to add/remove Atlassian for example, and then my config just pops back up and keeps working, but I suppose with profiles, since the config is scoped at the server we can't add the config to a server that doesn't exist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. That will be one tradeoff with the profiles model. If that becomes a desired "feature" we could brainstorm some ideas.
pkg/migrate/migrate.go
Outdated
| return ®istry, cfg, &tools, &mcpCatalog, nil | ||
| } | ||
|
|
||
| func deleteLegacyFiles() error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thought
Would it be better to archive these in a folder? If we somehow got this wrong and people complained we might be able to recover if we have the original files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I will update this.
pkg/migrate/migrate.go
Outdated
| _ = os.Remove(catalogIndexPath) | ||
| _ = os.Remove(oldCatalogPath) | ||
|
|
||
| // We use os.Remove to remove the directory, so only it's only removed if empty |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit typo in comment "only it's only"
|
Question How do we handle client connections that have |
|
@bobbyhouse Good callout. That is handled here.
|
What I did
Implemented a migration path from the existing default
registry.yaml,config.yaml,tools.yamlto adefaultprofile.Migrates when the profiles feature flag is on, only once ever (unless the db is deleted), either when:
--profileflagcatalog-nextcommand is runprofilecommand is runOnce the migration is successful, it moves the legacy files to
~/.docker/mcp/.backup.Follow up needed: We'll need to migrate
remoteservers as well once we've implemented remote support in profiles.Related issue
(not mandatory) A picture of a cute animal, if possible in relation to what you did