Commit f08043e
committed
Fix get_artifact returning the TC API response instead of the artifact
This fixes a regression from 384afee
where we started using the taskcluster python client instead of making
requests manually.
The artifacts route is special because the API returns some JSON as part
of a 303 to the artifact's content URL. The previous code followed that
303. The python client does not. So instead we're getting the body which
looks like this: `{"type": "s3/...", "url": "whereverthe303pointsat"}`.
This fixed it by following the redirect manually to restore the previous
behavior.
I also fixed the test as the previous one was basically ignoring the
fact that taskcluster was returning a 303 and was mocking as if it
didn't exist.
It's worth noting that while it restores the behavior of returning the
artifact's content (as a ByteIO), it is still a breaking change as the
previous code used to return a Response object.
Fixes #8121 parent 90a12a6 commit f08043e
File tree
2 files changed
+20
-4
lines changed- src/taskgraph/util
- test
2 files changed
+20
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
| 174 | + | |
174 | 175 | | |
175 | 176 | | |
176 | 177 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
116 | 122 | | |
117 | 123 | | |
118 | 124 | | |
119 | 125 | | |
| 126 | + | |
120 | 127 | | |
121 | 128 | | |
122 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
123 | 132 | | |
124 | 133 | | |
125 | 134 | | |
126 | 135 | | |
127 | 136 | | |
128 | 137 | | |
129 | 138 | | |
130 | | - | |
| 139 | + | |
131 | 140 | | |
132 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
133 | 148 | | |
134 | 149 | | |
135 | 150 | | |
| |||
0 commit comments