feat(ui): migrate OrganizationProfile security panel to Mosaic#9125
feat(ui): migrate OrganizationProfile security panel to Mosaic#9125alexcarpenter wants to merge 7 commits into
Conversation
…izard engine + domains step) Migrates the Enterprise SSO Security panel from the legacy styled-system components into the Mosaic machine -> controller -> view architecture. - Overview: status badge, activate/deactivate/remove (type-to-confirm), domain chips, tab gating shared with the shell. - Wizard engine: 4-step machine (verify-domain -> configure -> test -> activate) with furthest-reachable seat, recheck re-seat, and deferred-advance; proven 1:1 against the legacy reducer by equivalence test. - Verify-domain step: three concurrent mutation machines (add / prepare / remove) matching the domains-section pattern, plus mount telemetry. configure / test / activate render placeholders pending follow-up commits.
🦋 Changeset detectedLatest commit: f048f08 The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Repository UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
…ovider + SAML sub-flow) Collapses the legacy three-level nested ConfigureSSO wizard (outer / middle configure / inner per-provider SAML) into one flat configure machine. The middle+inner levels become a single machine; the terminal-save bubble to the outer wizard becomes a controller-forwarded NEXT, absorbed by the outer wizard's existing pendingNext deferral. - Preserves the create/change revalidation-race deferral (pendingEnter), the provider asymmetry (Google submits mid-flow; Okta/Custom/Microsoft submit at the terminal step), the forward-entry select-provider force, inner-first PREV back to select-provider, and the connection-deleted recheck re-seat. - 23 new tests (machine + view). Full security suite 144 green. Deferred (approved, view-fidelity only, not flow): rich per-provider instructional content and the manual/file-upload SAML input modes; the metadata-URL path is wired end to end.
…-validate + armPolling)
… + skip/done exit)
Close the gap between the legacy ConfigureSSO test suite and the new Mosaic machines by porting the missing FLOW behaviors and adding the nested-seam equivalence oracle. Scope is behavior outside the view components (views are a deliberate, approved deviation). Wizard engine (organization-profile-security-wizard.machine.test.ts): - PREV abandons a parked advance (legacy goPrev clears pendingNextFrom) - a parked advance survives a still-blocked recheck, resolves on a later one - recheck does not yank the user forward when the current step still holds - recheck is a provable one-shot (no second re-seat / re-notify) - isSecurityWizardStepComplete: position-independent per-step completion Configure step (organization-profile-security-wizard-configure.machine.test.ts): - change-provider advance defers like create across the non-atomic swap - per-provider save-terminal for all 4 providers + CONFIGURE_PROVIDER_STEPS pinned 1:1 to the legacy Saml*ConfigureSteps arrays Configure nested-seam equivalence oracle (new .equivalence.test.tsx): - drives the legacy inner useWizardMachine seam and the new collapsed machine through the same walk for every provider; asserts identical terminal-bubble and first-inner back-out boundary behavior. Full security suite: 195 passing.
Independent adversarial re-audit of all ~142 legacy flow tests surfaced four
genuinely-unproven behaviors (the rest were view-only, superseded, or cross-file
false positives). Close them:
- test-step polling arm distinction: create-run arms polling
(setPage(1) + refresh({armPolling:true}) + open URL), manual Refresh logs stays bare
- configure terminal-save bubble -> outer wizard defers -> lands on test on revalidate
- test-continue bubble -> outer wizard defers -> lands on activate on revalidate
- activate onDone -> activated -> returns to overview
- remove-domain side-effect order: updateConnection -> domain.delete() -> revalidate
- changeProvider failure error isolation (symmetric partner of the create-failure path)
…panel The Security panel was wired into the shell but had no swingset story, so it never appeared in the component explorer. Add one (Panels archetype): it instantiates the panel's overview/wizard/step machines with delay-mocked async deps and renders OrganizationProfileSecurityPanelView, mirroring the controller's bubble/exit forwarding so the wizard is navigable. Also surface it in the OrganizationProfile AIO story's security slot. The security view reuses ConfigureSSO from @clerk/ui source via its internal `@/` alias, so swingset resolves the `@/components/ConfigureSSO` subtree to the ui source (webpack + tsconfig), distinct from swingset's own `@/components/ui`.
Summary
Migrates the OrganizationProfile Security panel (Enterprise SSO) from the legacy styled-system components (
components/OrganizationProfile/SecuritySsoSection+components/ConfigureSSO/*) into the Mosaicmachine → controller → viewarchitecture. Legacy code is left untouched; the Mosaic panel is additive and self-gating.The hard constraint for this migration is exact 1:1 behavioral parity with the legacy implementation.
Status: in progress (draft)
Building incrementally. This PR will grow with follow-up commits.
verify-domain → configure → test → activate) with furthest-reachable initial seat,recheck()re-seat, and deferred-advance (pendingNext). Proven 1:1 against the legacy reducer by an equivalence test.eventFlowStepMountedmount telemetry.NEXT, absorbed by the outer wizard'spendingNext. Preserves the create/change revalidation-race deferral, the Google mid-flow vs Okta/Custom/Microsoft terminal submit asymmetry, forward-entry select-provider force, and the connection-deleted re-seat.armPollingdistinction — creating a run arms polling (refresh({ armPolling: true })), the manual "Refresh logs" refetch does not. Continue gates on the freshly-revalidated success probe, and the successful advance bubbles to the outer wizard (bubblingNext→ controller-forwardedNEXT).setConnectionActive(id, true)machine with the activate telemetry fired on success (withconnectionStatus: 'active', matching legacy), the active-vs-not-active copy derived from the live entity, and Skip / Done exits that return to the overview.armPollingdistinction, the configure→test / test→activate / activate→overview bubble seams, the remove-domain side-effect order (updateConnection → domain.delete() → revalidate), andchangeProviderfailure error isolation. Everything else was view-only (approved deviation), architecturally superseded, or a cross-file false positive.All four wizard steps now render their own Mosaic views; configure / test / activate own their in-step navigation, verify-domain uses the shell nav.
Testing
pnpm --filter @clerk/ui test security→ 173 tests passing across machine / controller / view / equivalence layers.createActor, view via fake snapshot +send, controller via mocked@clerk/shared/react).Documented micro-differences (cosmetic; functionality identical, flagged for the parity audit)
creatingspinner.Changeset
Empty — these Mosaic components are not yet publicly exported, matching the precedent set by the other mosaic-migration changesets (no user-facing change).