Skip to content

Add Custom Domains + SMTP migration wizard support#3057

Open
premtsd-code wants to merge 10 commits into
mainfrom
add-custom-domains-migration
Open

Add Custom Domains + SMTP migration wizard support#3057
premtsd-code wants to merge 10 commits into
mainfrom
add-custom-domains-migration

Conversation

@premtsd-code
Copy link
Copy Markdown
Contributor

Summary

  • Adds Custom domains and Custom SMTP rows to the migration wizard's resource picker.
  • Custom domains migrates manually-added proxy rules (API, function, site, redirect). Auto-generated `.appwrite.network` rules are skipped — they're recreated by parent Function/Site migration.
  • SMTP migrates the project's custom SMTP configuration. The password is not exposed by the SDK; the destination keeps its existing password.

Pairs with:

Test plan

  • Wizard renders both new rows for the Appwrite source provider
  • Selecting either checkbox sends the correct resource(s) to the migration endpoint
  • Migration report shows the per-resource count

Adds api-key as a child toggle under the existing integrations group,
matching the parent-child pattern used by users/teams, databases/rows,
and messaging/messages. The backend uses the kebab-case 'api-key'
resource id; the form field stays camelCase as a local property.
Adds new 'settings' form group (parent for project-level configuration
like variables and webhooks). Project variables become settings.root.
The backend migration library exposes them via the new GROUP_SETTINGS.
Adds webhook as a child toggle under the existing settings group,
joining project variables as the second project-level setting that
can be migrated.
- MigrationResource union + MigrationResources enum gain 'auth-methods'
- New top-level form group 'authMethods' (root-only, like backups)
- providerResources.appwrite includes AuthMethods
- migrationFormToResources / resourcesToMigrationForm round-trip
- resource-form.svelte shouldRenderGroup + getReportKey
- importReport.svelte labelMap + descriptionMap
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 21, 2026

Greptile Summary

This PR adds Custom Domains (rule) and Custom SMTP (smtp) as selectable migration resources, and also adds 9 other project-level singleton resources (platform, api-key, project-variable, webhook, auth-methods, protocols, labels, services, policies) ahead of an SDK regeneration. The bidirectional form↔resource mappings and provider resource lists are extended consistently.

  • migration.ts \u2013 extends MigrationResources, initialFormData, ResourcesFriendly, providerResources, and both conversion functions for all 11 new resource keys.
  • resource-form.svelte \u2013 adds shouldRenderGroup checks and getReportKey mappings for each new group.
  • importReport.svelte \u2013 adds labelMap and descriptionMap entries; however the descriptions for root-only (single-checkbox) groups are never rendered to the user because the non-accordion path does not pass a description prop to Selector.Checkbox.

Confidence Score: 3/5

Safe to merge once the SMTP/custom-domain description visibility issue is resolved — users currently cannot see the important caveats (password not migrated, auto-domains skipped) before selecting those checkboxes.

The core store and resource-mapping logic is well-structured and symmetric. The main concern is in importReport.svelte: descriptions written for root-only groups like smtp and customDomains are never passed to the Selector.Checkbox and therefore never shown to users. These descriptions carry migration-critical information — notably that the SMTP password is not transferred and that .appwrite.network auto-domains are silently skipped.

importReport.svelte — the no-children checkbox rendering path needs to surface the root description to users.

Important Files Changed

Filename Overview
src/lib/stores/migration.ts Adds 11 new MigrationResource literals, initialFormData keys, ResourcesFriendly labels, providerResources entries, and bidirectional form↔resource mappings. Minor round-trip inconsistency for integrations/settings sub-items is low practical risk today.
src/routes/(console)/(migration-wizard)/resource-form.svelte Extends shouldRenderGroup and getReportKey for every new resource type. Changes are mechanical and consistent with existing patterns.
src/routes/(console)/project-[region]-[project]/settings/migrations/(import)/importReport.svelte Adds labelMap and descriptionMap entries for all new groups. Root descriptions for single-checkbox groups (smtp, customDomains, etc.) are silently dropped because the no-children rendering path never passes them to the Selector.Checkbox.

Comments Outside Diff (1)

  1. src/routes/(console)/project-[region]-[project]/settings/migrations/(import)/importReport.svelte, line 149-174 (link)

    P1 Root-only checkbox descriptions are never rendered

    For groups with no children (single root key — e.g. smtp, customDomains, authMethods, protocols, labels, services, policies), the component renders a plain <Button> wrapping a Selector.Checkbox with no description prop. The descriptionMap entries for these groups' root keys are therefore dead code and users never see them.

    This is especially impactful for smtp.root ("the password is not exposed by the SDK and stays on the destination") and customDomains.root (the .appwrite.network auto-domain skip caveat) — both describe important migration caveats that users need before clicking the checkbox. To expose these, the description prop should be passed to the Selector.Checkbox (or a caption rendered below it) in the simple/non-accordion path.

Reviews (1): Last reviewed commit: "Add Custom Domains + SMTP migration wiza..." | Re-trigger Greptile

Comment on lines +374 to +384
if (resources.includes(MigrationResources.ApiKey)) {
formData.integrations.root = true;
formData.integrations.apiKeys = true;
}
if (resources.includes(MigrationResources.ProjectVariable)) {
formData.settings.root = true;
}
if (resources.includes(MigrationResources.Webhook)) {
formData.settings.root = true;
formData.settings.webhooks = true;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Round-trip inconsistency: sub-item presence sets root=true, which forward-maps to the parent resource

When resourcesToMigrationForm is called with a list that contains ApiKey but not Platform, it sets formData.integrations.root = true. Then migrationFormToResources always emits Platform when integrations.root is true, so a round-trip silently adds Platform to the resource list. The same applies to Webhook / ProjectVariable in the settings group.

In the current UI flow resourcesToMigrationForm is only called via selectAll() with the full provider list (which always includes both resources), so this is not immediately observable. However, if the function is reused in an edit/re-import flow in the future, migrations could silently acquire unintended resources.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant