From 1bfe63f86d4ccb56e9e75f9a624eb3a2a48e17de Mon Sep 17 00:00:00 2001 From: Jan Rose Date: Thu, 22 Oct 2026 05:56:55 +0000 Subject: [PATCH] Run ruff via uv tool run so the SDK bumper can format pydabs The SDK bumper's image ships only the uv binary, not its uvx alias. pydabs-codegen's uvx ruff steps therefore failed there: the bumper's v0.190.0 PR (#7155) carried raw, unformatted pydabs codegen output with circular imports, which failed validate-generated, the Python tests and docs, and every pydabs acceptance test. bump-sdk-post stopped at that step, and generate-clijson-post ignores its error, so nothing surfaced in the bumper. - Call ruff as uv tool run ruff@0.15.17 (what uvx is an alias for) in python/Taskfile.yml and the root RUFF var. - bump-sdk skill: note that the bumper does not log the task's output and cannot run test-update (no ruff on PATH), and correct the claim that pypi.org is CI's default index. Co-authored-by: Isaac --- .agents/skills/bump-sdk/SKILL.md | 4 +++- .github/workflows/check.yml | 2 +- Taskfile.yml | 4 +++- python/Taskfile.yml | 9 +++++---- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.agents/skills/bump-sdk/SKILL.md b/.agents/skills/bump-sdk/SKILL.md index 4f257c10b4b..c9cc0e6aa0d 100644 --- a/.agents/skills/bump-sdk/SKILL.md +++ b/.agents/skills/bump-sdk/SKILL.md @@ -19,6 +19,8 @@ The acceptance goldens are the exception: they need CI's `uv` index, see step 4. The SDK bumper (eng-dev-ecosystem automation) does steps 1-4 for every new stable Go SDK release. It opens a PR from the `automation/go-sdk-vX.Y.Z` branch of `databricks/cli`, titled `Update Go SDK to vX.Y.Z`, containing the `go get` + `go mod tidy` result, `.codegen/_openapi_sha`, `.codegen/cli.json` (genkit, followed by `./task generate-clijson-post`), and a changelog fragment without a PR link. `generate-clijson-post` ends with `bump-sdk-post` (step 4), whose error it ignores so that the bumper, which aborts on any error there, still opens a PR. The PR therefore carries whatever got regenerated, and stays red while the bump needs hand fixes (step 5). +Nothing logs the task's output in the bumper, so judge from the PR what got regenerated. +The bumper's environment has `uv` and Python but no `ruff`, which the acceptance tests require, so `test-update` stops at `TestAccept/prerequisites` there and bumper PRs carry no golden updates. Bumper PRs opened before `generate-clijson-post` ran `bump-sdk-post` (e.g. #7138) have nothing downstream of `cli.json`: their stale command stubs usually fail to compile, which fails lint and every test job. The bumper does not merge CLI PRs, and it reuses an open PR for the same release on later runs, keeping commits pushed to its branch. @@ -55,7 +57,7 @@ Everything after it needs judgment. Run directly, it fails on errors: `generate-refschema` and `test-update` build the CLI, so it fails while the bump still breaks compilation; fix that (step 5) and rerun the task. Run it in CI's environment, or the goldens pick up local drift: -- `uv` index: the acceptance tests build wheels offline from the vendored packages (`UV_OFFLINE`, `UV_FIND_LINKS`), but `uv` still reads its default index's pages from the shared cache. If a `uv.toml` (e.g. `/etc/uv/uv.toml`, which applies even under the tests' temporary `HOME`) makes an internal PyPI proxy the default index, `uv` picks versions from cached proxy pages that it cannot download offline and fails with `No solution found when resolving: hatchling`; `-update` then bakes that error into dozens of template goldens and deletes their `output/` trees. The same failure on `main` tells it apart from bump fallout. Set `UV_DEFAULT_INDEX=https://pypi.org/simple`, CI's default, for the acceptance runs only: the generators fetch tools such as `ruff` and need the proxy where `pypi.org` is unreachable. On such a machine, run the task's two halves separately: `./task generate-check`, then `UV_DEFAULT_INDEX=https://pypi.org/simple ./task test-update` (and the same prefix for `./task test` later). If `generate-clijson` already ran `test-update` without it, first revert the `acceptance/` churn (`git checkout -- acceptance`, plus any stray untracked files it left). +- `uv` index: the acceptance tests build wheels offline from the vendored packages (`UV_OFFLINE`, `UV_FIND_LINKS`), but `uv` still reads its default index's pages from the shared cache. If a `uv.toml` (e.g. `/etc/uv/uv.toml`, which applies even under the tests' temporary `HOME`) makes an internal PyPI proxy the default index, `uv` picks versions from cached proxy pages that it cannot download offline and fails with `No solution found when resolving: hatchling`; `-update` then bakes that error into dozens of template goldens and deletes their `output/` trees. The same failure on `main` tells it apart from bump fallout. Set `UV_DEFAULT_INDEX=https://pypi.org/simple` for the acceptance runs only, so `uv` stops reading cached proxy pages (CI's test jobs point `UV_INDEX_URL` at a JFrog mirror instead): the generators fetch tools such as `ruff` and need the proxy where `pypi.org` is unreachable. On such a machine, run the task's two halves separately: `./task generate-check`, then `UV_DEFAULT_INDEX=https://pypi.org/simple ./task test-update` (and the same prefix for `./task test` later). If `generate-clijson` already ran `test-update` without it, first revert the `acceptance/` churn (`git checkout -- acceptance`, plus any stray untracked files it left). - Python: CI installs the managed interpreters with `./task install-pythons`; do the same. - Go: the `toolchain` in `go.mod`. A newer local `go` also changes goldens and generated `gofmt` output; use `GOTOOLCHAIN=` if they differ. diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 7035d574372..18ac52d8c32 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -42,7 +42,7 @@ jobs: - name: Run Go and Python lint checks (does not include formatting checks) # `task lint` runs golangci-lint and `ruff check` (lint-python). ruff is - # provided by uvx, installed above; formatting is checked by `task fmt` below. + # run via `uv tool run`, installed above; formatting is checked by `task fmt` below. run: go tool -modfile=tools/task/go.mod task lint - name: "task fmt: Python, Go and YAML formatting" diff --git a/Taskfile.yml b/Taskfile.yml index b41178fbe61..3c2a104b6a9 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -6,7 +6,9 @@ vars: EXE_EXT: '{{if eq OS "windows"}}.exe{{end}}' # Pinned ruff (linter + formatter). Keep in sync with the version in # .github/workflows/check.yml and python/Taskfile.yml. - RUFF: uvx ruff@0.15.17 + # `uv tool run` rather than its `uvx` alias: the SDK bumper's image ships + # only the `uv` binary. + RUFF: uv tool run ruff@0.15.17 TEST_PACKAGES: ./acceptance/internal ./libs/... ./internal/... ./cmd/... ./bundle/... ./experimental/ssh/... . ACCEPTANCE_TEST_FILTER: "" # Single brace-expansion glob covering every //go:embed target in the repo, diff --git a/python/Taskfile.yml b/python/Taskfile.yml index 137b567050a..811e8b88afe 100644 --- a/python/Taskfile.yml +++ b/python/Taskfile.yml @@ -44,8 +44,8 @@ tasks: cmds: # Pinned to match the global ruff version (see root Taskfile fmt-python and # .github/workflows/check.yml). ruff config lives in ../ruff.toml. - - uvx ruff@0.15.17 check --fix databricks databricks_tests || true - - uvx ruff@0.15.17 format + - uv tool run ruff@0.15.17 check --fix databricks databricks_tests || true + - uv tool run ruff@0.15.17 format pydabs-docs: desc: Generate pydabs documentation @@ -84,8 +84,9 @@ tasks: - cd codegen && uv run -m pytest codegen_tests - cd codegen && uv run -m codegen.main --output .. # Generated code is fixed and formatted by the global ruff (see ../ruff.toml). - - uvx ruff@0.15.17 check --fix databricks databricks_tests || true - - uvx ruff@0.15.17 format + # `uv tool run`, not `uvx`: the SDK bumper runs this with only `uv` installed. + - uv tool run ruff@0.15.17 check --fix databricks databricks_tests || true + - uv tool run ruff@0.15.17 format # The `uv run` invocations above rewrite the lockfiles with the internal # *.databricks.com PyPI proxy URL when uv/pip is proxy-configured (locally # or via setup-jfrog in CI). That is environment noise, not codegen output;