Skip to content

feat(dagster): expand integration with 9 new tools and full GraphQL validation#4013

Merged
waleedlatif1 merged 12 commits intostagingfrom
dg-integration
Apr 7, 2026
Merged

feat(dagster): expand integration with 9 new tools and full GraphQL validation#4013
waleedlatif1 merged 12 commits intostagingfrom
dg-integration

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

Summary

  • Add 9 new Dagster tools: delete_run, get_run_logs, reexecute_run, list_schedules, start_schedule, stop_schedule, list_sensors, start_sensor, stop_sensor
  • Fix GraphQL union type handling across all existing tools — replaced invalid ... on Error catch-alls with concrete union member fragments per the Dagster schema (fixes TerminateRunFailure, InvalidStepError, InvalidOutputError, RunConfigValidationInvalid)
  • Rename graphql.tsutils.ts for clarity
  • Wire all 14 operations into the Dagster block with proper show/hide conditions, param remapping, and wandConfig for AI-assisted fields
  • Update Dagster icon to official SVG and set bgColor to white
  • Add block wiring guidance to the /add-tools skill

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)

abhinavDhulipala and others added 6 commits April 7, 2026 08:50
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
…alidation

- Add 9 new tools: delete_run, get_run_logs, reexecute_run, list_schedules,
  start_schedule, stop_schedule, list_sensors, start_sensor, stop_sensor
- Fix GraphQL union type handling across all tools (replace invalid `... on Error`
  with concrete union member fragments per Dagster schema)
- Fix TerminateRunFailure, InvalidStepError, InvalidOutputError handling in existing tools
- Rename graphql.ts → utils.ts for clarity
- Wire all 14 operations into the Dagster block with proper conditions and param remapping
- Update icon to dagster logo SVG and set bgColor to white
- Add block wiring guidance to the add-tools skill
@cursor
Copy link
Copy Markdown

cursor bot commented Apr 7, 2026

PR Summary

Medium Risk
Introduces a new Dagster GraphQL integration with 14 callable operations and new UI block wiring; main risk is runtime/schema mismatch or parameter coercion issues causing tool execution failures, but changes are isolated to the new integration and registries.

Overview
Adds a new Dagster integration end-to-end: a DagsterBlock with an operation dropdown, conditional inputs, param remapping/coercion, and outputs for run execution, log retrieval, run lifecycle actions, and schedule/sensor management.

Implements and registers 14 Dagster GraphQL tools (launch/get/list runs & jobs, get logs, reexecute/terminate/delete runs, list/start/stop schedules and sensors) under apps/sim/tools/dagster, including shared GraphQL response parsing/error helpers.

Updates product surfaces to expose Dagster: new DagsterIcon in both docs and app icon maps, a new integrations catalog entry, and new docs page tools/dagster; also expands the internal add-tools skill doc to require block wiring after tool registration.

Reviewed by Cursor Bugbot for commit 7e26b13. Configure here.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 7, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Apr 7, 2026 6:18pm

Request Review

…oncrete union members

- list_runs: InvalidPipelineRunsFilterError + PythonError
- list_jobs: RepositoryNotFoundError + PythonError
- reexecute_run: PipelineNotFoundError, RunConflict, UnauthorizedError, PythonError
- terminate_run: RunNotFoundError, UnauthorizedError, PythonError
- delete_run: RunNotFoundError, UnauthorizedError, PythonError
- list_sensors: RepositoryNotFoundError + PythonError
- start_sensor: SensorNotFoundError, UnauthorizedError, PythonError
- stop_sensor: UnauthorizedError + PythonError
- stop_schedule: fix $id variable type String! → String (matches nullable schema arg)
- dagster.mdx: add manual intro description section
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 7, 2026

Greptile Summary

This PR expands the Dagster integration from 5 to 14 tools, adding full coverage of the run lifecycle (delete_run, get_run_logs, reexecute_run), schedule management (list_schedules, start_schedule, stop_schedule), and sensor management (list_sensors, start_sensor, stop_sensor). It also hardens all existing tools by replacing abstract ... on Error catch-all fragments with concrete union member fragments per the Dagster GraphQL schema.

  • 9 new tools added: delete_run, get_run_logs, reexecute_run, list_schedules, start_schedule, stop_schedule, list_sensors, start_sensor, stop_sensor
  • GraphQL union handling fixed across all tools — TerminateRunFailure, InvalidStepError, InvalidOutputError, RunConfigValidationInvalid, RunNotFoundError, and others now use concrete type fragments instead of the abstract ... on Error pattern
  • Block wiring updated with condition-based show/hide for all 14 operations, correct params remapping (listRunsJobName→jobName, logsLimit→limit, runId→parentRunId for reexecute), and wandConfig for AI-assisted fields (run config JSON, tags, status filters)
  • graphql.ts renamed to utils.ts with two well-typed helpers (parseDagsterGraphqlResponse, dagsterUnionErrorMessage) shared by all tools
  • All three issues raised in prior review threads (abstract error fragments, nullable $id on stopSensor, RepositoryNotFoundError union membership) were addressed in follow-up commits

Confidence Score: 5/5

Safe to merge — no correctness bugs found; all three prior review concerns have been resolved in follow-up commits

