Skip to content

Deployment 0.3.69#317

Merged
konstantinoscs merged 7 commits into
mainfrom
develop
Jul 6, 2026
Merged

Deployment 0.3.69#317
konstantinoscs merged 7 commits into
mainfrom
develop

Conversation

@konstantinoscs

@konstantinoscs konstantinoscs commented Jul 3, 2026

Copy link
Copy Markdown
Contributor
  • New Features

    • Improved Tower catalog handling for tables with automatic selection between Tower-managed credentials and existing PyIceberg configuration.
    • Added catalog type detection with timeout plus negative caching to reduce repeated lookups.
  • Bug Fixes

    • Reduced repeated catalog-type describe calls by caching both successes and failures with a cooldown.
    • Cleared catalog-type cache when credential cache is cleared.
  • Chores

    • Updated npm publish workflow to Node.js 24 and simplified setup-node config.
    • Reshaped Linux/musllinux build matrices and refined artifact naming.
    • Bumped workspace/project version to 0.3.69.

Summary by CodeRabbit

  • New Features

    • Improved catalog handling so the app can better detect and choose the right credentials path for Tower-managed and existing configured catalogs.
  • Bug Fixes

    • Reduced repeated catalog lookups by caching catalog type checks for a short time.
    • Improved reliability when catalog description requests time out, with automatic recovery after a cooldown.
    • Updated Linux binary artifact naming and workflow matching for more consistent builds.
    • Adjusted package publishing and runtime setup to use a newer Node.js version and more predictable linking behavior.

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Updates build and publish workflows, adds package metadata and version bumps, changes Tower catalog routing to detect and cache catalog type, and adds conditional UV_LINK_MODE handling for spawned uv commands.

Changes

CI/Build Workflow Updates

Layer / File(s) Summary
Linux job matrix restructuring
.github/workflows/build-binaries.yml
Linux wheel jobs now use matrix.platform.target for build, test, and artifact naming.
Musllinux job matrix restructuring
.github/workflows/build-binaries.yml
Musllinux and musllinux-cross jobs now use the same platform.target matrix shape and updated artifact naming.
Node setup and release metadata
.github/workflows/publish-npm.yml, crates/tower-package/Cargo.toml, Cargo.toml, pyproject.toml
setup-node now uses Node 24, tower-package now inherits the workspace repository value, and the project/workspace versions were bumped to 0.3.69.

Tower catalog routing

Layer / File(s) Summary
Catalog type detection and caching
src/tower/_storage.py
Adds catalog type describe support, failure caching, debug logging, and cache clearing for Tower catalog type detection.
Credential vending decision in tables()
src/tower/_tables.py
Adds PyIceberg env detection helpers and routes tables() through Tower credential vending or direct catalog loading based on catalog type and config presence.
Test coverage for catalog type detection and vending
tests/tower/test_storage.py, tests/tower/test_tables.py
Adds coverage for catalog-type timeout/cooldown behavior, PyIceberg env detection, parameterized catalog precedence, and describe-response caching.

UV link mode handling

Layer / File(s) Summary
Conditional UV link mode
crates/tower-uv/src/lib.rs
Adds apply_link_mode and invokes it in UV command construction paths when no cache directory is configured.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

  • tower/tower-cli#267: Updates PyIceberg catalog environment-variable naming, which is directly related to the new env-based config detection in src/tower/_tables.py.
  • tower/tower-cli#306: Changes the same build-binaries workflow matrix wiring for Linux and musllinux jobs.
  • tower/tower-cli#309: Adds the Tower-vended credential flow that the new table-routing logic builds on.

Suggested reviewers: sammuti, bradhe

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is related to the version bump, but it is too generic to describe the main code and workflow changes in the PR. Use a specific title like "Bump deployment to 0.3.69 and update Tower catalog handling".
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch develop

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
tests/tower/test_tables.py (1)

174-178: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Missing test for the describe_catalog exception/failure path.

describe_catalog_api_sync here is only stubbed to return None or a DescribeCatalogResponse; there's no test where it raises (simulating a network error or timeout), which is exactly the except Exception branch in _describe_tower_catalog_type (src/tower/_storage.py, lines 142-156). Since this PR's stated goal is fixing credential-vending decisions for BYO/S3 tables, covering the "Tower API call fails" fallback-to-PyIceberg-config path would meaningfully harden this critical path.

def test_string_catalog_falls_back_when_describe_raises(monkeypatch):
    ...
    def describe_catalog_api_sync(name, client, environment):
        raise RuntimeError("boom")
    ...
    # assert fallback to _has_pyiceberg_catalog_config / load_catalog
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/tower/test_tables.py` around lines 174 - 178, Add a test that covers
the `describe_catalog` failure path in the Tower table catalog flow. In
`describe_catalog_api_sync`, simulate an exception (for example a
network/timeout failure) instead of only returning `None` or a
`DescribeCatalogResponse`. Verify `_describe_tower_catalog_type` in
`src/tower/_storage.py` takes the `except Exception` branch and falls back to
the PyIceberg catalog config path by checking `_has_pyiceberg_catalog_config` /
`load_catalog` behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/tower/_storage.py`:
- Around line 132-173: The Tower catalog lookup in _describe_tower_catalog_type
can hang indefinitely because describe_catalog_api.sync is called without a
bounded timeout, and failures are not cached so repeated loads keep retrying.
Update _describe_tower_catalog_type to pass a finite timeout through the Tower
client call path (via _env_client or the sync invocation) and make sure both
exception and ErrorModel fallback paths store a negative result in
_catalog_type_cache for the (ctx.tower_url, name, environment) key, so repeated
failures do not reissue the request.

