Commit 5fb70db
committed
fix(upload_assets): search all candidate staging dirs to resolve path-prefix mismatch (#39885)
The upload_assets (Push assets) job was failing with
ERR_SYSTEM: Asset file not found: .../safeoutputs/assets/<file>.png
even though the agent job succeeded, because assets were staged under a
different base prefix than the job was reading from.
Prior fixes (#39900, #40062) aligned individual paths, but the consumer
still derived a single assetsDir — so any remaining producer/consumer
prefix disagreement (e.g. RUNNER_TEMP=/home/runner/work/_temp vs the
artifact download path /tmp/gh-aw) still hard-failed the whole job.
Fix: build a de-duplicated list of candidate staging directories
1. parent of GH_AW_AGENT_OUTPUT (where the artifact was downloaded)
2. RUNNER_TEMP/gh-aw (where the MCP handler staged the file at runtime)
3. /tmp/gh-aw (canonical fallback)
The first candidate that contains the file wins. The existing fail-soft
behaviour (warn per missing file, only fail when all are missing) is
preserved. The missing-file warning now lists every directory searched.
Adds a regression test for the cross-prefix case.
Closes #398851 parent 494f04d commit 5fb70db
2 files changed
Lines changed: 65 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
93 | 99 | | |
94 | | - | |
95 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
96 | 111 | | |
97 | 112 | | |
98 | 113 | | |
| |||
130 | 145 | | |
131 | 146 | | |
132 | 147 | | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
137 | 159 | | |
138 | 160 | | |
139 | 161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 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 | + | |
178 | 211 | | |
179 | 212 | | |
0 commit comments