Repository navigation
feat(cli): polymorfa link and project use|list|current - #19
Conversation
|
@coderabbitai review |
|
Warning Review limit reached
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 36 minutes. View limit detailsLimit details: You’ve used the included review currently available. Your 89 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. The included review limit has been reached and this organization has disabled usage-based review continuation. Wait for reviews to reset or ask a billing admin to change After included review limits. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (3)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (4)
Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour. 📝 WalkthroughWalkthroughThe CLI adds project context management through directory links, profiles, credentials, and project commands. Commands resolve projects from explicit flags, linked directories, or profiles. Developer and listener environment resolution now accepts linked projects. ChangesProject context
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~45 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant CLI
participant ProjectContextService
participant project-link
participant EnvironmentResolver
CLI->>ProjectContextService: resolve project context
ProjectContextService->>project-link: discover linked project
ProjectContextService-->>CLI: return selected project
CLI->>EnvironmentResolver: pass linked project
EnvironmentResolver-->>CLI: resolve developer or listener environment
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 6.25% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 13 files. (2 skipped: 2 unsupported.) ✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Comment |
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
Reviewed locally because CodeRabbit is rate-limited (it answered Fixed:
Left unfixed:
|
|
Tip For best results, initiate chat on the files or code changes.
The explicit UUID path for The decision to commit 🐇 ✏️ Learnings added
You are interacting with an AI system. |
Directory links in .polymorfa/project.json and per-profile project context. Resolution order is --project, nearest link, then profile project; project-token profiles stay bound to their project.
polymorfa link resolved the principal before reading --project, so a POLYMORFA_PROJECT_TOKEN user hit an error telling them to pass --project even when they had. Accept an explicit UUID in that branch, and correct the design note to the shipped polymorfa.json contract.
|
@coderabbitai review |
f46e64b to
a854256
Compare
|
|
@coderabbitai full review |
|
readProjectLink accepted any non-empty string while writeProjectLink only ever stores a resolved UUID. polymorfa.json is hand-editable, so enforce the same shape at both boundaries with one shared validator.
|
Rebased onto One further fix:
Also checked the #18 interaction explicitly: the linked-project precedence added here feeds only Nothing left unfixed. (Note: |
|
Tip For best results, initiate chat on the files or code changes.
The shared The I also considered the existing project-link guidance: The review-limit result is understood. Your local review and added test cover the reported change. 🐇🔍 ✏️ Learnings added
🧠 Learnings usedYou are interacting with an AI system. |
Summary
Adds project linking and context switching.
polymorfa link [--project <uuid|slug>] [--force]writespolymorfa.json({"version":1,"project":"<uuid>"}) in the current directory. No credentials in the file; strict schema, so unknown keys are rejected.polymorfa project use <uuid|slug>stores the canonical project UUID on the active (or--profile) profile's metadata (owner: project,project).polymorfa project listlists the credential's projects and marks the current one;project currentreports the project and its source (flag,link,profile,none).--project> nearest link file (walks up parents) > profile project. Organization-owned commands ignore links.--verboseprints the link in use.listen --projectis now optional and falls back to the link or profile project.Keyring rules are unchanged: profile config holds metadata only, credentials stay in the OS keyring, and there is no plaintext fallback. Project-token profiles stay bound:
project userejects other projects, and developer commands fail closed when a directory link names a different project than the token's.No conflict with open PRs #10–#16 (none touch
src/context/environment.ts,src/base-command.tslink resolution, or project commands). #12 touchessrc/base-command.tsin the error path only.Five-part assessment
GETproject list viaClient.projects.list()for slug resolution. No contract change.Client.projects.listonly.link,project use|list|current,projecttopic, link-aware developer/QuickLink/listen resolution, README section, help text and examples.Verification
npm run verifypasses (format, lint, typecheck, tests, build, pack, audit).test/services/projects.test.ts(14): per-profile storage, no secret in config/link, token binding,--force, parent-directory discovery, precedence, env credentials hiding profile context, organization-owned bypass, token/link mismatch failing closed, listener fallback.test/commands/project-context.test.ts:link --project <slug>against a stub API andproject current.Summary by CodeRabbit
New Features
polymorfa.json, including optional forced replacement.Enhancements
listencommand no longer requires an explicit project when one can be resolved automatically.Documentation