feat: support platform resource in migration wizard#3043
Conversation
Greptile SummaryThis PR wires up a new "Platforms" (integrations) group in the Appwrite migration wizard, letting users migrate web, Flutter, iOS, and Android platform configurations from a source project. It follows the same pattern established by earlier groups (backups, messaging) and adds a documented local augmentation to
Confidence Score: 4/5Safe to merge once the dependent backend changes (appwrite/appwrite#11439) are deployed; running against an older source Appwrite could cause the report fetch to fail for all resources. The changes are self-contained and follow established patterns throughout the codebase. The only noteworthy risk is that 'platform' is now unconditionally included in the Appwrite report request — if a user attempts to migrate from a source Appwrite instance that hasn't received the corresponding backend update, the report API may reject the unknown resource value and block the entire wizard. The type cast workaround is intentional and documented. src/lib/stores/migration.ts — specifically the providerResources.appwrite array and the temporary type cast that will need cleanup after SDK regeneration. Important Files Changed
Reviews (1): Last reviewed commit: "feat: support platform resource in migra..." | Re-trigger Greptile |
| export const providerResources: ProviderResourceMap = { | ||
| appwrite: Object.values(AppwriteMigrationResource), | ||
| appwrite: [ | ||
| ...Object.values(AppwriteMigrationResource), | ||
| MigrationResources.Platform as AppwriteMigrationResource | ||
| ], |
There was a problem hiding this comment.
'platform' unconditionally included in Appwrite report request
providerResources.appwrite is passed verbatim to getAppwriteReport as the resources list. Now that 'platform' is always in that array, any source Appwrite instance that pre-dates the backend change (appwrite/appwrite#11439) will receive an unrecognised resource value. Depending on how the API validates the list, it could reject the entire request and surface "Couldn't load resources" to the user — blocking the whole wizard, not just the Platforms row.
| export const MigrationResources = { | ||
| ...AppwriteMigrationResource, | ||
| Platform: 'platform' | ||
| } as const; |
There was a problem hiding this comment.
Type cast widens
providerResources.appwrite beyond its declared element type
MigrationResources.Platform as AppwriteMigrationResource silences TypeScript's check, so any callsite that receives providerResources.appwrite and narrows on the enum values will now silently encounter a value it wasn't compiled to handle. The comment explains this is intentional, but it's worth tracking as a follow-up: once the SDK is regenerated, remove the cast and the local Platform: 'platform' augmentation so the types are in sync again.
Summary
Platformsgroup (Integrations) to the migration wizard's resource selectionMigrationResourceslocally withPlatform = 'platform'until the appwrite/console SDK regenerates against the new specTest plan
Cross-repo
Depends on: