Commit c048d2e
committed
fix(bots): give the engineer-bot e2e repro a token the env scrub can't strip
The bug-fix flow's REQUIRED tests/e2e repro authenticates through conftest.py,
which reads the token from DATABRICKS_TOKEN. But the engineer-bot runs pytest in
an agent-driven subprocess whose environment is scrubbed of every credential-
shaped variable (the engine's shared/env_scrub.py strips *TOKEN*/*SECRET*/... ),
so DATABRICKS_TOKEN is gone before pytest starts. The connection is then built
with access_token=None and hangs — observed on issue #791: every e2e test (incl.
existing, unmodified ones) stalled ~10 min per attempt until the 45-min job
timeout. The same warehouse/env is used by code-coverage.yml's e2e job, which
passes because it runs pytest directly (no agent, no scrub).
Fix (per the engine's centralize-bot-workflows design doc): pass the connection
details through a file instead of a credential-named env var.
- engineer-bot.yml: a new step writes host/http_path/token/user/catalog to
$RUNNER_TEMP/e2e-connection.json (built with jq so the secret is never shell-
interpolated; chmod 600) and exports its PATH to the author step as
DATABRICKS_TEST_CONFIG_FILE — a name env_scrub deliberately preserves.
- conftest.py: each connection fixture now falls back to that file when its env
var is absent (env var still wins). Normal CI and local dev leave the path var
unset, so the file dict is empty and behavior is byte-for-byte unchanged.
Author phase only: the follow-up phase deliberately runs mocked tests/unit and
forbids tests/e2e, so it needs no live token (left untouched).
Signed-off-by: eric-wang-1990 <e.wang@databricks.com>
Co-authored-by: Isaac1 parent fb25502 commit c048d2e
2 files changed
Lines changed: 81 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 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 | + | |
176 | 206 | | |
177 | 207 | | |
178 | 208 | | |
| |||
201 | 231 | | |
202 | 232 | | |
203 | 233 | | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
204 | 240 | | |
205 | 241 | | |
206 | 242 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
| 3 | + | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
5 | 38 | | |
6 | | - | |
7 | | - | |
| 39 | + | |
| 40 | + | |
8 | 41 | | |
9 | 42 | | |
10 | 43 | | |
11 | | - | |
12 | | - | |
| 44 | + | |
| 45 | + | |
13 | 46 | | |
14 | 47 | | |
15 | 48 | | |
16 | | - | |
17 | | - | |
| 49 | + | |
| 50 | + | |
18 | 51 | | |
19 | 52 | | |
20 | 53 | | |
21 | | - | |
22 | | - | |
| 54 | + | |
| 55 | + | |
23 | 56 | | |
24 | 57 | | |
25 | 58 | | |
26 | | - | |
27 | | - | |
| 59 | + | |
| 60 | + | |
28 | 61 | | |
29 | 62 | | |
30 | 63 | | |
31 | | - | |
32 | | - | |
| 64 | + | |
| 65 | + | |
33 | 66 | | |
34 | 67 | | |
35 | 68 | | |
| |||
0 commit comments