Commit 01e8275
[cloud] refresh defs state pins when app-managed component mutations reload (#25834)
## Summary
Stacked on #25833.
On host cloud, code locations load with defs state versions pinned on
`CodeLocationDeployData.defs_state_info`, and a plain reload does not
refresh those pins — only the explicit `refreshDefsState` mutation does.
The Components-tab mutations (`setAppManagedComponent` /
`deleteAppManagedComponent`) write new state and then trigger a plain
reload, so the reloaded location loads against stale pins and the
just-written component doesn't appear until a separate "refresh
definitions state" click. In OSS/local dev this problem doesn't exist
because a reload always observes the latest state versions.
This PR makes the pin refresh part of the reload, scoped to the
app-managed component mutation path only:
-
**`BaseWorkspaceRequestContext.reload_code_location_with_latest_defs_state`**
(OSS): new hook whose default implementation is a plain
`reload_code_location` — correct for OSS, where reload already pulls
latest state.
- The OSS **`setAppManagedComponent` / `deleteAppManagedComponent`**
resolvers call the new hook instead of `reload_code_location`.
- **`CloudDagitWorkspaceRequestContext`** overrides the hook to first
replace the location's pinned `defs_state_info` with
`defs_state_storage.get_latest_defs_state_info()` (same logic as the
`refreshDefsState` mutation) via `cloud_storage.update_location`, then
trigger the reload — so the pins and the reload land together. All other
reload endpoints are unchanged.
## How I tested
- New test `test_set_app_managed_component_updates_defs_state_pins` in
the cloud dagit workspace graphql tests asserts the mutation repins the
location's `defs_state_info` to include the new component's state key.
- OSS graphql app-managed component e2e tests pass (exercise the new
hook through its default implementation).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Internal-RevId: 547a0bc854ef1259060f76102ad537f41ca520f91 parent eddfd4e commit 01e8275
2 files changed
Lines changed: 12 additions & 2 deletions
File tree
- python_modules
- dagster-graphql/dagster_graphql/implementation
- dagster/dagster/_core/workspace
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
383 | 383 | | |
384 | 384 | | |
385 | 385 | | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
386 | 396 | | |
387 | 397 | | |
388 | 398 | | |
| |||
0 commit comments