Skip to content

fix(orgs): enable organization creation defaults with --auto-create#390

Merged
rafa-thayto merged 1 commit into
mainfrom
manovotny/lucid-poincare-4bb157
Jul 23, 2026
Merged

fix(orgs): enable organization creation defaults with --auto-create#390
rafa-thayto merged 1 commit into
mainfrom
manovotny/lucid-poincare-4bb157

Conversation

@manovotny

@manovotny manovotny commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Found while reviewing clerk/clerk#2961, where the docs work around it by telling agents to patch the parent flag manually.

clerk enable orgs --auto-create patched only organization_creation_defaults.automatic_organization_creation.enabled. The API gates auto-creation on the umbrella organization_creation_defaults.enabled too, so on instances where creation defaults were never enabled the command succeeded — and no organization was ever auto-created.

Perhaps it's this way for some reason, but it tripped me up when verifying the docs contribution.

Changes

  • --auto-create now sends both flags in one patch.
  • Sending both together is safe: the API's enable transition seeds defaults only for sub-settings not in the request, so the explicit auto-create value wins and the remaining sub-settings get the same seeds the Dashboard flow produces. Re-sending enabled: true on an already-enabled instance is a no-op, so the command stays idempotent.
  • Payload test now asserts both flags, and the command README documents the behavior.

References

  • clerk/clerk#2961

🤖 Generated with Claude Code

The API only auto-creates organizations when both
organization_creation_defaults.enabled and the nested
automatic_organization_creation.enabled are true. The --auto-create flag
previously patched only the nested flag, so on instances where the
umbrella setting was never enabled the command succeeded silently but no
organization was ever auto-created.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e1f9753

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
clerk Patch

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

@manovotny
manovotny marked this pull request as ready for review July 23, 2026 19:35
@manovotny manovotny changed the title fix(orgs): enable organization creation defaults with --auto-create fix(orgs): enable organization creation defaults with --auto-create Jul 23, 2026
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3af2968d-40e5-4227-8089-3056ed2e5a47

📥 Commits

Reviewing files that changed from the base of the PR and between bb5b961 and e1f9753.

📒 Files selected for processing (4)
  • .changeset/orgs-auto-create-creation-defaults.md
  • packages/cli-core/src/commands/orgs/README.md
  • packages/cli-core/src/commands/orgs/index.test.ts
  • packages/cli-core/src/commands/orgs/index.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • clerk/clerk_go (manual)
  • clerk/dashboard (manual)
  • clerk/accounts (manual)
  • clerk/backoffice (manual)
  • clerk/clerk (manual)
  • clerk/clerk-docs (manual)
  • clerk/cloudflare-workers (manual)

📝 Walkthrough

Walkthrough

Updated the organization auto-creation documentation and release note to describe the required umbrella and nested defaults. Expanded implementation comments to explain the API requirement and no-op behavior. Updated the enable command test to verify both organization_creation_defaults.enabled and automatic_organization_creation.enabled are set to true.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: wyattjoh

🚥 Pre-merge checks | ✅ 4 | ❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: --auto-create now enables organization creation defaults.
Description check ✅ Passed The description accurately describes the command, API behavior, tests, and README updates in this PR.
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.

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

@rafa-thayto rafa-thayto left a comment

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.

nice!

@rafa-thayto
rafa-thayto merged commit 7fb79a6 into main Jul 23, 2026
10 checks passed
@rafa-thayto
rafa-thayto deleted the manovotny/lucid-poincare-4bb157 branch July 23, 2026 20:08
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.

2 participants