fix: resolve env list from active branch#65
Conversation
|
Warning Review limit reached
More reviews will be available in 24 minutes and 1 second. 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 (10)
✨ 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 |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Overview
This changes
project env listso an unscoped read reflects the caller's current workstream instead of silently showing production. It keeps writes explicit, but makes read output clear about which env map was resolved and why.Changes
packages/cli/src/lib/git/local-branch.tsextracts local Git branch detection from app deploy and is reused bypackages/cli/src/controllers/app.tsandpackages/cli/src/controllers/app-env.ts.runEnvListnow has a list-only target resolver. Explicit--roleand--branchpaths stay unchanged; no flags with a local Git branch resolve the matching Platform Branch role; missing Platform Branches show preview template metadata; no Git branch shows a production/preview project-level overview.packages/cli/src/types/app-env.tsandpackages/cli/src/presenters/app-env.tsadd resolved target metadata so human and JSON output can explain the inferred branch, branch role, env map, and missing-branch state.Why
A default production read is too easy to misinterpret when the user is checked out on a feature branch. Resolving from local Git matches the Branch model users already carry in their head, while the no-Git overview avoids pretending there is a single safe target. The implementation uses Branch
roleas the platform truth and does not couple it toisDefault; production-branch mutation remains out of scope.