Skip to content

Conversation

@ankur-arch
Copy link
Contributor

@ankur-arch ankur-arch commented Aug 13, 2025

Summary by CodeRabbit

  • Documentation
    • Updated token creation instructions to use Settings → Service Tokens, streamlining steps.
    • Revised Management API docs to reflect the new token retrieval flow; bearer usage examples unchanged.
    • Expanded GitHub Actions guide with CI-focused setup: recommends a dedicated Prisma Postgres project for CI, provides an example command to create it, and guidance on capturing the project ID and configuring environment variables.
    • Clarified workflow to keep CI projects separate from development and updated references accordingly.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 13, 2025

Walkthrough

Updated documentation to reflect a new UI path for creating Prisma Postgres service tokens (now via Settings → Service Tokens) and revised the GitHub Actions guide to include creating a dedicated CI project via the Management API, updating steps and examples accordingly.

Changes

Cohort / File(s) Summary of changes
Management API token flow update
content/250-postgres/100-introduction/230-management-api.mdx
Replaced token creation steps from Integrations flow to Settings → Service Tokens. Removed token name entry and “Create service token” steps; adjusted numbering. No changes to Bearer token usage/examples.
GitHub Actions guide updates
content/800-guides/330-github-actions.mdx
Updated token retrieval path to Settings → Service Tokens. Added CI-focused setup: instructions and curl example to create a dedicated Prisma Postgres project via Management API, noting region, variables, and capturing project ID. Adjusted references to use the new project.

Sequence Diagram(s)

sequenceDiagram
  participant Dev as Developer
  participant Console as Prisma Console
  participant CI as CI Workflow
  participant API as Management API

  Dev->>Console: Navigate Settings → Service Tokens
  Console-->>Dev: Generate & copy service token
  CI->>API: Create project (POST /projects) using service token
  API-->>CI: Return project ID
  CI->>API: Use project ID in subsequent CI steps
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • nikolasburk
  • mhessdev
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch DC-4796

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link
Contributor

Dangerous URL check

No absolute URLs to prisma.io/docs found.
No local URLs found.

@ankur-arch ankur-arch changed the title fix: add new steps fix: add new service token steps Aug 13, 2025
@github-actions
Copy link
Contributor

Redirect check

This PR probably requires the following redirects to be added to static/_redirects:

  • This PR does not change any pages in a way that would require a redirect.

@cloudflare-workers-and-pages
Copy link

Deploying docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: e65d07a
Status: ✅  Deploy successful!
Preview URL: https://b27d4da9.docs-51g.pages.dev
Branch Preview URL: https://dc-4796.docs-51g.pages.dev

View logs

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (4)
content/250-postgres/100-introduction/230-management-api.mdx (1)

57-59: UI path update for Service Tokens looks correct; add a brief security note

The new Settings → Service Tokens flow matches the current Console. Consider adding a one-line caution about token visibility and secure storage to reduce accidental leaks.

Proposed addition right after Step 5:

 4. Copy the generated token and store it in a safe location for future use. 
+:::caution
+Service tokens are shown only once. Store them in a secure secret manager (e.g., GitHub Actions secrets) and avoid committing them to source control or .env files.
+:::
content/800-guides/330-github-actions.mdx (3)

517-520: Service token retrieval flow updated correctly; avoid encouraging .env for long-lived tokens

The Settings → Service Tokens UI path is accurate. For CI, advise readers to skip storing tokens in local .env files (which can be accidentally committed) and add them directly as GitHub Secrets instead.

Suggested tweak:

-4. Copy the generated token and save it in your `.env` file as `PRISMA_POSTGRES_SERVICE_TOKEN`. This token is required for the next step's script and must also be added to your GitHub Actions secrets.
+4. Copy the generated token and add it to your GitHub Actions secrets as `PRISMA_POSTGRES_SERVICE_TOKEN`. If you need local testing, use a local secret manager or ensure your `.env` is excluded from version control.

525-531: Capture and persist the project ID programmatically to reduce errors

Good addition introducing a dedicated CI project. Suggest capturing the project ID with jq and writing it to a GitHub Secret in one flow to avoid manual copy/paste errors.

Example (for local setup with gh CLI installed):

# Create the project and capture the ID
PROJECT_JSON=$(curl -s -X POST https://api.prisma.io/v1/projects \
  -H "Authorization: Bearer $PRISMA_POSTGRES_SERVICE_TOKEN" \
  -H "Content-Type: application/json" \
  -d "{\"region\": \"us-east-1\", \"name\": \"$PROJECT_NAME\"}")

PRISMA_PROJECT_ID=$(echo "$PROJECT_JSON" | jq -r '.data.id')

# Optional: store as a repository secret
gh secret set PRISMA_PROJECT_ID -b"$PRISMA_PROJECT_ID"

If you prefer keeping region configurable, mention a REGION env:

REGION="${REGION:-us-east-1}"
# ... then use "$REGION" in the payload

543-559: Clarify how to extract the ID from the response

The sample response is helpful. Add a quick jq command so readers know exactly how to parse out the ID.

Add after the sample:

# Extract the project ID
echo "$RESPONSE" | jq -r '.data.id'
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 989c0e3 and e65d07a.

📒 Files selected for processing (2)
  • content/250-postgres/100-introduction/230-management-api.mdx (1 hunks)
  • content/800-guides/330-github-actions.mdx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: runner / linkspector
  • GitHub Check: Check internal links
  • GitHub Check: Lost Pixel

@ankur-arch ankur-arch merged commit 413b838 into main Aug 13, 2025
9 of 11 checks passed
@ankur-arch ankur-arch deleted the DC-4796 branch August 13, 2025 15:43
@coderabbitai coderabbitai bot mentioned this pull request Aug 18, 2025
jlecordier pushed a commit to jlecordier/docs-1 that referenced this pull request Sep 3, 2025
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.

2 participants