Skip to content

feat(block): Add Dagster block#3924

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

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

Conversation

@abhinavDhulipala
Copy link
Copy Markdown

@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 third-party integration that makes authenticated network calls to Dagster’s GraphQL API and introduces new JSON parsing paths for run config/tags, which can fail at runtime if inputs or API responses differ.

Overview
Adds a new Dagster integration across docs and the Sim app, including new DagsterIcon assets and new tool documentation (dagster.mdx) plus metadata/landing-page entries.

Introduces a new DagsterBlock with five operations (launch/get/list runs, list jobs, terminate run) and wires it into the blocks registry. Implements corresponding Dagster GraphQL tools (dagster_*) with optional API-token auth, request/response transforms, and registers them in the global tools registry.

Reviewed by Cursor Bugbot for commit 0eca5e8. 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

value: () => 'launch_run',
},

// ── Launch Run ──
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Non-TSDoc comments violate project style guide

The project's coding standards (CLAUDE.md) explicitly state: "No non-TSDoc comments". Several inline section-separator comments should be removed. This same pattern appears throughout both the block file and tool files:

  • apps/sim/blocks/blocks/dagster.ts:34// ── Launch Run ──
  • apps/sim/blocks/blocks/dagster.ts:88// ── Get Run / Terminate Run ──
  • apps/sim/blocks/blocks/dagster.ts:98// ── List Runs ──
  • apps/sim/blocks/blocks/dagster.ts:123// ── Connection (common) ──
  • apps/sim/blocks/blocks/dagster.ts:153// Map list_runs job name filter to the correct param
  • apps/sim/blocks/blocks/dagster.ts:179,181,189,191,193 — output section comments
  • apps/sim/tools/dagster/terminate_run.ts:82,94,106 — discriminator inline comments

Please remove all non-TSDoc comments. If documentation is needed, use /** TSDoc */ block comments instead.

Context Used: Global coding standards that apply to all files (source)

@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 0eca5e8. 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 runs silently swallows GraphQL errors as empty results

Medium Severity

The buildListRunsQuery GraphQL query only includes ... on Runs { results { ... } } but omits any error fragment (e.g., ... on PythonError { message }). The Dagster API's runsOrError returns a union of Runs | PythonError. When a PythonError occurs, result will be {}, so result.results ?? [] evaluates to [], and the function returns { success: true, output: { runs: [] } } — silently swallowing the error as an empty successful response. Compare with get_run.ts and terminate_run.ts, which correctly include error fragments.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 0eca5e8. 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.

1 participant