Skip to content

Add Vercel deployment status plugin#31

Open
himattm wants to merge 3 commits intomainfrom
claude/vercel-plugin-ideas-dWr7P
Open

Add Vercel deployment status plugin#31
himattm wants to merge 3 commits intomainfrom
claude/vercel-plugin-ideas-dWr7P

Conversation

@himattm
Copy link
Owner

@himattm himattm commented Mar 16, 2026

Native plugin that shows latest Vercel deployment status in the status
line (▲ ready/building/error). Reads .vercel/project.json for project
detection, queries deployments via vercel api. Supports configurable
URL display, team prefix, and branch info. Uses state-dependent cache
TTLs (3s for transient states, 10s for stable).

https://claude.ai/code/session_01F8kbw4XrgdJRUZfcGjmQQw

claude added 3 commits March 16, 2026 20:39
Native plugin that shows latest Vercel deployment status in the status
line (▲ ready/building/error). Reads .vercel/project.json for project
detection, queries deployments via `vercel api`. Supports configurable
URL display, team prefix, and branch info. Uses state-dependent cache
TTLs (3s for transient states, 10s for stable).

https://claude.ai/code/session_01F8kbw4XrgdJRUZfcGjmQQw
Put vercel plugin on the default second status line alongside spotify.
Remove the show_branch config since the deployed branch is redundant
with the git plugin's current branch display.

https://claude.ai/code/session_01F8kbw4XrgdJRUZfcGjmQQw
Follow three-line layout pattern:
- Line 1 (Agent harness): dir, model, context, usage, git
- Line 2 (Project tooling): vercel
- Line 3 (Auxiliary): spotify

https://claude.ai/code/session_01F8kbw4XrgdJRUZfcGjmQQw
@gemini-code-assist
Copy link

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 introduces a new Vercel plugin that enhances the application's status line by providing real-time updates on Vercel deployment statuses. It intelligently fetches deployment information, offers customizable display options for users, and optimizes performance through a sophisticated caching mechanism that adapts to the deployment's current state.

Highlights

  • New Vercel Deployment Status Plugin: Introduced a native plugin to display the latest Vercel deployment status directly in the status line.
  • Project Detection and API Interaction: Implemented detection of Vercel projects by reading .vercel/project.json and querying deployments via the vercel api CLI command.
  • Configurable Display Options: Added support for configurable URL display (with truncation), team prefix, and branch information in the status output.
  • State-Dependent Caching: Utilized state-dependent cache Time-To-Live (TTL) values, with faster polling (3s) for transient states (BUILDING, QUEUED) and longer caching (10s) for stable states (READY, ERROR).

🧠 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.

Changelog
  • internal/cache/cache.go
    • Added new cache Time-To-Live (TTL) constants specifically for Vercel deployments, builds, project configuration, and team information, allowing for state-dependent caching.
  • internal/config/config.go
    • Integrated the new "vercel" plugin into the default section lines configuration, making it available for display.
  • internal/plugins/interface.go
    • Registered the VercelPlugin with the plugin registry, enabling its functionality within the application.
  • internal/plugins/vercel.go
    • Introduced a new VercelPlugin file, implementing the core logic for fetching and displaying Vercel deployment statuses, including configuration parsing, Vercel CLI interaction, and output formatting.
  • internal/plugins/vercel_test.go
    • Added a new test file for the VercelPlugin, covering its name, cache setting, configuration parsing, project file reading, output formatting, cache invalidation, and execution scenarios.
Activity
  • No specific activity (comments, reviews, or progress updates) has been recorded for this pull request yet.
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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

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.

Copy link

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

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 introduces a new native plugin for displaying Vercel deployment status. The implementation is well-structured, with good use of caching and state-dependent TTLs. The configuration and output formatting are also handled nicely. I've added a few suggestions to improve debuggability by ensuring that error output from the vercel CLI is not discarded. I also noted an opportunity to increase test coverage for the functions that interact with the external CLI.

cmd := exec.CommandContext(ctx, vercelPath, "api", "/v6/deployments?limit=1&projectId="+projectID)
var out bytes.Buffer
cmd.Stdout = &out
cmd.Stderr = nil

Choose a reason for hiding this comment

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

medium

By explicitly setting cmd.Stderr to nil, you are redirecting the standard error of the vercel command to /dev/null. This discards potentially useful error messages, making it very difficult to debug issues like authentication failures or API errors. It's better to redirect stderr to the main process's stderr stream for debugging purposes.

Suggested change
cmd.Stderr = nil
cmd.Stderr = os.Stderr

cmd := exec.CommandContext(ctx, vercelPath, "whoami")
var out bytes.Buffer
cmd.Stdout = &out
cmd.Stderr = nil

Choose a reason for hiding this comment

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

medium

Similar to the other command execution, setting cmd.Stderr to nil discards valuable error information from the vercel whoami command. This can make troubleshooting user- or team-related configuration issues difficult. Redirecting to the main process's stderr would be beneficial for debugging.

Suggested change
cmd.Stderr = nil
cmd.Stderr = os.Stderr

Comment on lines +1 to +12
package plugins

import (
"context"
"os"
"path/filepath"
"testing"
"time"

"github.com/himattm/prism/internal/cache"
"github.com/himattm/prism/internal/plugin"
)

Choose a reason for hiding this comment

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

medium

These tests provide good coverage for the parsing and formatting logic. However, the functions that execute external commands (getLatestVercelDeployment and getVercelTeam) are not tested. This means the logic for interacting with the vercel CLI, including command arguments and parsing the output, is not verified. Consider adding tests that mock os/exec to cover these functions. This can be achieved using a test helper that mimics the vercel CLI's behavior.

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