Skip to content

fix(canopy): test infra cleanup — snapshot 404, lockfile regen, warning silence, auto-regen workflow#250

Merged
pcalnon merged 4 commits intomainfrom
fix/canopy-test-infra-cleanup
May 7, 2026
Merged

fix(canopy): test infra cleanup — snapshot 404, lockfile regen, warning silence, auto-regen workflow#250
pcalnon merged 4 commits intomainfrom
fix/canopy-test-infra-cleanup

Conversation

@pcalnon
Copy link
Copy Markdown
Owner

@pcalnon pcalnon commented May 7, 2026

Summary

Bundle of four small, related fixes to bring canopy main back to green and
prevent the most recent class of CI failure from recurring.

Commit What Why
fix(api): restore distinct snapshot-directory-missing 404 message src/main.py Async-route audit Phase 3 (PR #247) collapsed two distinct 404 messages into one; test_real_mode_snapshot_dir_missing has been failing on all 4 matrix legs since 2026-05-06.
chore(deps): regenerate requirements.lock requirements.lock juniper-observability>=0.2.0 floor bump on 2026-05-06 left the lockfile pinned to 0.1.1, making the constraint-mode Lockfile Freshness gate (correctly) unsatisfiable.
test(canopy): silence expected DeprecationWarning pyproject.toml The _generate_spiral_dataset_local fallback is a real (deprecated) codepath several tests intentionally exercise; the 10+ warnings per CI run were noise, not signal. The pytest.warns assertion in test_juniper_data_integration is unaffected.
ci(lockfile): auto-regenerate on pull_request .github/workflows/lockfile-update.yml Closes the regen-race gap that produced this PR's parent failure. Manual pyproject.toml edits (not just Dependabot pushes) now trigger an auto-regen + commit-back to the PR branch.

Local verification

  • test_real_mode_snapshot_dir_missing and the rest of TestSnapshotDetailRealMode: 5 / 5 pass on Python 3.13 (JuniperCanopy1 env).
  • The four affected demo-mode test files (102 tests total): all pass with no warnings emitted.
  • Constraint-mode Lockfile Freshness gate (uv 0.11.8 + Python 3.14) reproduced locally — passes.

Test plan

  • CI: Pre-commit (3.12 / 3.13 / 3.14) green
  • CI: Unit Tests + Coverage (3.12 macos, 3.12 / 3.13 / 3.14 ubuntu) — 0 failed, 0 unexpected warnings
  • CI: Lockfile Freshness green
  • CI: Quality Gate green
  • After merge: confirm next pyproject.toml-touching PR triggers Update Lockfile workflow

References

🤖 Generated with Claude Code

pcalnon and others added 4 commits May 7, 2026 15:16
The async-route audit Phase 3 cleanup (PR #247) folded the directory
existence check into ``_find_snapshot_file`` for a single ``to_thread``
hop, but in the process collapsed two distinct 404 messages into one
generic ``Snapshot not found``. ``test_real_mode_snapshot_dir_missing``
asserts ``"directory" in response.json()["detail"].lower()`` and has
been failing on all four matrix legs since 2026-05-06.

Extend the helper return type to ``(file, stat, directory_missing)`` so
the route handler can emit the original ``Snapshot directory not found``
message without re-introducing a separate ``exists`` syscall on the
event loop.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
….2.0

pyproject.toml's juniper-observability floor was bumped to ``>=0.2.0``
on 2026-05-06 (register_or_reuse migration in juniper-observability
0.2.0) but the lockfile still pinned ``0.1.1``. The constraint-mode
Lockfile Freshness gate correctly flagged this as
``requirements are unsatisfiable``.

Regenerated with uv 0.11.8 + Python 3.14 (matching CI). Bumps:

- juniper-observability  0.1.1  -> 0.2.0  (direct)
- pydantic               2.13.3 -> 2.13.4 (transitive patch)
- pydantic-core          2.46.3 -> 2.46.4 (transitive patch)
- sentry-sdk             2.58.0 -> 2.59.0 (transitive patch)
- urllib3                2.6.3  -> 2.7.0  (transitive minor)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ning

Several tests intentionally exercise the
``DemoMode._generate_spiral_dataset_local`` fallback path that fires
when the JuniperData service is unreachable, polluting the CI summary
with 10+ DeprecationWarnings per run despite being expected:

- test_demo_mode_concurrency.py        (3 warnings)
- test_demo_mode_perform_reset.py      (1 warning)
- test_demo_mode_running_property.py   (5 warnings)
- test_startup_regression.py           (1 warning)

Add a targeted ``filterwarnings`` rule so the warning is silenced
during normal test runs. The
``test_juniper_data_integration::test_local_fallback_emits_warning``
case uses ``pytest.warns`` which captures warnings independently of
the global filter and continues to assert the deprecation is emitted.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…nges

Extends ``lockfile-update.yml`` so the regen+commit workflow also fires
on pull_request events that modify ``pyproject.toml``, not only on
Dependabot-authored pushes to ``dependabot/pip/**`` branches.

Closes the gap that caused this branch's parent failure: a manual
juniper-observability floor bump in pyproject.toml landed without a
matching lockfile regen, leaving main red until a follow-up commit.

Behaviour:

- ``push`` to ``dependabot/pip/**``: unchanged.
- ``pull_request`` touching ``pyproject.toml``: checks out the PR head
  branch, runs ``uv pip compile --upgrade``, commits and pushes back to
  the PR branch with a chore(deps) message. PRs from forks are skipped
  (no token, no third-party PRs in this single-author repo).
- main and develop are never pushed to directly — the regen always
  lands on the PR branch.

References notes/LOCKFILE_FRESHNESS_REDESIGN_2026-05-04.md (juniper-ml).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@pcalnon pcalnon self-assigned this May 7, 2026
Copy link
Copy Markdown
Owner Author

@pcalnon pcalnon left a comment

Choose a reason for hiding this comment

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

approved

@pcalnon pcalnon merged commit d8764f6 into main May 7, 2026
43 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.

1 participant