Commit d2b2436
committed
feat(cli): add --extra-yaml to cci task run
cci task run uses a custom RunTaskCommand MultiCommand. It must
resolve --extra-yaml before get_task() runs. If it does not, any task
defined only in the extra YAML is invisible to the runtime.
RunTaskCommand.resolve_command reads --extra-yaml from the raw args
list and calls CliRuntime.reload_project_config with the merged YAML.
Both --extra-yaml PATH and --extra-yaml=PATH are accepted.
The peek happens in resolve_command, not in get_command. Click's
MultiCommand protocol calls resolve_command(ctx, args), which then
calls get_command(ctx, cmd_name). By the time get_command runs,
ctx.args is empty. The remaining args stay in the args parameter
passed to resolve_command. We override resolve_command so that we can
see --extra-yaml while the project config is still mutable.
Adds "extra_yaml" to the specials list in core/tasks.py, alongside
debug_before, debug_after, and no_prompt. Click passes extra_yaml as
a kwarg on the task subcommand, which merges into
task_config.config["options"]. Tasks that use the Pydantic Options
form with extra='forbid' would reject it. The specials list already
exists to handle exactly this case.1 parent 220b230 commit d2b2436
3 files changed
Lines changed: 117 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
124 | 147 | | |
125 | 148 | | |
126 | 149 | | |
| |||
140 | 163 | | |
141 | 164 | | |
142 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
143 | 177 | | |
144 | 178 | | |
145 | 179 | | |
146 | 180 | | |
147 | 181 | | |
148 | 182 | | |
149 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
150 | 198 | | |
151 | 199 | | |
152 | 200 | | |
| |||
285 | 333 | | |
286 | 334 | | |
287 | 335 | | |
| 336 | + | |
288 | 337 | | |
289 | 338 | | |
290 | 339 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
52 | 104 | | |
53 | 105 | | |
54 | 106 | | |
| |||
110 | 162 | | |
111 | 163 | | |
112 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
113 | 177 | | |
114 | 178 | | |
115 | 179 | | |
| |||
126 | 190 | | |
127 | 191 | | |
128 | 192 | | |
129 | | - | |
| 193 | + | |
130 | 194 | | |
131 | 195 | | |
132 | | - | |
| 196 | + | |
133 | 197 | | |
| 198 | + | |
134 | 199 | | |
135 | 200 | | |
136 | 201 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
| 161 | + | |
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| |||
0 commit comments