Skip to content

refactor: remove appendProjectArgs and simplify personal account retry - #299

Merged
amondnet merged 3 commits into
masterfrom
amondnet/good-burglar
Mar 26, 2026
Merged

refactor: remove appendProjectArgs and simplify personal account retry#299
amondnet merged 3 commits into
masterfrom
amondnet/good-burglar

Conversation

@amondnet

Copy link
Copy Markdown
Owner

Summary

  • Remove the appendProjectArgs helper function from index.js (and bundled dist/index.js). The --project flag workaround is unnecessary because VERCEL_PROJECT_ID remains set in the environment after clearing VERCEL_ORG_ID on the retry path.
  • Update the retry warning message to clarify that VERCEL_PROJECT_ID is still active.
  • Clean up example/static/vercel.json: add $schema, remove deprecated version field and the github.enabled: false block.

Changes

  • index.js / dist/index.js: delete appendProjectArgs, remove conditional appendProjectArgs call before scope block, remove appendProjectArgs call in retry path, update warning text.
  • example/static/vercel.json: add schema URL, drop version: 2 and github object.

Test plan

  • Verify that deployments to personal Vercel accounts still succeed (VERCEL_PROJECT_ID is passed via env, --project flag is no longer needed).
  • Verify that deployments to team/org accounts are unaffected.
  • Confirm the example static project deploys correctly with the updated vercel.json.

The --project flag fallback was added as a workaround for personal
account scope errors, but VERCEL_PROJECT_ID set in env is sufficient
for the retry path. Remove the helper and update the warning message
to reflect that VERCEL_PROJECT_ID remains active after clearing
VERCEL_ORG_ID.
Add \$schema reference, remove deprecated version field and
github.enabled config that is no longer needed in modern Vercel config.
Copilot AI review requested due to automatic review settings March 26, 2026 01:41
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request streamlines the Vercel deployment action by refactoring its core logic and updating an example configuration. The primary goal is to simplify the handling of personal Vercel accounts during deployment, ensuring correct behavior without unnecessary workarounds, and to modernize the example vercel.json file.

Highlights

  • Code Simplification: The appendProjectArgs helper function and its associated calls have been removed from index.js, as the --project flag workaround is no longer necessary due to VERCEL_PROJECT_ID remaining set in the environment.
  • Improved Retry Logic: The personal account retry mechanism has been simplified by removing the redundant --project flag addition, and the associated warning message has been clarified to state that VERCEL_PROJECT_ID is still active.
  • Configuration Update: The example/static/vercel.json file has been cleaned up by adding a schema, removing the deprecated version field, and deleting the github.enabled: false block.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions

github-actions Bot commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

Deploy preview for express-basic-auth ready!

✅ Preview
https://express-basic-auth-5qqvujcyg-minsu-lees-projects-b1e388b7.vercel.app

Built with commit 1ff65db.
This pull request is being automatically deployed with vercel-action

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the vercel.json configuration by adding a schema definition and removing deprecated fields such as version and github settings. It also refactors index.js by removing the appendProjectArgs function and its calls, simplifying the logic for handling Vercel project IDs during deployment. The warning message for retrying deployments without an organization ID has been updated to reflect these changes. I have no feedback to provide.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 3 files

Requires human review: This PR modifies core deployment logic and retry behavior, relying on specific assumptions about Vercel CLI environment variable handling that require manual verification.

Architecture diagram
sequenceDiagram
    participant GH as GitHub Action Process
    participant Env as Environment (process.env)
    participant CLI as Vercel CLI (npx)
    participant API as Vercel API

    Note over GH, API: Initial Deployment Attempt
    GH->>Env: Get VERCEL_ORG_ID and VERCEL_PROJECT_ID
    GH->>GH: Build deployment arguments
    GH->>CLI: exec('npx vercel', args)
    CLI->>API: POST /v13/deployments (using Org ID)
    
    alt Personal Account Error
        API-->>CLI: Error: Org ID not allowed for personal account
        CLI-->>GH: Exit with failure
        
        Note over GH, Env: NEW: Simplified Retry Path
        GH->>Env: CHANGED: Delete VERCEL_ORG_ID
        GH->>GH: CHANGED: Rebuild args (no manual --project injection)
        
        GH->>CLI: exec('npx vercel', retryArgs)
        
        Note over CLI, Env: Vercel CLI automatically reads VERCEL_PROJECT_ID from Env
        CLI->>API: POST /v13/deployments (using Project ID)
        API-->>CLI: Success
        CLI-->>GH: Exit 0
    else Success path
        API-->>CLI: Success
        CLI-->>GH: Exit 0
    end
Loading

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the Vercel deploy retry logic by removing the --project flag injection path and relying on VERCEL_PROJECT_ID being preserved in the environment when retrying after clearing VERCEL_ORG_ID. It also modernizes the example static vercel.json configuration.

Changes:

  • Remove the appendProjectArgs helper and all --project flag injection call sites.
  • Simplify the personal-account retry path to only clear VERCEL_ORG_ID and retry with the same deploy args.
  • Update example/static/vercel.json by adding $schema and removing deprecated fields/blocks.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
index.js Removes appendProjectArgs and updates the personal-account retry warning message.
dist/index.js Applies the same refactor to the bundled action output.
example/static/vercel.json Adds $schema and removes deprecated version and github.enabled config.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…e retry error context

- Add core.setSecret(vercelToken) to prevent token leakage in action logs
- Sanitize commit message (strip newlines/quotes) before passing as metadata
- Preserve original error output when retry path also fails
- Remove core.exportVariable for VERCEL_ORG_ID (process.env delete suffices)
@sonarqubecloud

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

0 issues found across 2 files (changes from recent commits).

Requires human review: This PR refactors core deployment and retry logic, modifies CLI argument construction, and changes environment variable handling, which requires human verification.

@amondnet
amondnet merged commit 50bbfcf into master Mar 26, 2026
8 of 14 checks passed
@amondnet
amondnet deleted the amondnet/good-burglar branch March 26, 2026 02:23
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