All 14 tools follow consistent patterns with correct GraphQL union type handling, accurate block param remapping, and proper type safety throughout. The three issues raised in previous review rounds (abstract error fragments, nullable $id intent, RepositoryNotFoundError SDL membership) were each verified and resolved. No P0 or P1 issues remain.

No files require special attention; dagster.ts block config is intentionally complex to wire 14 operations but is correctly implemented

Important Files Changed

Filename Overview
apps/sim/tools/dagster/utils.ts Shared GraphQL response utilities: correctly handles HTTP errors, GraphQL errors, and union error extraction with no issues
apps/sim/tools/dagster/types.ts Complete, well-typed interfaces for all 14 tool param/response shapes with no loose any types
apps/sim/tools/dagster/index.ts Barrel export for all 14 tools; correct and complete
apps/sim/blocks/blocks/dagster.ts Block config wiring all 14 operations with correct show/hide conditions, params remapping (listRunsJobName→jobName, logsLimit→limit, runId→parentRunId), and wandConfig AI-assisted fields
apps/sim/tools/dagster/launch_run.ts Dynamic mutation building with full union member coverage including RunConfigValidationInvalid, InvalidStepError, and 9 other concrete error types
apps/sim/tools/dagster/delete_run.ts Clean delete mutation with concrete RunNotFoundError, UnauthorizedError, PythonError union members
apps/sim/tools/dagster/get_run_logs.ts Paginated log retrieval via EventConnection union with concrete RunNotFoundError and PythonError error types
apps/sim/tools/dagster/reexecute_run.ts Reexecution mirrors launch_run union handling; parentRunId correctly supplied via block params remapping from shared runId subBlock
apps/sim/tools/dagster/list_schedules.ts Dynamic query with optional InstigationStatus filter; pipelineName correctly aliased to jobName in output
apps/sim/tools/dagster/list_sensors.ts Mirrors list_schedules correctly with optional sensorStatus filter and concrete RepositoryNotFoundError + PythonError
apps/sim/tools/dagster/start_schedule.ts ScheduleStateResult, UnauthorizedError, ScheduleNotFoundError, and PythonError all correctly handled
apps/sim/tools/dagster/stop_schedule.ts Nullable $id: String is intentional per Dagster schema; concrete ScheduleNotFoundError, UnauthorizedError, PythonError present
apps/sim/tools/dagster/start_sensor.ts startSensor returns Sensor type on success; SensorNotFoundError, UnauthorizedError, PythonError all covered
apps/sim/tools/dagster/stop_sensor.ts StopSensorMutationResult correctly identified as success type; UnauthorizedError and PythonError present
apps/sim/tools/dagster/terminate_run.ts Both TerminateRunSuccess and TerminateRunFailure (non-throwing union member) are correctly differentiated
apps/sim/tools/dagster/list_runs.ts Optional filter building correct; always-overridden jobName in params prevents stale launch_run value leaking
apps/sim/tools/dagster/list_jobs.ts Traverses all repositories and jobs; RepositoryNotFoundError confirmed as valid union member per Dagster SDL

Sequence Diagram

sequenceDiagram
    participant U as User
    participant SB as Dagster Block
    participant TC as Tool Config
    participant EX as Executor
    participant DA as Dagster GraphQL API
    participant RT as transformResponse

    U->>SB: Select operation (e.g. launch_run)<br/>Fill params (host, jobName, etc.)
    SB->>TC: config.tool(params) → "dagster_launch_run"
    SB->>TC: config.params(params) → coerce + remap fields
    EX->>DA: POST {host}/graphql<br/>Dagster-Cloud-Api-Token header<br/>Dynamic mutation/query + variables

    alt Success
        DA-->>EX: 200 { data: { launchRun: { __typename: "LaunchRunSuccess", run: { runId } } } }
        EX->>RT: parseDagsterGraphqlResponse → check HTTP ok + errors[]
        RT-->>SB: { success: true, output: { runId } }
        SB-->>U: runId output
    else Concrete union error (e.g. RunConfigValidationInvalid)
        DA-->>EX: 200 { data: { launchRun: { __typename: "RunConfigValidationInvalid", errors: [...] } } }
        EX->>RT: parseDagsterGraphqlResponse → no top-level errors, proceeds
        RT->>RT: concrete type check → throw RunConfigValidationInvalid: ...
        RT-->>SB: Error thrown
        SB-->>U: Typed error message
    else HTTP / transport failure
        DA-->>EX: 4xx/5xx or invalid JSON
        EX->>RT: response.ok === false → throw from parseDagsterGraphqlResponse
        RT-->>SB: HTTP error
        SB-->>U: Transport error
    end
Loading

Reviews (4): Last reviewed commit: "fix(dagster): always override jobName in..." | Re-trigger Greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

…tError, PresetNotFoundError, ConflictingExecutionParamsError, NoModeProvidedError)
@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 7e26b13. Configure here.

@waleedlatif1 waleedlatif1 merged commit 24af61d into staging Apr 7, 2026
12 checks passed
@waleedlatif1 waleedlatif1 deleted the dg-integration branch April 7, 2026 18:33
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