Skip to content

ci: fix Test job failure (broken since 0.7.3) + release-process cleanup#110

Merged
runonthespot merged 4 commits into
mainfrom
fix/ci-and-release-process
May 23, 2026
Merged

ci: fix Test job failure (broken since 0.7.3) + release-process cleanup#110
runonthespot merged 4 commits into
mainfrom
fix/ci-and-release-process

Conversation

@runonthespot
Copy link
Copy Markdown
Contributor

@runonthespot runonthespot commented May 23, 2026

Summary

CI has been failing on `main` since the 0.7.3 tag (Jan 25, 2026, ~4 months). This PR gets it green again and tightens the release process so the same class of bug is less likely.

Root cause of the CI failure

`cargo hack test --each-feature --workspace` runs the test suite once per feature permutation. Two ck-engine tests assumed the `fastembed` embedder was available:

  • `tests::test_subdirectory_search_uses_parent_ckignore`
  • `tests::test_multiple_ckignore_files_merge_correctly`

Both use `SearchMode::Semantic` with a default `ModelConfig` that asks for the `fastembed` provider, plus `threshold: 0.1`. Under permutations where `fastembed` was disabled (`--no-default-features` and `--features mixedbread`-only), `ck-embed::create_embedder_for_config` silently returned `DummyEmbedder` (zero vectors) instead of erroring. Every cosine similarity is then 0, nothing passes threshold, the assertions panic.

Introduced by commit 295b827 ("Add feature flags for Windows compatibility") which added the `fastembed`/`mixedbread` features and made `--each-feature` exercise permutations no one had tested before.

Fix: cfg-gate both tests with `#[cfg(feature = "fastembed")]` since they cannot meaningfully run without the embedder they're configured for.

Also in this PR

While I was in the release plumbing, fixed two longstanding fragility sources:

  1. Duplicated publish-crates jobs: `ci.yaml` and `release.yml` both had a `publish-crates` job firing on tag push. Two concurrent `cargo publish` runs against the same tag is a recipe for inconsistent state on crates.io (which is exactly what happened to 0.7.4 — only `ck-core` published, the other 8 are stuck at 0.7.2). Removed from `ci.yaml`; `release.yml` is the sole publisher.

  2. 9-file version bumps via sed: each release required `find . -name Cargo.toml -exec sed -i ...`. If a file was missed, `cargo publish` failed partway through, leaving crates.io in an inconsistent state. Moved all intra-workspace deps to `[workspace.dependencies]`. `ck-cli` now uses `version.workspace = true` like its peers. Future bumps touch one file (~9 lines). `CLAUDE.md` updated to match.

  3. Missing `ck-tui` in release.yml CRATES list: `release.yml` was publishing 8 of 9 crates. Added.

What this PR does NOT fix (separate follow-ups)

  • The actual 0.7.4 mess on crates.io (8 crates at 0.7.2, ck-core at 0.7.4). Recommend: merge this PR → bump to 0.7.5 → tag and let the consolidated release.yml publish a coherent set.
  • High/medium issues from code review (MCP sandbox escape, top-k-before-filter bug in scoped semantic search, weak Embedder trait, MCP pagination/snippet panics) — tracked separately.
  • Local macOS link error from ort 2.0.0-rc.11 needing CoreML.framework — separate from CI (CI's macos-latest doesn't hit it).
  • Windows test path is still disabled (esaxx-rs/ort MT/MD runtime mismatch — upstream issue).

Test plan

  • cargo fmt --all --check
  • cargo clippy --workspace --all-features --all-targets -- -D warnings
  • cargo hack test --each-feature --workspace (now passes on macos-latest and ubuntu-latest)
  • cargo publish --dry-run on leaf and dependent crates (verified workspace dep declarations work)
  • Manual: after merge, bump to 0.7.5, tag, validate that release.yml publishes all 9 crates cleanly to crates.io

🤖 Generated with Claude Code

runonthespot and others added 4 commits May 23, 2026 18:52
The release workflow's publish step was missing ck-tui, so it was
never published to crates.io as part of a release even though
ci.yaml's duplicate publish job included it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
test_subdirectory_search_uses_parent_ckignore and
test_multiple_ckignore_files_merge_correctly use SearchMode::Semantic
with threshold 0.1. Under --no-default-features (neither fastembed nor
mixedbread enabled) ck-embed falls back to DummyEmbedder which returns
all-zero vectors, so cosine similarity is 0 for everything and the
threshold filters out every result. The tests assert results exist,
so they panic.

These tests are specifically about semantic search interacting with
.ckignore — there's nothing meaningful to test without an embedder,
so cfg-gating is the right fix.

This is the actual root cause of the CI test failures on
\`cargo hack test --each-feature --workspace\` since 0.7.3.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two long-standing problems made every release fragile:

1. **Duplicated publish-crates jobs.** Both ci.yaml and release.yml
   fired `cargo publish` on tag push. ci.yaml's gated on the test
   matrix; release.yml's gated on the binary builds. Two concurrent
   publishers racing for the same tag invited inconsistent state on
   crates.io. Remove publish-crates from ci.yaml; release.yml is the
   sole canonical publisher.

2. **Manual version bumps across 9 files via sed.** ck-cli set its own
   `version`, every other crate hardcoded its sibling deps as
   `version = "0.7.4"` plus path. A bump touched 9 Cargo.toml files;
   if one was missed, `cargo publish` blew up partway through (which
   is what left 0.7.4 partially published — only ck-core landed on
   crates.io, the other 8 are stuck at 0.7.2).

   Move all intra-workspace deps into [workspace.dependencies] with
   explicit `path` + `version`. Each crate now declares siblings as
   `{ workspace = true }`, and ck-cli inherits `version.workspace`
   like its peers. Future bumps touch only:
     - workspace.package.version
     - the 8 sibling-dep version strings in workspace.dependencies
   Both live in the root Cargo.toml — one file, ~9 lines.

CLAUDE.md updated to match.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The previous fix used \`any(fastembed, mixedbread)\` but the tests'
default ModelConfig asks for the \`fastembed\` provider specifically.
Under \`--features mixedbread\` alone (no fastembed), ck-embed's
create_embedder_for_config takes the \`"fastembed"\` match arm,
sees fastembed isn't compiled, and silently returns DummyEmbedder.
DummyEmbedder produces zero vectors → cosine 0 → below threshold 0.1
→ tests panic.

Gate strictly on fastembed since that's what the tests actually
need to function.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@runonthespot runonthespot changed the title ci: fix build/release process (WIP) ci: fix Test job failure (broken since 0.7.3) + release-process cleanup May 23, 2026
@runonthespot runonthespot merged commit f48b337 into main May 23, 2026
14 checks passed
@runonthespot runonthespot deleted the fix/ci-and-release-process branch May 23, 2026 17:43
runonthespot added a commit that referenced this pull request May 23, 2026
First clean release after the publish-plumbing fixes:
- #110 consolidated workflows and simplified version bumps
- 8b21d68 added the User-Agent header that was making crates.io
  verification 403 and aborting every prior release mid-way

Supersedes the partially-published 0.7.4 (only ck-core landed on
crates.io). All nine crates ship 0.7.5 together.

See CHANGELOG.md for details.

Co-Authored-By: Claude Opus 4.7 (1M context) <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