---

Nitpick comments:
In `@tests/tower/test_tables.py`:
- Around line 174-178: Add a test that covers the `describe_catalog` failure
path in the Tower table catalog flow. In `describe_catalog_api_sync`, simulate
an exception (for example a network/timeout failure) instead of only returning
`None` or a `DescribeCatalogResponse`. Verify `_describe_tower_catalog_type` in
`src/tower/_storage.py` takes the `except Exception` branch and falls back to
the PyIceberg catalog config path by checking `_has_pyiceberg_catalog_config` /
`load_catalog` behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d7819fb6-37d0-4419-a7fc-20066b3bb5b1

📥 Commits

Reviewing files that changed from the base of the PR and between b0b12af and 472001b.

📒 Files selected for processing (6)
  • .github/workflows/build-binaries.yml
  • .github/workflows/publish-npm.yml
  • crates/tower-package/Cargo.toml
  • src/tower/_storage.py
  • src/tower/_tables.py
  • tests/tower/test_tables.py
💤 Files with no reviewable changes (1)
  • .github/workflows/publish-npm.yml

Comment thread src/tower/_storage.py

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
tests/tower/test_storage.py (1)

186-251: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Solid coverage of timeout + cooldown + recovery behavior.

Test logic correctly traces through _describe_tower_catalog_type's failure-cache/cooldown/recovery paths and matches the upstream contract in src/tower/_storage.py. One minor note: asserting client._timeout (Line 201) relies on a private attribute of the generated openapi-python-client Client. This works but is coupled to library internals rather than a public accessor.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/tower/test_storage.py` around lines 186 - 251, The test for
_describe_tower_catalog_type is asserting the generated Client’s private
_timeout attribute, which couples the test to openapi-python-client internals.
Update the timeout assertion to use a public-facing behavior or observable
effect from describe_catalog_api.sync instead, while keeping the same coverage
for the timeout/cooldown/recovery flow in _describe_tower_catalog_type.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@tests/tower/test_storage.py`:
- Around line 186-251: The test for _describe_tower_catalog_type is asserting
the generated Client’s private _timeout attribute, which couples the test to
openapi-python-client internals. Update the timeout assertion to use a
public-facing behavior or observable effect from describe_catalog_api.sync
instead, while keeping the same coverage for the timeout/cooldown/recovery flow
in _describe_tower_catalog_type.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e5a4e320-bbc2-4c6e-9a25-7579495adbb8

📥 Commits

Reviewing files that changed from the base of the PR and between 472001b and 47485dd.

📒 Files selected for processing (2)
  • src/tower/_storage.py
  • tests/tower/test_storage.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/tower/_storage.py

konstantinoscs and others added 2 commits July 6, 2026 13:28
* fix(tower-uv): use copy link mode when no cache dir is set

When no explicit cache dir is configured, uv uses its default cache
(~/.cache/uv). In containerized or sandboxed execution that default
often lives on a different filesystem than the target venv, so uv can't
hardlink across the two (EXDEV) and prints a noisy "Failed to hardlink
files; falling back to full copy" warning into the setup logs.

Force UV_LINK_MODE=copy on the sync/pip/run commands in that case so the
warning is suppressed (uv was already falling back to copy anyway).
Callers that pass an explicit cache dir on the same filesystem as the
venv are unaffected and keep fast hardlink/clone.

* docs(tower-uv): simplify apply_link_mode comment

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
crates/tower-uv/src/lib.rs (1)

305-343: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

venv() should use the shared link-mode override too. uv venv still seeds packages from the cache, so skipping self.apply_link_mode(&mut cmd) here can leave the hardlink-attempt warning in place when cache_dir is unset. Add the same call used by sync and run before spawn().

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/tower-uv/src/lib.rs` around lines 305 - 343, The venv() command
builder in tower-uv::lib::UV should also apply the shared link-mode override
before spawning uv, since uv venv can still trigger the hardlink fallback
warning when cache_dir is unset. Update the venv() method to call
apply_link_mode on the Command just like the sync and run paths do, so the
UV_LINK_MODE copy setting is consistently applied in all uv invocations.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@crates/tower-uv/src/lib.rs`:
- Around line 305-343: The venv() command builder in tower-uv::lib::UV should
also apply the shared link-mode override before spawning uv, since uv venv can
still trigger the hardlink fallback warning when cache_dir is unset. Update the
venv() method to call apply_link_mode on the Command just like the sync and run
paths do, so the UV_LINK_MODE copy setting is consistently applied in all uv
invocations.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 85e86252-f2f9-4b00-853c-83cfcd4ffcca

📥 Commits

Reviewing files that changed from the base of the PR and between dc0d264 and f4777a6.

📒 Files selected for processing (1)
  • crates/tower-uv/src/lib.rs

@konstantinoscs konstantinoscs merged commit 8dd7b04 into main Jul 6, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants