Skip to content

feat(block): Add Dagster block#3924

Open
abhinavDhulipala wants to merge 5 commits intosimstudioai:stagingfrom
abhinavDhulipala:dg-integration
Open

feat(block): Add Dagster block#3924
abhinavDhulipala wants to merge 5 commits intosimstudioai:stagingfrom
abhinavDhulipala:dg-integration

Conversation

@abhinavDhulipala
Copy link
Copy Markdown
Contributor

@abhinavDhulipala abhinavDhulipala commented Apr 4, 2026

Summary

Add a new Dagster integration with 5 operations that work with both
Dagster instances via the GraphQL API.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other: ___________

Testing

Tested this by doing the following.

  • Run the dagster quickstart project.
  • Once it's setup, run uv run dg dev --port 4000
  • Then, on your simstudio instance, use the dagster block in your workflow and run the integration with host set to http://127.0.0.1:4000.
  • Ensure output data looks sane and there are no errors.

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

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 4, 2026

@abhinavDhulipala is attempting to deploy a commit to the Sim Team on Vercel.

A member of the Team first needs to authorize it.

@cursor
Copy link
Copy Markdown

cursor bot commented Apr 4, 2026

PR Summary

Medium Risk
Adds a new external Dagster GraphQL integration (launch/list/get/terminate runs), which introduces new network request paths and error handling that could fail at runtime or due to API shape differences. Mostly additive and isolated, but relies on correct Dagster endpoint/auth header behavior and request/response parsing.

Overview
Adds Dagster as a first-class integration, including a new DagsterIcon, docs page (tools/dagster.mdx), and inclusion in generated icon maps and docs meta.json.

Implements a new DagsterBlock wired into the blocks registry, exposing operations to launch_run, get_run, list_runs, list_jobs, and terminate_run, with UI fields for host/token and operation-specific parameters.

Adds a new tools/dagster module with shared GraphQL response parsing and five tool configs, then registers them in the global tools registry and adds Dagster to the landing-page integrations.json catalog.

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

@icecrasher321 icecrasher321 changed the base branch from main to staging April 4, 2026 00:21
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 4, 2026

Greptile Summary

This PR adds a new Dagster integration block (5 operations: Launch Run, Get Run, List Runs, List Jobs, Terminate Run) and a CloudWatch block (7 operations), both following the standard tool → block → icon → registry pattern. The implementation is functionally solid: the GraphQL queries and mutations are well-structured, the params config function correctly merges overrides on top of original inputs (verified in generic-handler.ts:38), and the listRunsJobNamejobName field remapping cleanly avoids block-level namespace collision.

Key points:

  • All 5 Dagster tools directly call the Dagster GraphQL API (/graphql) without a proxied API route, which is appropriate since no server-side credential handling is needed.
  • Falsy guard if (params.limit) will skip numeric conversion when a user enters 0, sending a string \"0\" to the $limit: Int GraphQL variable and likely causing a type error.
  • apiKey is typed as required string in DagsterBaseParams but is genuinely optional across all tools.
  • Multiple non-TSDoc inline comments appear throughout the new files in violation of the project's comment style rules.

Confidence Score: 5/5

Safe to merge; all remaining findings are minor style and type-correctness suggestions that do not affect runtime correctness for typical usage.

The core integration logic is correct — GraphQL queries/mutations are well-formed, the block params merge behaviour was verified against the executor, and edge-case error paths are handled. The only functional concern (limit=0 falsy guard) affects an impractical edge case. Remaining items are style violations and a type annotation improvement.

apps/sim/blocks/blocks/dagster.ts (non-TSDoc comments + limit=0 guard), apps/sim/tools/dagster/types.ts (apiKey optionality), apps/sim/tools/dagster/terminate_run.ts (non-TSDoc comments)

Important Files Changed

Filename Overview
apps/sim/blocks/blocks/dagster.ts New Dagster block definition with all 5 operations; params mapping correct but contains non-TSDoc section comments violating project style guide.
apps/sim/tools/dagster/launch_run.ts New tool for launching Dagster runs via GraphQL mutation; dynamically builds query based on optional config/tags params.
apps/sim/tools/dagster/get_run.ts New tool to fetch a single Dagster run by ID via GraphQL; response handling correctly discriminates Run vs RunNotFoundError.
apps/sim/tools/dagster/list_runs.ts New tool to list Dagster runs with optional job/status filters; correctly uses pipelineName in the GraphQL RunsFilter.
apps/sim/tools/dagster/list_jobs.ts New tool to list all jobs across repositories; response parsing correctly checks nodes before iterating.
apps/sim/tools/dagster/terminate_run.ts New tool to terminate Dagster runs; contains non-TSDoc inline comments violating project style guide.
apps/sim/tools/dagster/types.ts Shared type definitions for all Dagster tools; apiKey typed as required string despite being optional in practice.
apps/sim/tools/dagster/index.ts Barrel export re-exporting all 5 Dagster tools with correct naming convention.
apps/sim/blocks/registry.ts Both CloudWatch and Dagster blocks registered alphabetically.
apps/sim/tools/registry.ts All 5 Dagster tools and 7 CloudWatch tools correctly registered in the global tool registry.
apps/sim/components/icons.tsx Adds DagsterIcon and CloudWatchIcon; both use the standard SVGProps pattern.

Sequence Diagram

sequenceDiagram
    participant UI as Sim Workflow UI
    participant Exec as Block Executor
    participant Tool as Dagster Tool
    participant DG as Dagster GraphQL API

    UI->>Exec: Execute DagsterBlock (operation, host, apiKey, ...params)
    Exec->>Exec: tools.config.tool(params) resolves tool name
    Exec->>Exec: merge(inputs, tools.config.params(inputs))
    Exec->>Tool: executeTool(finalInputs)

    alt Launch Run
        Tool->>DG: POST /graphql mutation LaunchRun
        DG-->>Tool: LaunchRunSuccess or Error
        Tool-->>Exec: output runId
    else Get Run
        Tool->>DG: POST /graphql query GetRun
        DG-->>Tool: Run or RunNotFoundError
        Tool-->>Exec: output run details
    else List Runs
        Tool->>DG: POST /graphql query ListRuns
        DG-->>Tool: Runs results
        Tool-->>Exec: output runs array
    else List Jobs
        Tool->>DG: POST /graphql query ListJobNames
        DG-->>Tool: RepositoryConnection nodes
        Tool-->>Exec: output jobs array
    else Terminate Run
        Tool->>DG: POST /graphql mutation TerminateRun
        DG-->>Tool: TerminateRunSuccess or Failure
        Tool-->>Exec: output success status
    end

    Exec-->>UI: Block output
Loading

Reviews (1): Last reviewed commit: "feat(blocks): add dagster block" | Re-trigger Greptile

@abhinavDhulipala abhinavDhulipala changed the title Draft: feat(block): Add Dagster block feat(block): Add Dagster block Apr 4, 2026
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Copy link
Copy Markdown

@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 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 c53f2b7. Configure here.

}
}
}
`
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

list_jobs query omits repository location name

Medium Severity

The LIST_JOBS_QUERY GraphQL query doesn't request location { name } from repository nodes, so repositoryLocationName is absent from the response. Since launch_run requires repositoryLocationName, users cannot chain list_jobs output into launch_run — the primary workflow for discovering and launching jobs. The response transform and type definition also only include name and repositoryName.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c53f2b7. Configure here.

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