fix: Allow org creation with conflicting slug and renaming team slug during migration#13065
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Ignored Deployments
|
|
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
|
Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link. |
| if (team.parentId !== targetOrgId) { | ||
| log.warn(`Team ${teamId} is not part of org ${targetOrgId}. Not updating`); | ||
| return { | ||
| slug: team.slug, | ||
| }; | ||
| } |
There was a problem hiding this comment.
No need to unnecessarily stop the revert as it can possibly allow fixing things by running revert again. Goal is to keep the functions idempotent
📦 Next.js Bundle Analysis for @calcom/webThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
… during migration
293c7cb to
a1afd1c
Compare
| async function expectTeamToBeAPartOfOrg({ | ||
| teamId, | ||
| orgId, | ||
| teamSlugInOrg, |
There was a problem hiding this comment.
Verify the new teamSlug is there
| await addTeamRedirect(movedTeam.slug, targetOrganization.slug || orgMetadata.requestedSlug || null); | ||
| await setOrgSlugIfNotSet({ slug: targetOrganization.slug }, orgMetadata, targetOrgId); | ||
| await addTeamRedirect({ | ||
| oldTeamSlug, |
There was a problem hiding this comment.
Verify that the redirect is from oldTeamSlug to new URL
| migratedToOrgFrom: { | ||
| teamSlug: team.slug, | ||
| lastMigrationTime: new Date().toISOString(), | ||
| }, |
There was a problem hiding this comment.
Just saw this - how should we store this info in the new organization settings PR?

What does this PR do?
requestedSlugsame as a team's slug. It allows then moving that team to the organization itself. It is a common scenario when a team upgrades to be come an organizationType of change
How should this be tested?
Mandatory Tasks
Checklist