Skip to content

fix(project): Polish project show output#56

Merged
luanvdw merged 1 commit into
mainfrom
feat/project-show-polish
Jun 1, 2026
Merged

fix(project): Polish project show output#56
luanvdw merged 1 commit into
mainfrom
feat/project-show-polish

Conversation

@luanvdw
Copy link
Copy Markdown
Member

@luanvdw luanvdw commented Jun 1, 2026

Summary

  • polish bound project show human output to show the local repo, platform project label, and project URL
  • carry optional project URLs through project summary/candidate data, fixtures, mock API data, and real-mode project loading
  • update CLI output docs and add regression coverage for the new bound rendering

Why

The previous bound output exposed the internal resolution source (local pin), split workspace/project across separate rows, omitted the local directory side of the binding, and did not give the user a URL/action at the end.

Validation

  • Ran local thermonuclear PR review: pass, no structural findings
  • pnpm --filter @prisma/cli exec vitest run tests/project.test.ts tests/project-real-mode.test.ts tests/project-controller.test.ts
  • pnpm test
  • pnpm build:cli
  • git diff --check

Notes

The exact planned pnpm --filter @prisma/cli test -- --run ... shape was interpreted as a broader Vitest run and hit the sandbox localhost restriction in an unrelated auth test. The equivalent targeted Vitest command above passed, and the full suite passed with network/sandbox escalation.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 1, 2026

Review Change Stack

Warning

Review limit reached

@luanvdw, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 34 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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: d0dcfbc4-b896-412d-a161-4a00587fc39e

📥 Commits

Reviewing files that changed from the base of the PR and between b6b62ed and 84b6ca7.

📒 Files selected for processing (14)
  • docs/product/cli-style-guide.md
  • docs/product/command-spec.md
  • docs/product/output-conventions.md
  • packages/cli/fixtures/mock-api.json
  • packages/cli/src/adapters/mock-api.ts
  • packages/cli/src/controllers/project.ts
  • packages/cli/src/lib/project/resolution.ts
  • packages/cli/src/lib/project/setup.ts
  • packages/cli/src/presenters/project.ts
  • packages/cli/src/types/project.ts
  • packages/cli/src/use-cases/project.ts
  • packages/cli/tests/project-real-mode.test.ts
  • packages/cli/tests/project-usecases.test.ts
  • packages/cli/tests/project.test.ts

Walkthrough

This PR adds an optional url field to project objects and refactors the project show command display. Projects now carry a URL from the Management API, which flows through controllers and summary functions to presenters. The bound project display now shows a formatted local repo path (abbreviated with ~ when under HOME), the platform project label, and renders the resolved Project URL as a link. Documentation and tests reflect these changes.

Changes

Project URL field and bound project display

Layer / File(s) Summary
Type contracts: ProjectSummary and ProjectRecord
packages/cli/src/types/project.ts, packages/cli/src/adapters/mock-api.ts
ProjectSummary interface and ProjectRecord type gain optional url?: string field.
Data flow: controllers and summary functions propagate url
packages/cli/src/controllers/project.ts, packages/cli/src/lib/project/resolution.ts, packages/cli/src/lib/project/setup.ts, packages/cli/src/use-cases/project.ts
listRealWorkspaceProjects, listFixtureWorkspaceProjects, and three toProjectSummary implementations conditionally include url when available.
Fixture data: mock-api.json with project URLs
packages/cli/fixtures/mock-api.json
Mock API projects (proj_123, proj_456, proj_789) gain url property pointing to https://prisma.build/... paths.
Presenter: bound project display with formatted path and URL
packages/cli/src/presenters/project.ts
renderProjectShow delegates linked-project case to new renderBoundProjectShow helper; formatLocalRepoPath abbreviates filesystem paths using HOME; imports updated for node:path and padDisplay UI helper.
Test fixtures and helpers: url field in project data
packages/cli/tests/project.test.ts
Fixtures for ambiguous, apple, and Edith/orange projects include url; mocked /v1/projects response adds url fields; login helper accepts custom env and fixture path.
Test assertions: verify url propagation and display
packages/cli/tests/project-real-mode.test.ts, packages/cli/tests/project-usecases.test.ts, packages/cli/tests/project.test.ts
Assertions for list and show operations expect url field; new human-mode test verifies formatted bound project output with home-relative path and resolved platform URL.
Documentation: CLI style guide, spec, and output conventions
docs/product/cli-style-guide.md, docs/product/command-spec.md, docs/product/output-conventions.md
Examples and specifications updated to show bound project display (local repo, workspace/project label, Project URL); rule added to hide internal resolution terms from human output.

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

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.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description is directly related to the changeset, detailing the polished output, the data structure changes needed to support URLs, documentation updates, and test coverage additions. It provides context for why the changes were made.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title accurately summarizes the main change: polishing the project show output by improving how bound projects are displayed with local repo path, platform label, and project URL.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/project-show-polish
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feat/project-show-polish

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.

❤️ Share

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

@luanvdw luanvdw changed the title Polish project show output [codex] Polish project show output Jun 1, 2026
@luanvdw luanvdw marked this pull request as ready for review June 1, 2026 09:10
@luanvdw luanvdw force-pushed the feat/project-show-polish branch from b6b62ed to 84b6ca7 Compare June 1, 2026 09:33
@luanvdw luanvdw marked this pull request as draft June 1, 2026 09:34
@luanvdw luanvdw changed the title [codex] Polish project show output fix(project): Polish project show output Jun 1, 2026
@luanvdw luanvdw marked this pull request as ready for review June 1, 2026 09:35
@luanvdw luanvdw merged commit c573c86 into main Jun 1, 2026
5 checks passed
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