Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • Add value resolution for deployment version descriptions
  • Resolve IDs (credentials, channels, workflows) to human-readable names
  • Use selector registry infrastructure with fetchById + fetchList fallback
  • Extract extended context from blocks for full selector resolution

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)

@vercel
Copy link

vercel bot commented Jan 30, 2026

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

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jan 30, 2026 6:51pm

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 30, 2026

Greptile Overview

Greptile Summary

This PR enhances deployment version descriptions by resolving IDs to human-readable names. The implementation adds a new formatDiffSummaryForDescriptionAsync function that uses the selector registry infrastructure to convert credentials, channels, workflows, and other resource IDs into their display names, making version descriptions more meaningful for users.

Key Changes:

  • New resolve-values.ts module with value resolution logic using selector registry
  • Async version of diff formatting function that resolves IDs in parallel using Promise.all
  • Updated system prompt to guide AI for better use of human-readable values
  • Proper error handling with fallbacks to semantic labels when resolution fails
  • Extracts extended context (credentialId, projectId, etc.) from blocks for dependent selectors

Implementation Quality:

  • Clean separation of concerns with dedicated resolution module
  • Reuses existing selector registry infrastructure
  • Handles API failures gracefully with try-catch and semantic fallbacks
  • Limits changes per block to 3 to avoid excessive API calls
  • Uses parallel Promise resolution for performance

Confidence Score: 5/5

  • This PR is safe to merge with no blocking issues
  • Well-structured implementation with proper error handling, performance optimizations, and clean architecture. The code follows established patterns, reuses existing infrastructure, and handles edge cases appropriately.
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/hooks/queries/deployments.ts Updated system prompt for better AI descriptions and made formatDiffSummaryForDescriptionAsync call with required parameters
apps/sim/lib/workflows/comparison/compare.ts Added new async function formatDiffSummaryForDescriptionAsync that resolves IDs to human-readable names using selector registry
apps/sim/lib/workflows/comparison/index.ts Added exports for new async function and resolve-values types/functions to public API
apps/sim/lib/workflows/comparison/resolve-values.ts New file implementing value resolution infrastructure to convert IDs to human-readable names using selector registry with proper error handling

Sequence Diagram

sequenceDiagram
    participant User
    participant DeploymentHook as useGenerateVersionDescription
    participant Compare as formatDiffSummaryForDescriptionAsync
    participant Resolve as resolveValueForDisplay
    participant SelectorRegistry as Selector Registry
    participant API as Backend APIs

    User->>DeploymentHook: Generate version description
    DeploymentHook->>DeploymentHook: Fetch current & previous workflow states
    DeploymentHook->>Compare: generateWorkflowDiffSummary(current, previous)
    Compare-->>DeploymentHook: WorkflowDiffSummary
    
    DeploymentHook->>Compare: formatDiffSummaryForDescriptionAsync(summary, currentState, workflowId)
    
    loop For each modified block
        Compare->>Compare: Extract changes (limit 3 per block)
        loop For each change
            Compare->>Resolve: resolveValueForDisplay(oldValue, context)
            Resolve->>Resolve: Check if resolvable (UUID, credential, etc)
            Resolve->>Resolve: Extract extended context from block
            
            alt Is credential field
                Resolve->>API: fetchCredentialSetById or fetchOAuthCredentialDetail
                API-->>Resolve: Credential name
            else Is workflow selector
                Resolve->>SelectorRegistry: getSelectorDefinition('sim.workflows')
                SelectorRegistry->>API: fetchById(workflowId)
                API-->>Resolve: Workflow name
            else Is selector type (channel, file, etc)
                Resolve->>SelectorRegistry: resolveSelectorForSubBlock
                SelectorRegistry->>API: fetchById or fetchList
                API-->>Resolve: Display label
            end
            
            Resolve-->>Compare: ResolvedValue with displayLabel
            
            Compare->>Resolve: resolveValueForDisplay(newValue, context)
            Note over Resolve,API: Same resolution process
            Resolve-->>Compare: ResolvedValue with displayLabel
        end
    end
    
    Compare-->>DeploymentHook: Formatted diff text with human-readable names
    DeploymentHook->>API: POST /api/wand (generate AI description)
    API-->>DeploymentHook: Streaming description
    DeploymentHook-->>User: Final version description
Loading

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.

4 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@waleedlatif1 waleedlatif1 merged commit 2ec9b7f into staging Jan 30, 2026
10 checks passed
@waleedlatif1 waleedlatif1 deleted the feat/deployment-desc branch January 30, 2026 19:17
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