Skip to content

refactor(cli): split cloud organizations into a module directory (#1157) - #1172

Open
sdairs wants to merge 4 commits into
claude/1157-split-cloud-postgresfrom
claude/1157-split-cloud-organizations
Open

sdairs wants to merge 4 commits into
claude/1157-split-cloud-postgresfrom
claude/1157-split-cloud-organizations

Conversation

@sdairs

@sdairs sdairs commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Part of #1157 (3 of 5: organizations). Stacked on #1170.

Summary

This splits src/cloud/organizations.rs into src/cloud/organizations/. The seams follow the three top-level commands it dispatches (org, member, invitation). Behaviour is unchanged.

File Lines (tests) Contents
mod.rs 329 PERMISSIONS, run_* dispatch, re-exports
cli.rs 1723 (29) clap definitions, is_write
client.rs 471 impl CloudClient
org.rs 677 (7) list, get, update, quota, balance, notifications, prometheus, usage
byoc.rs 703 (10) BYOC commands and builders
roles.rs 264 (2)
members.rs 281 (5) members and invitations, which share join_absent

Commits

  1. Pure git mv, 100% rename.

  2. Moves only. The multiset check is clean: the only differences are mod/use lines, test-module wrappers, and six rustfmt signature rewraps after pub(super) was added.

  3. .git-blame-ignore-revs entry. The SHA needs updating on rebase.

  4. Follow-ups from the stack review (Route Cloud Postgres handlers through CloudClient wrappers #1156, kept here so the split SHAs below don't change):

    • Stronger "service exists → original 400 stands" test.
    • New tests for a confirming GET that fails with 500 or 403: the original error is kept.
    • A stale path comment in services/query_key.rs is fixed.

Tests

  • Counts match before and after: 2419 passed, 7 ignored. Test names match once module paths are normalised.
  • fmt, both clippy configurations, the --no-default-features check, the Python classifier tests and git diff --check all pass.
  • cargo doc warnings are unchanged from the base branch.

Remaining for #1157

clickpipes and clickstack wait until the open drift stack (#1149–#1152) merges, because it edits both files.

Merge with a merge commit, not a squash. The .git-blame-ignore-revs entry names this PR's move commit. A squash merge would leave it pointing at a commit that isn't on main, and git would silently ignore it.

🤖 Generated with Claude Code


Note

Low Risk
Mechanical file split with no intended runtime or API changes; only comment and blame-metadata updates outside the move.

Overview
Replaces the monolithic cloud/organizations.rs with a cloud/organizations/ directory, grouped by command family (cli, client, org, byoc, roles, members) with mod.rs holding PERMISSIONS and the run_org / run_member / run_invitation dispatch. Public CLI surface and behavior stay the same; code is mostly moved and visibility adjusted (pub(super)), with tests split across the new modules.

Also adds a .git-blame-ignore-revs entry for the split commit and updates a stale comment in services/query_key.rs to reference services/query.rs instead of services.rs.

Reviewed by Cursor Bugbot for commit 5a63f7d. Bugbot is set up for automated code reviews on this repo. Configure here.

@sdairs
sdairs requested a review from iskakaushik as a code owner October 30, 2026 14:57
sdairs and others added 4 commits October 30, 2026 16:39
Move `cloud/organizations.rs` to `cloud/organizations/mod.rs` unchanged,
so blame follows the file into the new layout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#1157)

Move the `org`, `member` and `invitation` command code out of
`cloud/organizations/mod.rs` into one file per command family, each with
the tests for its code:

- `cli.rs`: clap definitions, write classification and parse tests
- `client.rs`: `CloudClient` wrappers, in one `impl` block
- `org.rs`: org list, get, update, quota, balance, notifications,
  notification types, prometheus and usage, with the private endpoint
  removal parser
- `byoc.rs`: `org byoc` and its request builders
- `roles.rs`: `org role` and its request builders
- `members.rs`: `member` and `invitation`

`mod.rs` keeps `PERMISSIONS`, the `run_*` dispatch and re-exports of the
command enums. Only visibility and imports change; no behaviour change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…1156)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sdairs
sdairs force-pushed the claude/1157-split-cloud-organizations branch from b2e9464 to 5a63f7d Compare October 30, 2026 17:27
@sdairs
sdairs added this pull request to stack #1153 October 30, 2026 17:28

This branch has not been deployed

No deployments
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