Skip to content

Build(deps): bump mockable from 0.3.0 to 3.0.0#401

Merged
leynos merged 2 commits into
mainfrom
dependabot/cargo/mockable-3.0.0
Jul 22, 2026
Merged

Build(deps): bump mockable from 0.3.0 to 3.0.0#401
leynos merged 2 commits into
mainfrom
dependabot/cargo/mockable-3.0.0

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Jul 1, 2026

Copy link
Copy Markdown
Contributor

Bumps mockable from 0.3.0 to 3.0.0.

@dependabot @github

dependabot Bot commented on behalf of github Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Labels

The following labels could not be found: cargo, dependencies. Please create them before Dependabot can add them to a pull request.

Please fix the above issues or remove invalid values from dependabot.yml.

codescene-access[bot]

This comment was marked as outdated.

@dependabot
dependabot Bot force-pushed the dependabot/cargo/mockable-3.0.0 branch from 38368b8 to 34e3e8f Compare July 8, 2026 18:11
codescene-access[bot]

This comment was marked as outdated.

@leynos

leynos commented Jul 21, 2026

Copy link
Copy Markdown
Owner

@dependabot recreate

Bumps mockable from 0.3.0 to 3.0.0.

---
updated-dependencies:
- dependency-name: mockable
  dependency-version: 3.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot
dependabot Bot force-pushed the dependabot/cargo/mockable-3.0.0 branch from 34e3e8f to 54f45a2 Compare July 21, 2026 23:00
codescene-access[bot]

This comment was marked as outdated.

@leynos

leynos commented Jul 22, 2026

Copy link
Copy Markdown
Owner

@coderabbitai Please investigate the cause of the following issue using codegraph exploration and research, identify a fix and provide an AI coding agent prompt for the fix:

error[E0599]: no method named `raw` found for struct `mockable::env::MockEnv` in the current scope
Error:    --> tests/env_path_tests.rs:15:24
    |
15  |     let original = env.raw("PATH").context("mock PATH should be set")?;
    |                        ^^^ method not found in `mockable::env::MockEnv`
    |
note: there are multiple different versions of crate `mockable` in the dependency graph
   --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/mockable-0.3.0/src/env.rs:64:1
    |
