Commit 1d13854
Add
Adds a new standalone `download-manifest` subcommand that allows users
to download dbt manifests from Dagster Plus for local development
without requiring a deploy session. This enables the dbt `--defer` flag
for slim CI workflows. The change also extracts shared project discovery
logic into a reusable helper to reduce duplication between the two
manifest commands.
## Key Changes
- Extract `_discover_dbt_projects()` helper to deduplicate DbtProject
discovery logic between `manage-manifest` and `download-manifest`
- Add `download-manifest` subcommand with `--components`, `--file`,
`--output`, and `--key-prefix` options for standalone manifest downloads
- Refactor `manage-manifest` to use the new discovery helper
- Consolidate dbt integration documentation into single `dbt.md` file
covering both commands
<details>
<summary>Files Changed</summary>
### Modified (2 files)
-
`dagster-oss/python_modules/libraries/dagster-dg-cli/dagster_dg_cli/cli/plus/integrations/dbt.py`
- Added discovery helper and new download-manifest command
-
`public/skills/skills/dagster-expert/skills/dagster-expert/references/cli/plus/INDEX.md`
- Updated to reference consolidated dbt.md file
### Added (1 file)
-
`public/skills/skills/dagster-expert/skills/dagster-expert/references/cli/plus/integrations/dbt.md`
- Combined documentation for both manifest management commands
### Deleted (1 file)
-
`public/skills/skills/dagster-expert/skills/dagster-expert/references/cli/plus/integrations/dbt-manage-manifest.md`
- Consolidated into dbt.md
</details>
## User Experience
**Before:**
```bash
# Requires DAGSTER_BUILD_STATEDIR (deploy session)
dg plus integrations dbt manage-manifest
```
**After:**
```bash
# Standalone download, no deploy session required
dg plus integrations dbt download-manifest --components . --output ./manifest.json
```
Users can now download dbt manifests locally for `--defer` / slim CI
without needing a deploy environment configured.
<details>
<summary>original-plan</summary>
# Plan: Add `dg plus integrations dbt download-manifest` command
## Context
Users want to download a dbt manifest from Dagster Plus for local
development without needing a CI deploy session. The existing
`manage-manifest` command requires a deploy session
(`DAGSTER_BUILD_STATEDIR`) and handles both upload and download based on
deployment context. The new command is download-only and standalone.
Manifests are currently stored at org scope with no deployment name in
the key, so there's one manifest per project. A `--deployment` flag is
deferred until the upload side is updated to support per-deployment
keys.
## Changes
### 1. Add `download_manifest_command` to `dbt.py`
**File:**
`dagster-oss/python_modules/libraries/dagster-dg-cli/dagster_dg_cli/cli/plus/integrations/dbt.py`
Add a new command to `dbt_group`:
```
dg plus integrations dbt download-manifest \
--components <path> | --file <path> \
[--key-prefix <prefix>] \
[--output <path>] \
[--organization <org>] \
[--api-token <token>]
```
- `--components` / `--file`: Same as `manage-manifest` - discovers
`DbtProject` instances
- `--key-prefix`: Same as `manage-manifest` - for artifact key
namespacing
- `--output`: Optional override for download destination (default:
`project.state_path/manifest.json`)
- Auth options via `@dg_api_options(organization_scoped=True)`
**Logic:**
1. Import `DbtProject` (with ImportError handling)
2. Validate `--components` or `--file` provided
3. Discover projects (reuse shared helper - see step 2)
4. For each project with a `state_path`:
- Compute key:
`f"{key_prefix}{os.fspath(project.state_path.joinpath('manifest.json'))}"`
- Download to `output_path` if provided, else `project.state_path /
"manifest.json"`
- If `--output` specified and multiple projects found, raise
`UsageError`
5. Call `download_organization_artifact(key, path, organization,
api_token)`
### 2. Extract shared project discovery helper
Same file. Both commands share identical DbtProject discovery logic (~20
lines). Extract into:
```python
def _discover_dbt_projects(components_path, file_path) -> list:
```
Refactor `manage_manifest_command` to use it too.
### 3. Update dagster-expert skill docs
**Current file:**
`public/skills/skills/dagster-expert/skills/dagster-expert/references/cli/plus/integrations/dbt-manage-manifest.md`
Rename to `dbt.md` and update to document both `manage-manifest` and
`download-manifest` commands with their options and usage. Then run
`make generate-index` from `public/skills/` to update the skill index.
## Verification
- Run `dg plus integrations dbt --help` to confirm `download-manifest`
appears
- Run `dg plus integrations dbt download-manifest --help` to confirm
options
- Run ruff for formatting
- Run `make generate-index` from `public/skills/`
- Check for existing tests in
`dagster_dg_cli_tests/cli_tests/plus_tests/` and add a test if a pattern
exists for the dbt integration commands
</details>
<!-- WARNING: Machine-generated. Manual edits may break erk tooling. -->
<!-- erk:metadata-block:plan-header -->
<details>
<summary>plan-header</summary>
```yaml
schema_version: '2'
created_at: '2026-03-26T15:57:48.324688+00:00'
created_by: OwenKephart
plan_comment_id: null
last_dispatched_run_id: null
last_dispatched_node_id: null
last_dispatched_at: null
last_local_impl_at: '2026-03-26T22:59:19.353465+00:00'
last_local_impl_event: started
last_local_impl_session: cd201a96-e8db-426f-90c4-4efd2e57f1e6
last_local_impl_user: owen
last_remote_impl_at: null
last_remote_impl_run_id: null
last_remote_impl_session_id: null
branch_name: plnd/add-dbt-download-manifest-03-26-1557
created_from_session: 3cf2e907-57fe-45b9-b1a0-cc607dbe0061
lifecycle_stage: impl
worktree_name: erk-slot-05
```
</details>
<!-- /erk:metadata-block:plan-header -->
---
To replicate this PR locally, run:
```
erk pr teleport 22095
```
Internal-RevId: cc9255c05a24ec5e9f48e52fc0989d018c1937badg plus integrations dbt download-manifest command (#22095)1 parent 765d5c7 commit 1d13854
1 file changed
Lines changed: 102 additions & 22 deletions
Lines changed: 102 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
9 | 13 | | |
10 | 14 | | |
11 | 15 | | |
| |||
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
18 | 47 | | |
19 | 48 | | |
20 | 49 | | |
| |||
54 | 83 | | |
55 | 84 | | |
56 | 85 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | 86 | | |
65 | 87 | | |
66 | 88 | | |
67 | 89 | | |
68 | 90 | | |
69 | 91 | | |
70 | | - | |
71 | | - | |
| 92 | + | |
72 | 93 | | |
73 | 94 | | |
74 | 95 | | |
| |||
89 | 110 | | |
90 | 111 | | |
91 | 112 | | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | 113 | | |
106 | 114 | | |
107 | 115 | | |
| |||
137 | 145 | | |
138 | 146 | | |
139 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
0 commit comments