Skip to content

fix: gate CreateGenericStoreRequest import behind remote feature - #224

Merged
beinan merged 1 commit into
lance-format:mainfrom
beinan:fix/unused-import-create-generic-store-request
Jul 29, 2026
Merged

fix: gate CreateGenericStoreRequest import behind remote feature#224
beinan merged 1 commit into
lance-format:mainfrom
beinan:fix/unused-import-create-generic-store-request

Conversation

@beinan

@beinan beinan commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Problem

The Create Release run failed at the Update Cargo lock version step:

error: unused import: `CreateGenericStoreRequest`
 --> crates/lance-context/src/unified_generic.rs:4:51
  = note: `-D unused-imports` implied by `-D warnings`
error: could not compile `lance-context` (lib) due to 1 previous error

Cause

CreateGenericStoreRequest is used — by GenericStore::connect_or_create, which is #[cfg(feature = "remote")]. The import itself was unconditional, so in default-feature builds the symbol is imported but never referenced.

Note that simply deleting the import would break --features remote; the fix has to keep it available on that path.

Fix

Move the import into the existing #[cfg(feature = "remote")] group next to RemoteGenericStore, so it is present exactly where it is used.

Verification

Both configurations checked under the same -D warnings the release job uses:

  • RUSTFLAGS="-D warnings" cargo check -p lance-context → Finished
  • RUSTFLAGS="-D warnings" cargo check -p lance-context --features remote → Finished

🤖 Generated with Claude Code

`CreateGenericStoreRequest` is only referenced by `connect_or_create`,
which is `#[cfg(feature = "remote")]`. Importing it unconditionally made
it an unused import in default-feature builds, failing the release
workflow's `cargo check` under `-D warnings`.

Move the import into the existing `#[cfg(feature = "remote")]` group so
it is present exactly where it is used.

Co-Authored-By: Claude <noreply@anthropic.com>
@beinan
beinan merged commit 6b8e987 into lance-format:main Jul 29, 2026
8 checks passed
beinan added a commit that referenced this pull request Jul 29, 2026
Follow-up to #224, which fixed the immediate release breakage. This
addresses *why CI never caught it*.

## The gap

The two jobs compile `lance-context` with different feature sets:

| | command | `remote` |
|---|---|---|
| `style.yml` | `cargo clippy --workspace --all-targets` | **on** —
`--workspace` unions all members' features, and
lance-context-server/-client both enable it |
| `release.yml` | `cargo check --manifest-path
crates/lance-context/Cargo.toml` | **off** — `default = []` |

So CI has never compiled this crate in its default configuration. Code
behind `#[cfg(feature = "remote")]` is only ever seen in the enabled
state.

That is exactly how #224 slipped through: an import used solely by
`connect_or_create` (which is `remote`-gated) looked fine to
`--workspace` clippy and only became an unused import in the release
job's single-crate check.

## Change

Add one explicit clippy step covering the default-feature configuration
the release job actually uses.

## Verification

- On the offending commit, the new step reproduces the release failure
(`unused import: CreateGenericStoreRequest`).
- With #224 applied, it passes.

## Note

Stacked on #224, so this branch contains that fix too and its CI is
green. Merge #224 first and this diff reduces to the workflow change
alone.

A broader option is `cargo hack --feature-powerset` across the
workspace, which would cover every crate rather than just this one. That
is a heavier change in both CI time and setup, so I kept this targeted —
happy to go that route instead if you'd prefer.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude <noreply@anthropic.com>
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.

1 participant