64  | pub trait Env: Send + Sync {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^ this is the trait that is needed
...
231 |     fn raw(&self, key: &str) -> Result<String, VarError>;
    |     ----------------------------------------------------- the method is available for `mockable::env::MockEnv` here
    |
   ::: tests/env_path_tests.rs:5:5
    |
5   | use mockable::Env;
    |     ------------- `Env` imported here doesn't correspond to the right version of crate `mockable`
    |
   ::: /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/mockable-3.0.0/src/env.rs:50:1
    |
50  | pub trait Env: Send + Sync {
    | -------------------------- this is the trait that was imported

For more information about this error, try `rustc --explain E0599`.
error: could not compile `netsuke` (test "env_path_tests") due to 1 previous error
warning: build failed, waiting for other jobs to finish...
make: *** [Makefile:69: lint-clippy] Error 101

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '== Relevant repository files =='
fd -a '^(Cargo\.toml|Cargo\.lock|env_path_tests\.rs)$' .

printf '%s\n' '== Rust code map =='
ast-grep outline tests/env_path_tests.rs --items all 2>/dev/null || true
ast-grep outline . --type function,struct,trait --match 'Env|MockEnv|Path' 2>/dev/null || true

printf '%s\n' '== Test and manifest excerpts =='
for f in $(fd -a '^(Cargo\.toml|env_path_tests\.rs)$' .); do
  echo "--- $f"
  cat -n "$f"
done

printf '%s\n' '== Lockfile packages and dependency edges for mockable =='
python3 - <<'PY'
from pathlib import Path
import re
text = Path("Cargo.lock").read_text()
for block in re.split(r'\n(?=\[\[package\]\])', text):
    if re.search(r'^name = "(?:mockable|[^"]+)"$', block, re.M) and 'mockable' in block:
        print(block.strip())
        print()
PY

printf '%s\n' '== All relevant source references =='
rg -n -C 4 '\b(mockable|MockEnv|Env|\.raw\s*\()' -g '*.rs' -g 'Cargo.toml' -g 'Cargo.lock' .

Length of output: 177341


🤖 web_search executed:

Find the mockable Rust crate 3.0.0 documentation or repository release notes. Determine the mockable::env::Envtrait methods,MockEnvAPI, and the migration path from mockable 0.3.0, especially the replacement forEnv::raw.

Length of output: 12240


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '== Local test-support manifest and environment helper =='
cat -n test_support/Cargo.toml
sed -n '1,330p' test_support/src/env.rs
sed -n '1,110p' tests/env_path_tests.rs
sed -n '1,100p' tests/ninja_env_tests.rs

printf '%s\n' '== Exact Cargo.lock reverse dependencies for mockable =='
python3 - <<'PY'
from pathlib import Path
import tomllib

lock = tomllib.loads(Path("Cargo.lock").read_text())
packages = lock["package"]
for target in ("0.3.0", "3.0.0"):
    print(f"\nmockable {target}:")
    for package in packages:
        if package["name"] == "mockable" and package["version"] == target:
            print("  resolved:", package)
    print("  required by:")
    for package in packages:
        matches = [
            dep for dep in package.get("dependencies", [])
            if dep == "mockable" or dep.startswith(f"mockable {target}")
        ]
        if matches:
            print(f"    {package['name']} {package['version']}: {matches}")
PY

printf '%s\n' '== All mockable imports and MockEnv factory/use sites =='
rg -n -C 3 '^\s*use\s+mockable::|mockable::(?:Env|MockEnv)|\bmocked_path_env\s*\(|\bMockEnv::new\s*\(' \
  -g '*.rs' -g 'Cargo.toml' .

printf '%s\n' '== Pull request file changes =='
gh pr view 401 --repo leynos/netsuke --json files --jq '.files[] | "\(.path): +\(.additions) -\(.deletions)"'

Length of output: 17626


@leynos Cause: the workspace resolves two incompatible mockable crate versions.

  • Root Cargo.toml Line 168 upgrades the direct test dependency to mockable 3.0.
  • test_support/Cargo.toml Line 10 remains pinned to mockable 0.3.
  • test_support::env::mocked_path_env() therefore returns a 0.3 MockEnv, while tests/env_path_tests.rs Line 5 imports the 3.0 Env trait. Trait methods only apply when the trait and concrete type originate from the same crate version, so the 3.0 Env import cannot provide raw() for the 0.3 MockEnv.
  • mockable 3.0.0 has not removed or renamed Env::raw; its API still provides raw() and MockEnv::expect_raw().

Update test_support/Cargo.toml to depend on mockable = { version = "3.0", features = ["mock"] }, then regenerate Cargo.lock. This unifies the MockEnv, Env, and test_support::env::EnvMut types on 3.0.

Fix both affected integration-test paths, not only the reported Line 15 call:

  1. tests/env_path_tests.rs receives MockEnv from test_support::env::mocked_path_env().
  2. tests/ninja_env_tests.rs creates the root 3.0 MockEnv and passes it to test_support::env::override_ninja_env(), whose EnvMut bound currently uses 0.3. That test will otherwise become the next version-mismatch failure.

Use this coding-agent prompt:

Update pull request `#401`’s mockable upgrade so that every crate in the workspace uses mockable 3.0.0.

1. Edit `test_support/Cargo.toml`:
   - Change the `mockable` dependency from version `0.3` to version `3.0`.
   - Preserve `features = ["mock"]`.

2. Regenerate `Cargo.lock` using Cargo. Ensure it no longer resolves `mockable` 0.3.0 and resolves only `mockable` 3.0.0.

3. Do not replace `Env::raw()`:
   - `mockable` 3.0.0 still provides `Env::raw()` and `MockEnv::expect_raw()`.
   - Retain the existing `test_support/src/env.rs` implementations and the mock expectations unless compilation identifies an actual 3.0 API incompatibility.

4. Verify all version-coupled usages compile:
   - `test_support/src/env.rs`: `EnvMut: Env`, `impl EnvMut for MockEnv`, `mocked_path_env`, `prepend_dir_to_path`, and `override_ninja_env`.
   - `tests/env_path_tests.rs`: `mocked_path_env()` with `mockable::Env::raw()`.
   - `tests/ninja_env_tests.rs`: root `mockable::MockEnv` passed to `test_support::env::override_ninja_env()`.

5. Run:
   - `cargo tree -i mockable@0.3.0` and confirm it reports no dependency.
   - `cargo tree -i mockable@3.0.0` and confirm both the root package and `test_support` resolve to it.
   - The repository’s prescribed lint/test checks, including the failing target: `make lint-clippy` and the relevant integration tests.

Report the changed files and test results. Do not introduce duplicate renamed dependencies or a compatibility shim.

@leynos
leynos enabled auto-merge (squash) July 22, 2026 22:15
The mockable 3.0 bump updated only the workspace manifest, leaving
test_support pinned to 0.3. The lockfile then resolved two mockable
versions, so `test_support::EnvMut` was implemented for the 0.3 `MockEnv`
while tests supplied the 3.0 `MockEnv` — a distinct type — yielding
unsatisfied-trait-bound and missing-`raw` errors.

Bump test_support to mockable 3.0 so the whole workspace shares one
version. mockable 3.0 also makes `DefaultEnv` a unit struct without a
`new` constructor, so add a `system_env()` helper and route the
`SystemEnv::new()` call sites through it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
codescene-access[bot]

This comment was marked as outdated.

@codescene-access codescene-access 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.

No quality gates enabled for this code.

@leynos
leynos merged commit 5bb7d6e into main Jul 22, 2026
19 checks passed
@leynos
leynos deleted the dependabot/cargo/mockable-3.0.0 branch July 22, 2026 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant