Skip to content

Use organization slugs in Console handoffs - #1101

Merged
softmarshmallow merged 2 commits into
mainfrom
chore/console-organization-slugs
Oct 12, 2026
Merged

softmarshmallow merged 2 commits into
mainfrom
chore/console-organization-slugs

Conversation

@softmarshmallow

@softmarshmallow softmarshmallow commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Console billing and management handoffs now use the organization's current unique name in /organizations/{slug}/... URLs. Permanent organization IDs remain the service API and authorization identity; management pages and form returns recheck that the locator belongs to the same current member/owner-authorized organization.

Numeric-only names remain valid slugs, without numeric-ID fallback or old-name redirects. No database migration, auth-provider change, billing policy or AI execution change.

Validation: all 480 Platform consumer tests pass, editor typecheck passes, formatting/lint hooks pass, and the real production-mode API pipeline passes all 386 HTTP cases. Its isolated build inventory includes the destination module consumed by the billing adapter. Coverage includes current billing/upgrade/purchase links, shared destination grammar and mismatched slug/ID rejection before mutation.

@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 26bb1e79-018e-4a73-b387-7ea87b91e2d4

📥 Commits

Reviewing files that changed from the base of the PR and between 0ef0cdf and 330c06e.


📒 Files selected for processing (13)
  • editor/app/(api)/private/accounts/organizations/[org]/profile/route.ts
  • editor/app/(api)/private/accounts/organizations/new/route.ts
  • editor/app/(site)/gateway/manage/page.tsx
  • editor/lib/platform/README.md
  • editor/lib/platform/__fixtures__/console-destinations.json
  • editor/lib/platform/billing-consumer.test.ts
  • editor/lib/platform/billing-consumer.ts
  • editor/lib/platform/billing-handoff.test.ts
  • editor/lib/platform/billing-handoff.ts
  • editor/lib/platform/console-destination.ts
  • editor/lib/platform/console-manage.test.ts
  • editor/lib/platform/console-manage.ts
  • scripts/api-local/proof.mjs

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.



Walkthrough

Console organization routes and billing destinations now use validated organization-name slugs, while numeric IDs remain in use for authorization and service operations. Management flows compare requested path slugs with resolved organization names. Organization creation resolves the route name before setting organization context.

Changes

Organization slug handoff

Layer / File(s) Summary
Organization slug route contract
editor/lib/platform/console-destination.ts, editor/lib/platform/__fixtures__/console-destinations.json, editor/lib/platform/README.md, scripts/api-local/proof.mjs
Organization routes now validate lowercase slugs, including numeric-looking names. Fixtures and documentation describe the slug format and the use of numeric IDs for authorization and service APIs. The proof workspace includes the route validator.
Billing URL slug generation
editor/lib/platform/billing-consumer.ts, editor/lib/platform/billing-handoff.ts, editor/lib/platform/billing-consumer.test.ts, editor/lib/platform/billing-handoff.test.ts
Billing URL builders validate and use organization slugs. Billing handoff passes the organization name, and tests expect slug-based console paths.
Management organization and slug validation
editor/lib/platform/console-manage.ts, editor/lib/platform/console-manage.test.ts, editor/app/(api)/private/accounts/organizations/[org]/profile/route.ts, editor/app/(api)/private/accounts/organizations/new/route.ts, editor/app/(site)/gateway/manage/page.tsx
Management input takes its organization ID from the supplied field. Management routes validate the return-path slug against the organization name, and organization creation resolves the route name before setting context. Tests cover mismatched slugs.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant ProfileRoute
  participant ManagePage
  participant currentConsoleOrganization
  participant read
  ProfileRoute->>currentConsoleOrganization: organization ID and return-path slug
  ManagePage->>currentConsoleOrganization: organization ID and return-path slug
  currentConsoleOrganization->>read: read organization by ID
  read-->>currentConsoleOrganization: organization record and name
  currentConsoleOrganization-->>ProfileRoute: accept or reject slug match
  currentConsoleOrganization-->>ManagePage: accept or reject slug match
Loading

Merge Risk: ⚪ Minimal · up to 330c0

No confirmed issue blocks the slug-based Console handoffs.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 11 files. (2 skipped: 2… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly and concisely describes the main change: Console handoffs now use organization slugs.
Description check Passed The description directly explains the slug-based Console billing and management handoff changes, authorization behavior, validation rules, and test coverage.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 11 files. (2 skipped: 2 unsupported.)


  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@softmarshmallow
softmarshmallow merged commit a21a96f into main Oct 12, 2026
41 checks passed
@vercel

vercel Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
api Ready Ready Preview Oct 12, 2026 7:25pm UTC
6 Skipped Deployments
Project Deployment Actions Updated
backgrounds Ignored Ignored Oct 12, 2026 7:25pm UTC
blog Ignored Ignored Oct 12, 2026 7:25pm UTC
code Ignored Ignored Oct 12, 2026 7:25pm UTC
docs Ignored Ignored Oct 12, 2026 7:25pm UTC
grida Ignored Ignored Preview Oct 12, 2026 7:25pm UTC
viewer Ignored Ignored Oct 12, 2026 7:25pm UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview – api — 330c06ea Deployed Oct 12, 2026 by vercel[bot]
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