Skip to content

Add plugin-specific login completion guidance - #281

Merged
luanvdw merged 1 commit into
mainfrom
feat/plugin-auth-ui-context
Sep 24, 2026
Merged

luanvdw merged 1 commit into
mainfrom
feat/plugin-auth-ui-context

Conversation

@luanvdw

@luanvdw luanvdw commented Sep 24, 2026

Copy link
Copy Markdown
Member

Overview

Prisma plugin users complete sign-in in a browser, then continue in ChatGPT. The current completion page sends them to a terminal and asks them to install skills they already have.

Changes

  • Add optional auth login --ui-context prisma-plugin, validated before login starts and passed through the login operation to both callback rendering paths.
  • Select ChatGPT return guidance for success and failure and omit the skills-install card and script only when explicitly marked. Context is never inferred or stored; ordinary completion HTML remains byte-for-byte identical.
  • Document the presentation contract and extend authentication tests for propagation, argument validation, credential isolation, conditional rendering, cancellation, and a failed browser launch followed by completion on the same pending listener.

Why

This is an invocation-local presentation choice. Keeping OAuth, scopes, consent, callback validation, session storage, and terminal output unchanged limits the change to the plugin handoff. The plugin will use a verified, exact published CLI version after this ships; no installed-package patch or floating dependency is needed.

Verification

  • pnpm typecheck and pnpm lint passed.
  • pnpm --filter @prisma/cli test: 1,019 passed, 2 skipped.
  • pnpm --filter @prisma/cli test:e2e: 7 local checks passed, 48 cloud tests skipped without isolated credentials; interactive login is already excluded from real-API automation.
  • Built the prisma wrapper and checked the shipped login help. Compared unmarked completion HTML with main for known, missing, and escaped workspace names: identical.
  • Tested on macOS with Node 24.16.0 and pnpm 11.6.0. Fresh human signup, a published-version install, and live deployment acceptance remain pending; the tests above do not claim those results.

@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Essentials

Run ID: 0fdb05b0-09ec-49be-aded-06f1dc6e96d0

📥 Commits

Reviewing files that changed from the base of the PR and between 6a34270 and b50b587.

📒 Files selected for processing (7)
  • docs/product/output-conventions.md
  • packages/cli/src/auth/login.ts
  • packages/cli/src/auth/operations.ts
  • packages/cli/src/commands/auth/login.ts
  • packages/cli/tests/auth-login.test.ts
  • packages/cli/tests/auth-ops.test.ts
  • packages/cli/tests/auth.test.ts

Included review availability: 4 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


Summary by CodeRabbit

  • New Features
    • Added the optional --ui-context prisma-plugin flag to auth login. Plugin-initiated logins now show browser guidance tailored to the conversation and omit terminal-oriented setup instructions. Without the flag, existing terminal guidance remains unchanged.
    • Unsupported or missing --ui-context values are rejected before login begins.

Walkthrough

The auth login command adds an optional --ui-context prisma-plugin flag and forwards its value through the login operations. In this context, browser success and failure pages show conversation-directed guidance. The success page omits the skills-install section and copy script. Without the flag, existing terminal-oriented page content remains. Tests cover flag validation, context forwarding, callback handling, and page content.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to b50b5

The plugin login guidance is ready to merge after normal checks; non-interactive environments continue to use service tokens.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 6 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding login completion guidance specific to the plugin context.
Description check ✅ Passed The description directly explains the plugin-specific login context, conditional completion guidance, validation, testing, and documentation changes.
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 6 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
✨ Simplify code
  • Commit to this branch
  • Create a new PR

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

@pkg-pr-new

pkg-pr-new Bot commented Sep 24, 2026

Copy link
Copy Markdown

Open in StackBlitz

npx https://pkg.pr.new/@prisma/cli@281
npx https://pkg.pr.new/@prisma/cli-engine@281

commit: b50b587

@luanvdw
luanvdw marked this pull request as ready for review September 24, 2026 02:57
@luanvdw

luanvdw commented Sep 24, 2026

Copy link
Copy Markdown
Member Author

Reviewed CodeRabbit’s approval of b50b587. There are no inline findings or actionable code comments to resolve. The docstring-coverage warning is advisory; the new presentation option is documented in its type, command help, and product contract, and behavior is covered by authentication tests. Adding boilerplate to existing callbacks and test helpers would not improve this focused change. All CI checks, including CodeRabbit, are green on the reviewed commit.

@luanvdw
luanvdw merged commit 12c9663 into main Sep 24, 2026
16 checks passed
@luanvdw
luanvdw deleted the feat/plugin-auth-ui-context branch September 24, 2026 03:02
wmadden pushed a commit that referenced this pull request Sep 24, 2026
## Overview
Prepare the coordinated CLI release from `8.0.0-rc.15` to `8.0.0-rc.16`.
Main now includes the reviewed and merged plugin login guidance in #281,
along with the other changes accumulated since the previous release.

**Leave this PR unmerged until the team has reviewed and tested the
release. Merging it triggers publication under `latest`; auto-merge is
not enabled.**

## Changes
- Run the repository’s version-bump script to advance lockstep manifests
and internal workspace references, with the matching lockfile and
bundled platform-skill version stamp.
- Preserve the independently versioned engine and Compute packages and
all existing external product pins. No product implementation or
authentication changes are introduced by this release diff.

## Why
A dedicated release PR gives maintainers a single coordination point
before publication, following the [versioning
procedure](https://github.com/prisma/prisma-cli/blob/main/docs/oss/versioning.md).
The desktop Prisma plugin still waits for an exact published CLI version
and fresh-user acceptance before activating its new onboarding.

## Validation and coordination
- Passed: frozen installation, build, typecheck, lint, 80
versioning/script tests, skill packaging, CLI tests (1,019 passed; 2
skipped), and wrapper tests (3 passed).
- Release conformance passed: **0 failing, 6 allowed findings** across
both installed binaries. The allowed findings are main’s existing
transition from engine `0.4.0` to `0.6.0`: Composer CLI and ORM
toolchain still peer `0.4.0`, and the installed trees contain both
versions. The existing exceptions require follow-up family releases
peering `0.6.0`; this PR does not add or widen those exceptions.
- **Local macOS test issue:** the full workspace test run fails
`packages/cli-engine/tests/clack-prompts.test.ts` → `consent with a
token: a wrong answer re-prompts instead of failing` at the 5,000 ms
timeout. The same focused test fails before the bump at `b50b587`, so
this is not introduced by the version diff. Reproduce with `pnpm
--filter @prisma/cli-engine exec vitest run tests/clack-prompts.test.ts`
(Node 24.16.0, pnpm 11.6.0, macOS). Other executed engine tests passed;
the release still needs team review of this result.
- #281 had green CI and CodeRabbit approval before merge. Fresh desktop
signup and live plugin deployment on the published version remain
pending; those are not claimed by these checks.
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