Commit ed316e0
authored
Add working CI (#82)
* Fix Databricks pypi proxy hostname
The hostname is pypi-proxy.cloud.databricks.com (hyphen), not
pypi.proxy.cloud.databricks.com — the dotted form doesn't resolve.
* Add network egress diagnostics to CI test job
Confirms whether the runner can reach files.pythonhosted.org,
pypi-proxy.cloud.databricks.com, and pypi.org. Earlier runs suggested
the runner can reach pythonhosted directly (wheel downloads succeed)
but can't reach the proxy or pypi.org for /simple/ lookups. Run this
to get hard evidence before talking to the runner-group owners.
Errors are tolerated so we see all three results before pytest runs.
* Switch CI to standard ubuntu-latest runners
The databricks-protected-runner-group's egress firewall blocks TLS to
pypi.org and pypi-proxy.cloud.databricks.com (only files.pythonhosted.org
is reachable for TLS handshakes), which prevents uv from resolving
build-isolation deps like setuptools to compile thrift's sdist.
Other Databricks Python repos (e.g. databricks-ai-bridge) run their
pytest CI on plain ubuntu-latest with no proxy and it works fine.
Switch both jobs to match. The test job has no need for protected
egress, and e2e only uses secrets passed via env, which work the
same on either runner.
Also removes the now-unused UV_INDEX_URL env var and the temporary
network diagnostic step.
* Strip ANSI before substring-asserting on typer help output
CI runners (e.g. GitHub Actions ubuntu-latest) set FORCE_COLOR=1, which
makes rich/typer render --help with SGR escapes that split styled tokens
across ANSI codes. ``"--agents" in result.output`` then fails because the
rendered output is actually ``--\x1b[0m\x1b[1magents``. The test passed
locally because non-TTY runs don't get colored.
Strip ANSI before checking so the assertion holds either way.
* Fix pre-existing ruff format and ty failures
- ruff format: auto-formatted src/ucode/databricks.py (collapsed lines
ruff now considers fitting under the 100-char limit).
- ty: typed the run() wrapper with @overload so text=True narrows to
CompletedProcess[str] (every caller that reads the return value uses
text=True). Also guard _scrub_json's dict-key match against non-str
keys so re.Pattern[str].search gets a str.
Test suite stays at 535 passing.
* Drop accidentally-committed local-only files
The prior commit ran `git add -A` and swept up local-only scratch files
(.antigravitycli/, .claude/, .vscode/, OPENCODE_PLAN.md, mlflow.db,
scripts/) that should never have been tracked. Removing them from the
index — they remain on disk locally.
* Close stdin on the e2e pytest run
The Databricks CLI's `auth login --no-browser` fallback path reads stdin
for the user to paste an OAuth code. In CI the runner's stdin sometimes
keeps the subprocess alive past Python's timeout, hanging the whole job
for the full ~6h workflow limit. Redirecting stdin to /dev/null makes
that fallback EOF immediately, so if M2M env vars don't yield a token
we fail fast with a clear error instead of hanging.
* Add M2M auth diagnostic step before e2e pytest
Last CI run failed with `Databricks CLI returned no access token` after
get_databricks_token's pytest fixture couldn't authenticate via M2M env
vars. The CLI's stderr is captured (and discarded) by ucode so we never
see *why* M2M failed. This diagnostic step prints the CLI version, which
auth env vars are set, whether ~/.databrickscfg exists, and the raw
output of `databricks auth token` + `current-user me` so the next run
will tell us exactly what's wrong.
* Use DATABRICKS_BEARER as CI escape hatch for e2e auth
`databricks auth token` only returns cached user-OAuth tokens (from
`databricks auth login`) — it has no M2M path. Hosted-runner CI has no
~/.databrickscfg and no cached login, so the CLI command always errors
with "OAuth is not configured for this host", and ucode's token helper
hangs on the `auth login --no-browser` fallback waiting for stdin.
Teach has_valid_databricks_auth and get_databricks_token to short-circuit
to a pre-fetched DATABRICKS_BEARER env var (the same env var
build_auth_shell_command already honors). The e2e workflow pulls it from
a repo secret; user fetches a fresh bearer (e.g. M2M client_credentials
against /oidc/v1/token) and pastes it into Settings → Secrets when the
token expires (~1h).
Removes DATABRICKS_CLIENT_ID/_SECRET from the workflow — they're no longer
load-bearing now that we don't call the CLI for auth.
* Fix e2e test monkeypatches + bump web-search timeout
- tests/test_e2e.py: TestConfigureSubset patches `run_databricks_login`
at the wrong module path. cli.py does `from ucode.databricks import
run_databricks_login`, so patching `ucode.databricks.run_databricks_login`
doesn't affect the local name cli uses, and the real function runs
(which opens a browser). Patch `ucode.cli.run_databricks_login` instead.
- mcp_web_search.py: bump urllib timeout from 60s to 180s. Codex
Responses API with native web_search does a real web fetch + LLM
completion, which legitimately can exceed 60s under load.
* Install agent CLIs in CI so launch tests don't skip
The six TestXxxLaunch tests all call `_require_binary("...")` and skip
when the agent isn't on PATH. The runner has only Node.js, not the
agents themselves, so every launch test skipped. Install all six
via `npm install -g` so they exercise real binaries against the e2e
workspace.1 parent d5f2671 commit ed316e0
5 files changed
Lines changed: 94 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
| 14 | + | |
19 | 15 | | |
20 | 16 | | |
21 | 17 | | |
22 | 18 | | |
23 | 19 | | |
24 | 20 | | |
25 | 21 | | |
26 | | - | |
27 | | - | |
28 | | - | |
| 22 | + | |
29 | 23 | | |
30 | | - | |
31 | 24 | | |
32 | 25 | | |
33 | | - | |
34 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
40 | 51 | | |
41 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
95 | | - | |
| 93 | + | |
96 | 94 | | |
97 | 95 | | |
98 | 96 | | |
| |||
127 | 125 | | |
128 | 126 | | |
129 | 127 | | |
130 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
131 | 133 | | |
132 | 134 | | |
133 | 135 | | |
| |||
225 | 227 | | |
226 | 228 | | |
227 | 229 | | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
228 | 254 | | |
229 | 255 | | |
230 | 256 | | |
| |||
331 | 357 | | |
332 | 358 | | |
333 | 359 | | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
334 | 365 | | |
335 | 366 | | |
336 | 367 | | |
| |||
419 | 450 | | |
420 | 451 | | |
421 | 452 | | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
422 | 464 | | |
423 | 465 | | |
424 | 466 | | |
| |||
429 | 471 | | |
430 | 472 | | |
431 | 473 | | |
432 | | - | |
433 | | - | |
434 | | - | |
| 474 | + | |
435 | 475 | | |
436 | 476 | | |
437 | 477 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
12 | 23 | | |
13 | 24 | | |
14 | 25 | | |
| |||
68 | 79 | | |
69 | 80 | | |
70 | 81 | | |
71 | | - | |
72 | | - | |
73 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
74 | 86 | | |
75 | 87 | | |
76 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
216 | | - | |
| 216 | + | |
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | | - | |
| 251 | + | |
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
284 | | - | |
| 284 | + | |
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
| |||
0 commit comments