chore(docs): Add playwright workaround#2973
Conversation
|
WalkthroughThis pull request adds documentation and API specifications for three new Deployments API endpoints. Changes include a new troubleshooting section in the Playwright extension documentation, three new MDX documentation files for Deployments API operations (retrieve, get-latest, promote), an updated navigation structure in docs.json to include the new "Deployments API" group, and comprehensive OpenAPI specifications for the three endpoints with request/response schemas, error handling, security requirements, and code examples. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
Review CompleteYour review story is ready! Comment !reviewfast on this PR to re-generate the story. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@docs/v3-openapi.yaml`:
- Around line 607-669: The get_latest_deployment_v1 response intentionally omits
imagePlatform, externalBuildData, and worker compared to get_deployment_v1;
either refactor by extracting a reusable Deployment schema under
components/schemas (create a Deployment model with all common fields and then
use an inline subset or a DeploymentSummary schema for the latest endpoint) or
add a clear comment/description in the OpenAPI file near the
/api/v1/deployments/latest operation (or in components/schemas) stating that
get_latest_deployment_v1 returns a reduced DeploymentSummary and intentionally
omits imagePlatform, externalBuildData, and worker to match backend behavior;
update references to get_deployment_v1, Deployment, imagePlatform,
externalBuildData, and worker so readers can see the relationship.
🧹 Nitpick comments (1)
docs/v3-openapi.yaml (1)
508-606: LGTM with optional schema improvement suggestions.The endpoint is well-documented with proper responses, security, and code samples.
Optional improvements:
The response schema is defined inline rather than using
$reflike other endpoints. Consider extracting theDeploymentObjectschema tocomponents/schemasfor reusability across the three deployment endpoints.The
tasksarray (lines 569-580) lacks amaxItemsconstraint, which is an OpenAPI best practice for array validation. Consider adding it if there's a known upper bound.Note: The Gitleaks warnings about the curl auth headers are false positives—the tokens (
tr_dev_1234) are clearly placeholder examples.
📜 Review details
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
docs/config/extensions/playwright.mdxdocs/docs.jsondocs/management/deployments/get-latest.mdxdocs/management/deployments/promote.mdxdocs/management/deployments/retrieve.mdxdocs/v3-openapi.yaml
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,ts,jsx,tsx,json,md,yaml,yml}
📄 CodeRabbit inference engine (AGENTS.md)
Format code using Prettier before committing
Files:
docs/docs.jsondocs/v3-openapi.yaml
🧠 Learnings (3)
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `task()` function from `trigger.dev/sdk/v3` to define tasks with id and run properties
Applied to files:
docs/config/extensions/playwright.mdx
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger.config.ts : Configure build process in trigger.config.ts using `build` object with external packages, extensions, and JSX settings
Applied to files:
docs/config/extensions/playwright.mdx
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Configure task retry behavior using the `retry` property with options like maxAttempts, factor, and timeout values
Applied to files:
docs/config/extensions/playwright.mdx
🪛 Checkov (3.2.334)
docs/v3-openapi.yaml
[medium] 569-582: Ensure that arrays have a maximum number of items
(CKV_OPENAPI_21)
🪛 Gitleaks (8.30.0)
docs/v3-openapi.yaml
[high] 602-605: Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.
(curl-auth-header)
[high] 665-668: Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.
(curl-auth-header)
[high] 730-733: Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.
(curl-auth-header)
⏰ 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). (1)
- GitHub Check: Mintlify Deployment
🔇 Additional comments (6)
docs/config/extensions/playwright.mdx (1)
94-119: LGTM! Clear troubleshooting documentation.The workaround for browser download failures is well-documented with a clear code example and links to the relevant GitHub issue for context.
One minor note: consider verifying that the GitHub issue comment link (with the specific comment ID
#issuecomment-3815104376) remains valid over time, as comment IDs can change if comments are deleted/recreated.docs/management/deployments/get-latest.mdx (1)
1-4: LGTM!Standard Mintlify documentation page with proper front matter referencing the OpenAPI endpoint.
docs/management/deployments/retrieve.mdx (1)
1-4: LGTM!Standard Mintlify documentation page with proper front matter referencing the OpenAPI endpoint.
docs/management/deployments/promote.mdx (1)
1-4: LGTM!Standard Mintlify documentation page with proper front matter referencing the OpenAPI endpoint.
docs/docs.json (1)
272-280: LGTM!The new Deployments API navigation group is properly structured and consistent with the existing API groups.
docs/v3-openapi.yaml (1)
670-735: LGTM!The promote endpoint is well-documented with appropriate request/response schemas and error handling for 400, 401, and 404 cases.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
| "/api/v1/deployments/latest": | ||
| get: | ||
| operationId: get_latest_deployment_v1 | ||
| summary: Get latest deployment | ||
| description: Retrieve information about the latest unmanaged deployment for the authenticated project. | ||
| responses: | ||
| "200": | ||
| description: Successful request | ||
| content: | ||
| application/json: | ||
| schema: | ||
| type: object | ||
| properties: | ||
| id: | ||
| type: string | ||
| description: The deployment ID | ||
| status: | ||
| type: string | ||
| enum: ["PENDING", "INSTALLING", "BUILDING", "DEPLOYING", "DEPLOYED", "FAILED", "CANCELED", "TIMED_OUT"] | ||
| description: The current status of the deployment | ||
| contentHash: | ||
| type: string | ||
| description: Hash of the deployment content | ||
| shortCode: | ||
| type: string | ||
| description: The short code for the deployment | ||
| version: | ||
| type: string | ||
| description: The deployment version (e.g., "20250228.1") | ||
| imageReference: | ||
| type: string | ||
| nullable: true | ||
| description: Reference to the deployment image | ||
| errorData: | ||
| type: object | ||
| nullable: true | ||
| description: Error data if the deployment failed | ||
| "401": | ||
| description: Unauthorized - API key is missing or invalid | ||
| "404": | ||
| description: No deployment found | ||
| tags: | ||
| - deployments | ||
| security: | ||
| - secretKey: [] | ||
| x-codeSamples: | ||
| - lang: typescript | ||
| source: |- | ||
| const response = await fetch( | ||
| "https://api.trigger.dev/api/v1/deployments/latest", | ||
| { | ||
| method: "GET", | ||
| headers: { | ||
| "Authorization": `Bearer ${secretKey}`, | ||
| }, | ||
| } | ||
| ); | ||
| const deployment = await response.json(); | ||
| - lang: curl | ||
| source: |- | ||
| curl -X GET "https://api.trigger.dev/api/v1/deployments/latest" \ | ||
| -H "Authorization: Bearer tr_dev_1234" | ||
|
|
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# First, find and check the OpenAPI YAML file
find . -name "*openapi*" -o -name "v3-openapi.yaml" 2>/dev/null
# Check file size and basic structure
if [ -f "docs/v3-openapi.yaml" ]; then
wc -l docs/v3-openapi.yaml
echo "---"
# Look for both endpoint definitions
rg -n "/api/v1/deployments" docs/v3-openapi.yaml | head -20
fiRepository: triggerdotdev/trigger.dev
Length of output: 769
🏁 Script executed:
#!/bin/bash
# Read the deployment endpoint schema
sed -n '508,606p' docs/v3-openapi.yamlRepository: triggerdotdev/trigger.dev
Length of output: 3657
🏁 Script executed:
#!/bin/bash
# Check for components/schemas section that might define a shared Deployment schema
rg -n "components:" docs/v3-openapi.yaml
echo "---"
# Look for Deployment schema definitions
rg -n "Deployment:" docs/v3-openapi.yaml | head -20
echo "---"
# Check if the file follows Prettier formatting (check for YAML formatting issues)
# Look at specific sections with potential formatting issues
sed -n '607,650p' docs/v3-openapi.yaml | cat -ARepository: triggerdotdev/trigger.dev
Length of output: 1849
🏁 Script executed:
#!/bin/bash
# Read the components section
sed -n '1621,1700p' docs/v3-openapi.yamlRepository: triggerdotdev/trigger.dev
Length of output: 3194
🏁 Script executed:
#!/bin/bash
# Search for Deployment schema in the schemas section
rg -n "schemas:" docs/v3-openapi.yaml
echo "---"
# Look for deployment-related schema definitions
rg -n "^\s+Deployment|^\s+Deployment:" docs/v3-openapi.yamlRepository: triggerdotdev/trigger.dev
Length of output: 88
🏁 Script executed:
#!/bin/bash
# Read the schemas section to check what's defined
sed -n '1747,1850p' docs/v3-openapi.yamlRepository: triggerdotdev/trigger.dev
Length of output: 3737
🏁 Script executed:
#!/bin/bash
# Check if there's a backend implementation to understand if this is intentional
# Search for deployment route handlers
find . -type f \( -name "*.ts" -o -name "*.js" \) -path "*/routes/*" -o -path "*/api/*" 2>/dev/null | grep -i deploy | head -10
echo "---"
# Search for getLatestDeployment handler
rg -l "getLatestDeployment|get_latest_deployment" --type ts | head -10Repository: triggerdotdev/trigger.dev
Length of output: 753
🏁 Script executed:
#!/bin/bash
# Check the implementation of the latest deployment endpoint
cat ./apps/webapp/app/routes/api.v1.deployments.latest.ts
echo "=== END LATEST ==="
echo ""
# Check the implementation of the specific deployment endpoint
cat ./apps/webapp/app/routes/api.v1.deployments.\$deploymentId.ts | head -100Repository: triggerdotdev/trigger.dev
Length of output: 3672
🏁 Script executed:
#!/bin/bash
# Check the coding guidelines - verify if Prettier is meant to apply to YAML
# Look for prettier config
find . -name ".prettierrc*" -o -name "prettier.config.*" 2>/dev/null | head -5
echo "---"
# Check if YAML formatting is properly applied (check indentation/structure)
sed -n '607,620p' docs/v3-openapi.yaml | od -c | head -30Repository: triggerdotdev/trigger.dev
Length of output: 184
🏁 Script executed:
#!/bin/bash
# Check if prettier config includes yaml
cat ./prettier.config.js | head -40Repository: triggerdotdev/trigger.dev
Length of output: 277
🏁 Script executed:
#!/bin/bash
# Check if there's a .prettierignore file
if [ -f ".prettierignore" ]; then
cat .prettierignore | grep -i yaml
echo "---"
cat .prettierignore | grep -i docs
fi
echo "---"
# Check if prettier should be applied to YAML - try to run prettier check (may not be available)
# but first verify the file's YAML indentation consistency
head -100 docs/v3-openapi.yaml | grep -E "^ " | head -20Repository: triggerdotdev/trigger.dev
Length of output: 825
Response schema difference is intentional—document the design decision or refactor.
The get_latest_deployment_v1 endpoint intentionally returns fewer fields than get_deployment_v1. The backend implementation confirms it omits imagePlatform, externalBuildData, and the worker object.
To improve maintainability, consider:
- Extracting a reusable
Deploymentschema incomponents/schemasto reduce duplication - Or add a comment in the OpenAPI spec explaining why the latest endpoint returns a subset of fields
🧰 Tools
🪛 Gitleaks (8.30.0)
[high] 665-668: Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.
(curl-auth-header)
🤖 Prompt for AI Agents
In `@docs/v3-openapi.yaml` around lines 607 - 669, The get_latest_deployment_v1
response intentionally omits imagePlatform, externalBuildData, and worker
compared to get_deployment_v1; either refactor by extracting a reusable
Deployment schema under components/schemas (create a Deployment model with all
common fields and then use an inline subset or a DeploymentSummary schema for
the latest endpoint) or add a clear comment/description in the OpenAPI file near
the /api/v1/deployments/latest operation (or in components/schemas) stating that
get_latest_deployment_v1 returns a reduced DeploymentSummary and intentionally
omits imagePlatform, externalBuildData, and worker to match backend behavior;
update references to get_deployment_v1, Deployment, imagePlatform,
externalBuildData, and worker so readers can see the relationship.
|
@isshaddad did you mean to add the deployment api docs to this PR? |
I merged docs/promote-deployment because it was already approved and I initially wanted to do additional changes in the API reference section |
Adds a workaround to playwright to browser download failures based on this GH issue: triggerdotdev#2440 <!-- devin-review-badge-begin --> --- <a href="https://app.devin.ai/review/triggerdotdev/trigger.dev/pull/2973"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1"> <img src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1" alt="Open with Devin"> </picture> </a> <!-- devin-review-badge-end -->
Adds a workaround to playwright to browser download failures based on this GH issue: #2440