Skip to content

refactor: migrate endpoints.py do_roadblock() to toolbox's shared implementation - #864

Merged
k-rister merged 3 commits into
masterfrom
feat-endpoints-roadblock-migration
Aug 11, 2026
Merged

refactor: migrate endpoints.py do_roadblock() to toolbox's shared implementation#864
k-rister merged 3 commits into
masterfrom
feat-endpoints-roadblock-migration

Conversation

@k-rister

@k-rister k-rister commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

PERFNFV-462 — migrate endpoints.py's do_roadblock() to toolbox's shared implementation

  • endpoints.py maintained its own independent do_roadblock() (~110 lines, direct roadblock class instantiation) that diverged from toolbox.roadblock.do_roadblock — the implementation engine_lib.py already uses. Bug fixes to one weren't guaranteed to reach the other.
  • Migrated endpoints.py's do_roadblock() to a thin wrapper delegating to toolbox.roadblock.do_roadblock, keeping only the endpoint-specific pre-connect ping diagnostic and message-stream logging on top. Function signature unchanged, so no call site (endpoints.py, kube.py, remotehosts.py) needed updating.
  • The other half of PERFNFV-462 — consolidating the duplicated ROADBLOCK_EXITS dict between toolbox's messages.py and roadblock.py — was already fixed by a prior toolbox commit (b9b5a6d), so no toolbox changes are included here.
  • Added the first unit tests for endpoints.py's do_roadblock() (tests/test_endpoints_do_roadblock.py), mocking out toolbox/roadblock/fabric/invoke/paramiko via the existing SourceFileLoader pattern since CI doesn't check those out for this job.

PERFNFV-468 — gate crucible-ci on rickshaw's own unit tests

  • Adopts the same local-reusable-workflow gate pattern already proven on toolbox (PR#130): unittest.yaml becomes workflow_call-only, and crucible-ci.yaml's new call-unittest job runs it first, using the exact same if: condition as call-real-core-release-crucible-ci, added to both call-real's and crucible-ci-complete's needs:.
  • Unlike toolbox, rickshaw already had a standalone unittest.yaml whose unittest-complete job ran in parallel with, not gating, the expensive crucible-ci integration matrix. Removed that standalone trigger and its changes/faux-unittest/unittest-complete jobs entirely — crucible-ci.yaml's own changes/faux-path logic already covers the docs-only fast path.
  • Live repo-settings change: updated rickshaw's default-branch-required branch-protection ruleset to drop unittest-complete from required status checks (it can no longer report, since the workflow that produced it is gone), leaving crucible-ci-complete as the sole required check. Confirmed via the toolbox rollout that this is sufficient, since crucible-ci-complete transitively depends on the new gate. Synced .github/rulesets/branches/default-branch-required.json (documentation snapshot only) to match.
  • Also removed unittest.yaml from crucible-ci.yaml's own changes job skip-file list — it's the actual test payload now that it's wired into the gate, so a PR that only breaks the test-runner itself shouldn't be classified as docs-only and skip validating that exact breakage.

Refs: PERFNFV-462, PERFNFV-468

Test plan

  • pytest -v tests/*.py — 15/15 passing (9 pre-existing + 6 new)
  • py_compile clean
  • Verified via real import against the actual toolbox/roadblock repos on disk that the signature and missing-label ValueError guard still work
  • Mutation-tested the new suite (temporarily broke the hardcoded redis_server value) to confirm it actually fails on regressions, not just passes trivially
  • Confirmed no call site passes wait_for today (grepped all three call sites), so the signature-preserving wrapper approach has zero blast radius on callers
  • yaml.safe_load clean on both modified workflow files
  • Confirm this PR's own live CI run shows call-unittest gating call-real-core-release-crucible-ci, and that crucible-ci-complete is the only check GitHub is waiting on

🤖 Generated with Claude Code

…lementation

endpoints.py maintained its own 110-line do_roadblock() that instantiated
the roadblock class directly, diverging from toolbox.roadblock.do_roadblock
(already used by engine_lib.py). Bug fixes to one were not guaranteed to
reach the other.

Replace it with a thin wrapper that delegates the actual roadblock
mechanics to toolbox.roadblock.do_roadblock, keeping only the
endpoint-specific pre-connect ping diagnostic and message-stream logging
on top. The function signature is unchanged, so no call site (endpoints.py,
kube.py, remotehosts.py) needed updating.

The other half of PERFNFV-462 -- consolidating the duplicated
ROADBLOCK_EXITS dict between toolbox's messages.py and roadblock.py -- was
already fixed by a prior toolbox commit (b9b5a6d).

Adds the first unit tests for endpoints.py's do_roadblock(), following the
existing SourceFileLoader-based mocking pattern used for rickshaw-run.py's
tests, since CI does not check out toolbox/roadblock/fabric/invoke/paramiko
for this job.

Refs: PERFNFV-462

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@k-rister k-rister self-assigned this Aug 11, 2026
@project-crucible-tracking project-crucible-tracking Bot moved this to In Progress in Crucible Tracking Aug 11, 2026
@k-rister
k-rister requested a review from a team August 11, 2026 15:56
atheurer
atheurer previously approved these changes Aug 11, 2026
k-rister and others added 2 commits August 11, 2026 11:18
Adopts the same local-reusable-workflow gate pattern already proven on
toolbox (PERFNFV-468): unittest.yaml becomes workflow_call-only, and
crucible-ci.yaml's new call-unittest job runs it first, using the exact
same if: condition as call-real-core-release-crucible-ci, with
call-unittest added to both call-real's and crucible-ci-complete's
needs: (the latter is required so a failing gate actually surfaces as
crucible-ci-complete failing, not just as a skipped downstream job).

Unlike toolbox, rickshaw already had a standalone, independently
triggered unittest.yaml whose own unittest-complete job was a required
branch-protection check running in parallel with, not gating,
crucible-ci's expensive integration matrix. Removed that standalone
pull_request trigger and its changes/faux-unittest/unittest-complete
jobs entirely -- crucible-ci.yaml's own changes/faux-* logic already
covers the docs-only fast path. This is a real merge to a clean
gate-only shape, not an addition, so rickshaw's branch-protection
ruleset (default-branch-required) was updated to drop unittest-complete
from required status checks, leaving crucible-ci-complete as the sole
required check -- confirmed via the toolbox rollout that this is
sufficient, since crucible-ci-complete transitively depends on the gate.

Also removed unittest.yaml from crucible-ci.yaml's own changes job
skip-file list: it's the actual test payload now that it's wired into
the gate, not orchestration, so a PR that only breaks the test-runner
itself should not be classified as docs-only and skip validating that
exact breakage (same reasoning applied when toolbox's version was
deliberately left out of its own skip-list).

Refs: PERFNFV-468

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Mirrors the live rickshaw branch-protection ruleset update made as part
of gating crucible-ci on rickshaw's own unit tests: unittest-complete
is no longer required now that it's been removed as a standalone
top-level workflow (see previous commit), leaving crucible-ci-complete
as the sole required status check.

These files are documentation/tracking snapshots only (per
.github/rulesets/README.md) -- they don't drive GitHub's actual
enforcement, but should stay in sync with it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@k-rister
k-rister merged commit db086e5 into master Aug 11, 2026
420 of 422 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Crucible Tracking Aug 11, 2026
@k-rister
k-rister deleted the feat-endpoints-roadblock-migration branch August 11, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants