Skip to content

fix: organization creation#113

Merged
Dav-14 merged 1 commit intomainfrom
fix/organization_creation
Feb 6, 2026
Merged

fix: organization creation#113
Dav-14 merged 1 commit intomainfrom
fix/organization_creation

Conversation

@Dav-14
Copy link
Contributor

@Dav-14 Dav-14 commented Feb 6, 2026

No description provided.

@Dav-14 Dav-14 requested a review from a team as a code owner February 6, 2026 12:48
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 6, 2026

Walkthrough

The changes refactor membership client construction across the organization commands, replacing previous constructors with new ones that adjust return value handling. Additionally, error handling in the deployment process is modified to defer error reporting from the completion-wait phase to the render phase, with log rendering behavior adjusted accordingly.

Changes

Cohort / File(s) Summary
Membership Client Constructor
cmd/cloud/organizations/create.go
Replaced NewMembershipClientForOrganizationFromFlags(...) returning three values with NewMembershipClient(...) returning two values (apiClient, error), updating the call site to handle the new return signature.
Command Constructor Updates
cmd/cloud/organizations/invitations/root.go, cmd/cloud/organizations/root.go
Updated command initialization: replaced NewStackCommand with NewMembershipCommand in invitations/root.go and NewStackCommand with NewCommand in root.go, maintaining existing command configuration.
Deployment Error Handling
cmd/cloud/apps/deploy.go
Refactored error-reporting flow: when "errored" status is encountered in waitRunCompletion, the function now stores logs and returns nil instead of immediately returning an error; error reporting is deferred to the Render phase, which surfaces the deployment-failed error after rendering logs if available.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A rabbit hops through code so grand,
Where constructors dance hand in hand,
Errors defer with grace and care,
From wait to render, floating air,
The commands unite, API's refined! ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
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.
Description check ❓ Inconclusive No pull request description was provided by the author, making it impossible to evaluate whether it relates to the changeset. Add a description explaining the changes, such as what the membership client refactoring fixes and why the error handling was adjusted.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: organization creation' directly addresses the main change: fixing organization creation logic by updating the membership client constructor call in the create.go file.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/organization_creation

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

@Dav-14 Dav-14 force-pushed the fix/organization_creation branch from c5dd351 to 2aca477 Compare February 6, 2026 12:50
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
cmd/cloud/apps/deploy.go (1)

182-189: ⚠️ Potential issue | 🟡 Minor

waitRunCompletion is invoked twice when --wait=true.

Run() calls waitRunCompletion at line 90 when the --wait flag is true, then Render() calls it again at line 187 under the same condition. This causes unnecessary API polling on success (re-polling a deployment that has already reached terminal state). On error, the second call overwrites c.store.Run and c.store.logs, making the early error check at line 173 ineffective since it inspects state that will be overwritten by the second wait.

@Dav-14 Dav-14 merged commit 6e0ceac into main Feb 6, 2026
4 checks passed
@Dav-14 Dav-14 deleted the fix/organization_creation branch February 6, 2026 13:45
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