feat: list platform branch roles#64
Conversation
|
Warning Review limit reached
More reviews will be available in 18 minutes and 19 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (6)
WalkthroughThis PR removes the ChangesBranch Command Simplification and Role-Based Metadata System
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/product/command-spec.md`:
- Around line 541-543: Clarify that the "resolved env map" shown is the
role-derived default template, not branch-specific overrides: update the
description text that currently says "shows each branch's name, role, and
resolved env map" to explicitly state that envMap is derived from the branch's
role (role -> envMap) and represents the default environment template for that
role, and also adjust/remove the ambiguous sentence about "does not expose ...
env override annotations yet" so it reads that branch-specific env overrides are
not included in this view; reference symbols: envMap, role, branch.
In `@packages/cli/src/controllers/branch.ts`:
- Around line 68-72: The returned branches are using the raw API order; call the
existing sortBranches function on branches before mapping to toBranchSummary so
production branches and then name-sorted order is applied in real mode as well.
Locate where branches are referenced in the return object (the branches variable
used with toBranchSummary) and replace branches.map(toBranchSummary) with a
mapping over sortBranches(branches) (i.e., compute sorted =
sortBranches(branches) then map sorted with toBranchSummary) so both
fixture/use-case and real modes share the same deterministic ordering.
In `@packages/cli/src/shell/command-meta.ts`:
- Around line 69-72: Update the branch command help to remove the word “active”
from its description(s): locate the command meta entry with id "branch" and path
["prisma","branch"] and change the description value from "View your active
Platform branches" to something like "View your Platform branches"; also update
the other occurrence of the same help text (the second description around the
same id/command) so both descriptions no longer assert the filter. Ensure
examples and other fields stay unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 29ba5e3d-3bbb-4779-b86f-8730aa09440f
📒 Files selected for processing (19)
docs/product/command-principles.mddocs/product/command-spec.mddocs/product/output-conventions.mddocs/product/resource-model.mdpackages/cli/README.mdpackages/cli/fixtures/mock-api.jsonpackages/cli/src/adapters/mock-api.tspackages/cli/src/commands/branch/index.tspackages/cli/src/controllers/branch.tspackages/cli/src/presenters/branch.tspackages/cli/src/shell/command-meta.tspackages/cli/src/types/branch.tspackages/cli/src/use-cases/branch.tspackages/cli/src/use-cases/contracts.tspackages/cli/src/use-cases/create-cli-gateways.tspackages/cli/tests/branch-controller.test.tspackages/cli/tests/branch-usecases.test.tspackages/cli/tests/branch.test.tspackages/cli/tests/use-case-helpers.ts
💤 Files with no reviewable changes (1)
- docs/product/output-conventions.md
Overview
This makes branch inspection real while keeping the branch command surface intentionally small. Reviewers should read this as an inspect-only slice: users and agents can see Platform branches and roles, but this does not add branch mutation or local branch-context switching.
Changes
packages/cli/src/commands/branch/index.tsandpackages/cli/src/shell/command-meta.tsnow register onlybranch list, so help output no longer advertises placeholder commands.packages/cli/src/controllers/branch.tsresolves auth and project context, then paginatesGET /v1/projects/{projectId}/branchesso the command lists the full remote branch set.packages/cli/src/types/branch.ts,packages/cli/src/presenters/branch.ts, andpackages/cli/src/use-cases/branch.tscollapse the old local-context shape into the direct list contract:projectId,projectName, and branch rows withid,name,role, andenvMap.Why
Starting with inspection avoids committing to a production-branch mutation contract before that workflow is designed.
envMapis derived directly from branchrole, which keeps this command cheap and avoids extra env-var API calls for override annotations that the API does not support yet. Removingshowandusealso avoids a misleading local-context model while Branch remains a platform-backed primitive.