Skip to content

Add handling for Vercel apps to exclude entire branches #904

Open
ashtom wants to merge 19 commits intomainfrom
ashtom/vercel-config
Open

Add handling for Vercel apps to exclude entire branches #904
ashtom wants to merge 19 commits intomainfrom
ashtom/vercel-config

Conversation

@ashtom
Copy link
Copy Markdown
Member

@ashtom ashtom commented Apr 9, 2026

This pull request introduces support for managing Vercel deployment settings within the repository's metadata branch, based on a new vercel field in project settings. When enabled, the CLI automatically writes or merges a vercel.json file to disable deployments for Entire-managed branches. The change includes updates to the checkpoint logic, settings management, and setup flows, as well as comprehensive tests for the new behavior.

Vercel deployment management integration:

  • Added a Vercel boolean field to EntireSettings and updated settings loading/merging logic to recognize and merge this field from both main and local settings files. Also introduced a LoadFromRepoRoot helper for context-aware settings loading. [1] [2] [3] [4] [5] [6]
  • Implemented maybeMergeVercelConfig in GitStore to ensure that when vercel is enabled, a vercel.json file is written or merged on the metadata branch to disable deployments for Entire branches. This is invoked during branch/session initialization and committed checkpoint updates. [1] [2] [3] [4]

Checkpoint and session logic improvements:

  • Updated all usages of ensureSessionsBranch to accept a context.Context parameter for consistency and future extensibility. [1] [2] [3] [4] [5] [6] [7] [8]
  • Added comprehensive tests to verify that enabling Vercel integration writes and merges the correct deployment-disabling configuration in the metadata branch, and that settings merging works as intended. [1] [2]

Setup and agent management flow:

  • Enhanced the setup and agent management flows to prompt users about disabling Vercel deployments when no agents are selected or when no changes are made, ensuring the deployment configuration remains consistent with project settings. [1] [2]

Dependency and import updates:

  • Added necessary imports for Vercel config and settings management in affected files. [1] [2] [3]

These changes ensure that repositories using Vercel can safely prevent unwanted deployments from metadata branches managed by Entire, with configuration driven by project settings and integrated into the CLI's workflow.This pull request enhances the CLI setup process for projects using Vercel by adding logic to detect Vercel configuration and prompt users to disable deployments for entire/** branches as reported in #239. It also introduces comprehensive tests to ensure this behavior works as intended. The changes are primarily focused on improving integration with Vercel and maintaining user control over deployment settings.

Vercel integration and deployment control:

  • Added a new function, maybePromptVercelDeploymentDisable, which detects Vercel configuration files and prompts the user to optionally disable deployments for entire/** branches by updating vercel.json. This function ensures that existing configuration is preserved and only the relevant deployment setting is changed.
  • Updated interactive and non-interactive agent setup flows (runEnableInteractive, applyAgentChanges, setupAgentHooksNonInteractive) to call maybePromptVercelDeploymentDisable after agent hooks are installed, ensuring users are prompted at the correct time. [1] [2] [3] [4]
  • Defined the branch pattern entire/** as a constant for consistent use across the codebase.

Testing improvements:

  • Added new tests in setup_test.go to verify that the Vercel deployment disable prompt merges with existing config, creates config when needed, and skips prompting if already disabled. These tests ensure reliability and correct behavior of the new logic.

Dependency and import updates:

  • Added the "encoding/json" import to support reading and writing vercel.json files.

Entire

Copilot AI review requested due to automatic review settings April 9, 2026 17:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Vercel-aware behavior to the setup/configure flows so Entire can optionally disable Vercel preview deployments for entire/* branches by updating vercel.json, with accompanying unit tests.

Changes:

  • Introduces maybePromptVercelDeploymentDisable to detect Vercel projects and optionally write git.deploymentEnabled["entire/*"]=false into vercel.json.
  • Wires the Vercel prompt into interactive enable, non-interactive setup, and agent-management change flows after hooks are installed.
  • Adds tests covering merge-with-existing-config, create-new-config, and “already disabled” no-op behavior.

Reviewed changes

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

File Description
cmd/entire/cli/setup.go Adds Vercel detection + prompt logic and integrates it into setup/configure flows.
cmd/entire/cli/setup_test.go Adds unit tests for the new Vercel prompt/config-merge behavior.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
ashtom and others added 2 commits April 9, 2026 20:04
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…d mergeVercelDeploymentDisabled error

Agent-Logs-Url: https://github.com/entireio/cli/sessions/59ca634c-4da4-40b7-b97b-2310258df3de

Co-authored-by: ashtom <70720+ashtom@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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

ashtom and others added 2 commits April 14, 2026 17:12
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@ashtom ashtom marked this pull request as ready for review April 14, 2026 15:44
@ashtom ashtom requested a review from a team as a code owner April 14, 2026 15:44
ashtom added 6 commits April 14, 2026 18:48
Entire-Checkpoint: edc71619cd07
Entire-Checkpoint: 5ce40f70db17
Entire-Checkpoint: 861a905efc98
Entire-Checkpoint: 67f984a929c7
Entire-Checkpoint: 8e99c2e7a6e4
Entire-Checkpoint: d9ab43f35155
Entire-Checkpoint: 854db522b3c2
@ashtom
Copy link
Copy Markdown
Member Author

ashtom commented Apr 14, 2026

@copilot resolve the merge conflicts in this pull request

# Conflicts:
#	cmd/entire/cli/setup.go
#	cmd/entire/cli/setup_test.go

Co-authored-by: ashtom <70720+ashtom@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 14, 2026

@copilot resolve the merge conflicts in this pull request

Resolved in 60d2bb7. The two conflicts were in setup.go (merged reinstalledAgents check from main with our Vercel prompt call) and setup_test.go (kept our TestManageAgents_NoChanges_StillPersistsVercelSetting alongside the two new Force* tests from main). All tests pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants