Skip to content

feat(codepipeline): add AWS CodePipeline integration with tools and block#4945

Merged
TheodoreSpeaks merged 4 commits into
stagingfrom
feat/codepipeline-integration
Jun 10, 2026
Merged

feat(codepipeline): add AWS CodePipeline integration with tools and block#4945
TheodoreSpeaks merged 4 commits into
stagingfrom
feat/codepipeline-integration

Conversation

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator

Summary

  • Add AWS CodePipeline integration: 8 tools (start/stop execution, get pipeline state, get/list executions, list pipelines, retry stage, approve/reject manual approvals)
  • Server-side AWS SDK v3 calls behind internal /api/tools/codepipeline routes with boundary contracts
  • CodePipeline block with operation dropdown, BlockMeta templates + skills, official AWS architecture icon
  • Generated docs page

Type of Change

  • New feature

Testing

Tested manually. bun run lint:check, tsc --noEmit, and bun run check:api-validation:strict all pass.

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

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jun 10, 2026 6:32pm

Request Review

@cursor

cursor Bot commented Jun 10, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Mutating operations (start/stop/retry/approve) can change live deployments; routes accept AWS keys in the body like other AWS tools but are gated by internal auth and follow the existing tool pattern.

Overview
Adds a full AWS CodePipeline integration so workflows can list pipelines, inspect state and executions, start/stop runs, retry failed stages, and submit manual approval decisions.

Eight authenticated /api/tools/codepipeline/* routes call the AWS SDK v3 client with Zod boundary contracts, shared awsErrorStatus mapping, and matching tool definitions plus a CodePipeline workflow block (operation dropdown, AWS key fields, templates/skills). Docs, integrations.json, icon mappings, block/tool registries, @aws-sdk/client-codepipeline, and the API validation route baseline (804 → 811) are updated accordingly.

Reviewed by Cursor Bugbot for commit 1a5a510. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread apps/sim/blocks/blocks/codepipeline.ts Outdated
Comment thread apps/sim/blocks/blocks/codepipeline.ts
@greptile-apps

greptile-apps Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds an AWS CodePipeline integration with 8 tools (start/stop execution, get pipeline state, get/list executions, list pipelines, retry stage, put approval result) backed by server-side AWS SDK v3 routes, a CodePipeline block with operation dropdown, Zod-validated contracts, and a generated docs page.

  • API routes (apps/sim/app/api/tools/codepipeline/): Each of the 8 operations has its own Next.js route with internal-auth gating, Zod contract validation, and a shared awsErrorStatus helper that propagates 4xx codes from the AWS SDK $metadata field rather than always returning 500.
  • Block (apps/sim/blocks/blocks/codepipeline.ts): Conditional subblocks per operation, robust pipelineVariables table parsing via parseOptionalJsonInput (which wraps JSON.parse in a try/catch), correct user-only visibility on all AWS credential params, and 8 BlockMeta templates plus 4 skills.
  • Contracts (apps/sim/lib/api/contracts/tools/aws/): Input schemas enforce AWS-aligned limits (pipeline name ≤ 100 chars, retryMode as enum, summary min/max, clientRequestToken character set regex) with validateAwsRegion on all routes.

Confidence Score: 5/5

Safe to merge — all eight routes are correctly guarded by internal auth and Zod contract validation, the shared awsErrorStatus helper properly propagates AWS 4xx codes, and the pipelineVariables JSON parsing is safely wrapped.

The integration follows established patterns from other AWS integrations in the codebase. Both issues flagged in the previous review thread (AWS error status mapping and unguarded JSON.parse) are addressed. AWS credentials use user-only visibility consistently across all tool params. Input validation is thorough with AWS-aligned length constraints and enum validation for retryMode and approval status. No logic bugs or data-loss paths were found.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/app/api/tools/codepipeline/utils.ts Adds awsErrorStatus helper that propagates 4xx HTTP status codes from the AWS SDK $metadata field, addressing the HTTP-500-for-all-errors pattern flagged in the previous review thread.
apps/sim/blocks/blocks/codepipeline.ts Full CodePipeline block with 8 operations, conditional subblocks, and tool routing. pipelineVariables now correctly uses parseOptionalJsonInput (wrapping JSON.parse in try/catch) to fix the previously flagged SyntaxError issue.
apps/sim/app/api/tools/codepipeline/put-approval-result/route.ts PutApprovalResult route correctly maps the status string to AWS ApprovalStatus type and uses awsErrorStatus for error propagation.
apps/sim/app/api/tools/codepipeline/start-execution/route.ts StartPipelineExecution route correctly guards the variables spread with a length check and validates the returned execution ID before responding.
apps/sim/lib/api/contracts/tools/aws/codepipeline-start-execution.ts Start-execution contract correctly validates variables array with .min(1).max(50) (only sent when non-empty) and clientRequestToken regex against the AWS-specified character set.
apps/sim/tools/codepipeline/types.ts Well-structured type definitions for all 8 CodePipeline operations with clear optional/required field distinctions.
apps/sim/hooks/use-inline-rename.ts Narrows onSave return type from `void

Sequence Diagram

sequenceDiagram
    participant Block as CodePipeline Block
    participant Tool as Tool Config (params fn)
    participant Route as /api/tools/codepipeline/<op>
    participant Auth as checkInternalAuth
    participant Zod as Zod Contract Validation
    participant AWS as AWS CodePipeline SDK

    Block->>Tool: operation + block params
    Tool->>Tool: parseOptionalJsonInput / parseOptionalNumberInput / parseOptionalBooleanInput
    Tool->>Route: "POST { region, accessKeyId, secretAccessKey, ...opParams }"
    Route->>Auth: checkInternalAuth(request)
    Auth-->>Route: "{ success, userId }"
    Route->>Zod: parseToolRequest(contract, request)
    Zod-->>Route: validated body or 400 error
    Route->>AWS: "new CodePipelineClient({ region, credentials })"
    AWS-->>Route: response or error
    Note over Route,AWS: awsErrorStatus maps 4xx from $metadata
    Route-->>Block: "{ success: true, output } or { error, status: 4xx/5xx }"
Loading

Reviews (3): Last reviewed commit: "fix(codepipeline): address review feedba..." | Re-trigger Greptile

Comment thread apps/sim/app/api/tools/codepipeline/get-pipeline-state/route.ts
Comment thread apps/sim/blocks/blocks/codepipeline.ts
…integration

# Conflicts:
#	apps/docs/components/icons.tsx
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile review

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 860a1ce. Configure here.

Comment thread apps/sim/blocks/blocks/codepipeline.ts Outdated
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile review

@TheodoreSpeaks TheodoreSpeaks merged commit 1ff445a into staging Jun 10, 2026
14 checks passed
@TheodoreSpeaks TheodoreSpeaks deleted the feat/codepipeline-integration branch June 10, 2026 18:54
ouiliame added a commit to ouiliame/sim-docs that referenced this pull request Jun 10, 2026
…gger from catalog

The native Sim workspace-event trigger is documented at triggers/sim — the
block writer no longer emits an integrations page for it (skip + canonical-set
exclusion). CodePipeline (simstudioai#4945) lands in the catalog in the Actions format.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
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.

1 participant