Allow checkpoint-only version artifact directories#198
Conversation
|
Closing rather than merging — same situation as #155. microplex-us went spec-only in #261 and is archived; On the change itself: the logic was careful and the safety property holds. Reuse only triggers when every entry under the version dir resolves inside a configured checkpoint tree, so a stray real artifact still raises FileExistsError, and it fails closed when checkpoints aren't configured. The stage_runtime_writer pass-through was a correct consistency fix. One coupling worth knowing if it's ever ported: the checkpoint-root helper hardcodes the two checkpoint config keys, so a third checkpoint stage would fail allocation until added — safe, but worth a comment in any successor. |
Summary
Fixes #179.
stage_runtime_writerthroughsave_versioned_us_microplex_artifacts()to match the existing_finalize_versioned_build_artifacts()call path.Notes on Scope
The checkpoint-only directory allowance is the direct #179 fix. While validating the full versioned-artifacts test file, current
mainalso exposed an adjacent finalization mismatch:_finalize_versioned_build_artifacts()already passedstage_runtime_writer, butsave_versioned_us_microplex_artifacts()did not accept or forward it. This PR includes that small pass-through so the live stage-runtime path remains consistent.Tests
ruff check src/microplex_us/pipelines/versioned_artifacts.py tests/pipelines/test_versioned_artifacts.pygit diff --checkPYTHONPATH=/Users/administrator/Documents/PolicyEngine/microplex-us/src PYTHONDONTWRITEBYTECODE=1 /Users/administrator/Documents/PolicyEngine/worktrees/microplex-us/fix-pe-rebuild-smoke-issues/.venv/bin/python -m pytest -q -p no:cacheprovider tests/pipelines/test_versioned_artifacts.py -k 'configured_checkpoint or unrelated_existing or unconfigured_checkpoint or existing_version_file'PYTHONPATH=/Users/administrator/Documents/PolicyEngine/microplex-us/src PYTHONDONTWRITEBYTECODE=1 /Users/administrator/Documents/PolicyEngine/worktrees/microplex-us/fix-pe-rebuild-smoke-issues/.venv/bin/python -m pytest -q -p no:cacheprovider tests/pipelines/test_artifacts.py::test_source_provider_versioned_build_initializes_live_stage_writerA full
tests/pipelines/test_versioned_artifacts.pyrun passed before the final non-directory guard was added; after the guard, the focused allocator tests above cover the changed behavior.