UI: Pass Dag, DagRun, TaskInstance, and Asset objects to React app plugins#70149
Open
dheerajturaga wants to merge 1 commit into
Open
UI: Pass Dag, DagRun, TaskInstance, and Asset objects to React app plugins#70149dheerajturaga wants to merge 1 commit into
dheerajturaga wants to merge 1 commit into
Conversation
dheerajturaga
requested review from
bbovenzi,
choo121600,
guan404ming,
pierrejeambrun,
ryanahamilton,
shubhamraj-git and
vatsrahul1001
as code owners
July 21, 2026 00:02
…ugins Follows the pattern established in apache#69986, which enriched the props passed to React app plugins beyond bare route params by resolving assetUri from the UI's TanStack Query cache. This extends that pattern to the full context objects: React plugins now receive dag, dagRun, taskInstance, and asset as typed props alongside the existing route-id strings. Each object is resolved from the query cache and gated on the route params it depends on, so it is served from the cache the parent details page already populated (no extra request) where present, and is undefined on routes or destinations that lack those ids (e.g. nav, base, dashboard).
dheerajturaga
force-pushed
the
pass-context-objects-to-react-plugins
branch
from
July 21, 2026 00:07
8642279 to
69a335f
Compare
bbovenzi
reviewed
Jul 21, 2026
bbovenzi
left a comment
Contributor
There was a problem hiding this comment.
Let's update the documentation to let plugin developers know this and that its only for react plugins of course.
Comment on lines
+125
to
+134
| asset={asset} | ||
| assetId={assetId} | ||
| assetUri={assetUri} | ||
| dag={dag} | ||
| dagId={dagId} | ||
| dagRun={dagRun} | ||
| mapIndex={mapIndex} | ||
| runId={runId} | ||
| taskId={taskId} | ||
| taskInstance={taskInstance} |
Contributor
There was a problem hiding this comment.
Let's just make this a const pluginProps = {} and then we can pass the same content to plugin and lazy plugin. <Plugin {...pluginProps} /> A little more DRY
Comment on lines
+95
to
+114
| const { data: dag } = useDagServiceGetDagDetails({ dagId: dagId ?? "" }, undefined, { | ||
| enabled: Boolean(dagId), | ||
| }); | ||
|
|
||
| const { data: dagRun } = useDagRunServiceGetDagRun( | ||
| { dagId: dagId ?? "", dagRunId: runId ?? "" }, | ||
| undefined, | ||
| { enabled: Boolean(dagId) && Boolean(runId) }, | ||
| ); | ||
|
|
||
| const { data: taskInstance } = useTaskInstanceServiceGetMappedTaskInstance( | ||
| { | ||
| dagId: dagId ?? "", | ||
| dagRunId: runId ?? "", | ||
| mapIndex: mapIndex === undefined ? -1 : parseInt(mapIndex, 10), | ||
| taskId: taskId ?? "", | ||
| }, | ||
| undefined, | ||
| { enabled: Boolean(dagId) && Boolean(runId) && Boolean(taskId) }, | ||
| ); |
Contributor
There was a problem hiding this comment.
These should be fine and not firing any extra queries since they should already be cached.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows the pattern established in #69986, which enriched the props passed to React app plugins beyond bare route params by resolving assetUri from the UI's TanStack Query cache. This extends that pattern to the full context objects: React plugins now receive dag, dagRun, taskInstance, and asset as typed props alongside the existing route-id strings.
Each object is resolved from the query cache and gated on the route params it depends on, so it is served from the cache the parent details page already populated (no extra request) where present, and is undefined on routes or destinations that lack those ids (e.g. nav, base, dashboard).
Related: #69148
Screenshots from dummy plugin:

Was generative AI tooling used to co-author this PR?
Claude Code Opus 4.8