-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[BUG] Vercel project prop #15418
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
[BUG] Vercel project prop #15418
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
WalkthroughThe pull request introduces comprehensive changes to the Vercel token authentication module, focusing on restructuring team and project properties across multiple files. The modifications include updating version numbers, refining documentation links, and enhancing how team and project identifiers are handled. The changes primarily address how deployments, projects, and teams are managed within the Vercel API integration, with a specific emphasis on adding team-related context to various actions and sources. Changes
Assessment against linked issues
Suggested labels
Suggested reviewers
Poem
Tip 🌐 Web search-backed reviews and chat
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (3)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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: 4
🧹 Nitpick comments (1)
components/vercel_token_auth/vercel_token_auth.app.mjs (1)
30-35
: Simplify state parameter handlingThe conditional check for state parameter can be simplified using object spread.
- const params = { - teamId, - }; - if (state) { - params.state = state; - } + const params = { + teamId, + ...(state && { state }), + };
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (6)
components/vercel_token_auth/actions/cancel-deployment/cancel-deployment.mjs
(1 hunks)components/vercel_token_auth/actions/create-deployment/create-deployment.mjs
(3 hunks)components/vercel_token_auth/actions/list-deployments/list-deployments.mjs
(1 hunks)components/vercel_token_auth/package.json
(2 hunks)components/vercel_token_auth/sources/new-deployment/new-deployment.mjs
(3 hunks)components/vercel_token_auth/vercel_token_auth.app.mjs
(3 hunks)
✅ Files skipped from review due to trivial changes (1)
- components/vercel_token_auth/package.json
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: pnpm publish
- GitHub Check: Verify TypeScript components
- GitHub Check: Publish TypeScript components
🔇 Additional comments (8)
components/vercel_token_auth/actions/cancel-deployment/cancel-deployment.mjs (1)
6-7
: LGTM: Documentation and version updatesDocumentation link and version number have been updated appropriately.
components/vercel_token_auth/actions/list-deployments/list-deployments.mjs (2)
6-7
: LGTM: Documentation and version updatesDocumentation link and version number have been updated appropriately.
21-23
: Verify team property access consistencyThe context parameter accesses
teamId
directly, which differs from cancel-deployment.mjs. Let's verify which approach is correct.components/vercel_token_auth/sources/new-deployment/new-deployment.mjs (1)
8-8
: LGTM: Version updateVersion number has been updated appropriately.
components/vercel_token_auth/vercel_token_auth.app.mjs (2)
13-16
: LGTM: Project options enhancementThe project options method now correctly handles team context by accepting and passing the teamId parameter.
121-121
: Verify Vercel API version upgradeThe endpoint has been upgraded from v8 to v9. Let's verify if this change is intentional and if there are any breaking changes.
✅ Verification successful
API version upgrade appears intentional and valid
The upgrade from v8 to v9 for the projects endpoint appears to be a normal API version change. Different Vercel API endpoints maintain independent versions, as evidenced by the various version numbers (v2, v6, v9, v13) used across different endpoints in the same file.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for other Vercel API version usage rg -A 1 'endpoint: "v[0-9]+' # Fetch Vercel API changelog curl -s "https://vercel.com/docs/rest-api/changelog"Length of output: 40895
Script:
#!/bin/bash # Search for v8/projects usage in git history git log -p | grep -A 5 -B 5 "v8/projects" # Try to fetch Vercel API docs for projects endpoint curl -s "https://api.vercel.com/v9/projects" # Search for any v8 API usage in the codebase rg "v8/"Length of output: 2626
components/vercel_token_auth/actions/create-deployment/create-deployment.mjs (2)
6-7
: LGTM! Documentation and versioning updates are appropriate.The documentation link is now more specific and the version bump follows semantic versioning.
16-21
: LGTM! Team and project props are properly integrated.The changes correctly implement team context for project selection, which aligns with fixing the Vercel project prop issue (#15400).
Also applies to: 26-28
components/vercel_token_auth/actions/cancel-deployment/cancel-deployment.mjs
Show resolved
Hide resolved
components/vercel_token_auth/sources/new-deployment/new-deployment.mjs
Outdated
Show resolved
Hide resolved
components/vercel_token_auth/sources/new-deployment/new-deployment.mjs
Outdated
Show resolved
Hide resolved
components/vercel_token_auth/actions/create-deployment/create-deployment.mjs
Outdated
Show resolved
Hide resolved
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 (2)
components/vercel_token_auth/actions/create-deployment/create-deployment.mjs (1)
42-66
: Consider enhancing error handling and fixing typo.The error handling could be more specific, and there's a typo in the branch description.
Apply this diff to improve the implementation:
try { const { link } = await this.vercelTokenAuth.getProject(this.project); if (link) { - props.branch.description = `Branch of \`${link.repo}\` repository to deploye to`; + props.branch.description = `Branch of \`${link.repo}\` repository to deploy to`; props.branch.default = link?.productionBranch || "main"; } return props; - } catch { + } catch (error) { + console.error("Failed to fetch project details:", error.message); return props; }components/vercel_token_auth/vercel_token_auth.app.mjs (1)
118-123
: Consider adding error handling to getProject method.While the implementation is clean, it could benefit from specific error handling.
Apply this diff to improve error handling:
async getProject(projectId, $) { + if (!projectId) { + throw new Error("Project ID is required"); + } const config = { endpoint: `v9/projects/${projectId}`, }; - return this.makeRequest(config, $); + try { + return await this.makeRequest(config, $); + } catch (error) { + throw new Error(`Failed to fetch project: ${error.message}`); + } }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
components/vercel_token_auth/actions/create-deployment/create-deployment.mjs
(3 hunks)components/vercel_token_auth/vercel_token_auth.app.mjs
(3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: pnpm publish
- GitHub Check: Verify TypeScript components
- GitHub Check: Publish TypeScript components
🔇 Additional comments (7)
components/vercel_token_auth/actions/create-deployment/create-deployment.mjs (4)
7-8
: LGTM! Documentation and version updates are appropriate.The documentation link has been updated to the correct endpoint, and the version bump reflects the feature changes.
17-22
: LGTM! Team property is well-defined.The team property is correctly integrated with the Vercel token auth app.
23-34
: LGTM! Project property changes enhance functionality.The project property now correctly:
- Depends on the selected team
- Triggers UI updates with reloadProps
- Is properly marked as required
67-88
: LGTM! Run method properly handles project verification.The method correctly:
- Verifies project repository link
- Throws appropriate error for missing repository
- Integrates team ID in deployment data
components/vercel_token_auth/vercel_token_auth.app.mjs (3)
13-21
: LGTM! Project options now support team-based filtering.The implementation correctly filters projects based on the selected team.
27-41
: LGTM! Deployment options handle parameters appropriately.The implementation correctly:
- Includes team filtering
- Maintains optional state filtering
124-131
: LGTM! ListProjects method updated appropriately.The implementation correctly:
- Uses the latest v9 API endpoint
- Handles parameters properly
/approve |
Resolves #15400
Summary by CodeRabbit
New Features
Bug Fixes
Chores
Documentation