-
Notifications
You must be signed in to change notification settings - Fork 856
fix: add new service token steps #7072
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughUpdated 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
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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
✨ Finishing Touches🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Dangerous URL checkNo absolute URLs to prisma.io/docs found. |
Redirect checkThis PR probably requires the following redirects to be added to static/_redirects:
|
Deploying docs with
|
| Latest commit: |
e65d07a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b27d4da9.docs-51g.pages.dev |
| Branch Preview URL: | https://dc-4796.docs-51g.pages.dev |
There was a problem hiding this 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 noteThe 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 tokensThe 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 errorsGood 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 responseThe 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
📒 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
Summary by CodeRabbit