Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

added the ability to rename deployment versions

Type of Change

  • New feature

Testing

Tested manually.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Screenshots/Videos

Screen.Recording.2025-10-11.at.9.15.51.PM.mov

@vercel
Copy link

vercel bot commented Oct 12, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Oct 12, 2025 4:17am

@waleedlatif1 waleedlatif1 merged commit 1de6f09 into staging Oct 12, 2025
4 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/version-renaming branch October 12, 2025 04:18
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Summary

This PR adds the ability to rename deployment versions through an inline editing UI in the deploy modal. The implementation adds a nullable name column to the database, a PATCH API endpoint for renaming, and an inline input field with keyboard shortcuts.

Key Changes:

  • Database migration adds nullable name text column to workflow_deployment_version table
  • New PATCH endpoint /api/workflows/[id]/deployments/[version] validates name (non-empty, max 100 chars) and updates the database
  • Frontend displays version names with fallback to v{version} format when no custom name is set
  • Inline editing with Enter to save, Escape to cancel, and blur-to-save behavior
  • Dropdown menu includes new "Rename" option

Minor Issue Found:

  • Error handling could be improved to provide user feedback when rename fails

Confidence Score: 4/5

  • This PR is safe to merge with low risk
  • The implementation is solid with proper validation, permissions checking, and database constraints. Score is 4 instead of 5 due to minor UX improvement opportunity around error feedback.
  • No files require special attention - all changes are straightforward and well-implemented

Important Files Changed

File Analysis

Filename Score Overview
packages/db/schema.ts 5/5 Added nullable name text field to workflowDeploymentVersion table schema
apps/sim/app/api/workflows/[id]/deployments/[version]/route.ts 5/5 Added PATCH endpoint for renaming versions with validation for string type, empty names, and 100 char limit
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/control-bar/components/deploy-modal/deploy-modal.tsx 4/5 Added inline rename UI with input field, dropdown control, and keyboard shortcuts (Enter/Escape); handles name persistence and display

Sequence Diagram

sequenceDiagram
    participant User
    participant DeployModal
    participant API
    participant DB

    User->>DeployModal: Click "Rename" in dropdown
    DeployModal->>DeployModal: Enter editing mode (show input)
    User->>DeployModal: Type new name & press Enter
    DeployModal->>API: PATCH /api/workflows/{id}/deployments/{version}
    API->>API: Validate permissions (write)
    API->>API: Validate name (non-empty, ≤100 chars)
    API->>DB: UPDATE workflow_deployment_version SET name
    DB-->>API: Return updated record
    API-->>DeployModal: Success response
    DeployModal->>API: GET /api/workflows/{id}/deployments
    API->>DB: SELECT versions with names
    DB-->>API: Return versions list
    API-->>DeployModal: Updated versions
    DeployModal->>DeployModal: Exit editing mode
    DeployModal->>User: Display updated name
Loading

8 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines +462 to +467
if (res.ok) {
await fetchVersions()
setEditingVersion(null)
} else {
logger.error('Failed to rename version')
}
Copy link
Contributor

Choose a reason for hiding this comment

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

style: When rename fails, the editing state persists without user feedback. Consider showing a toast notification or resetting the input to the original value.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/control-bar/components/deploy-modal/deploy-modal.tsx
Line: 462:467

Comment:
**style:** When rename fails, the editing state persists without user feedback. Consider showing a toast notification or resetting the input to the original value.

How can I resolve this? If you propose a fix, please make it concise.

waleedlatif1 added a commit that referenced this pull request Oct 12, 2025
* improvement(performance): remove unused source/target indices, add index on snapshot id (#1603)

* fix(blog): rename building to blogs with redirect (#1604)

* improvement(privacy-policy): updated privacy policy for google (#1602)

* updated privacy policy for google

* update terms, privacy, and emails to incl address and update verbiage

* feat(guardrails): added guardrails block/tools and docs (#1605)

* Adding guardrails block

* ack PR comments

* cleanup checkbox in dark mode

* cleanup

* fix supabase tools

* fix(inference-billing): fix inference billing when stream is true via API, add drag-and-drop functionality to deployed chat (#1606)

* fix(inference): fix inference billing when stream is true via API

* add drag-and-drop to deployed chat

* feat(mistal): added mistral as a provider, updated model prices (#1607)

* feat(mistal): added mistral as a provider, updated model prices

* remove the ability for a block to reference its own outluts

* fixed order of responses for guardrails block

* feat(versions): added the ability to rename deployment versions (#1610)

* fix(vulns): fix various vulnerabilities and enhanced code security (#1611)

* fix(vulns): fix SSRF vulnerabilities

* cleanup

* cleanup

* regen docs

* remove unused deps

* fix failing tests

* cleanup

* update deps

* regen bun lock
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