Keep orthophoto release evidence immutable
This commit is contained in:
@@ -277,6 +277,9 @@ def test_stage_fetches_one_allowlisted_map_and_writes_reviewable_rgb_evidence(tm
|
||||
assert manifest["normalized_geotiff"]["crs"] == "EPSG:31370"
|
||||
assert manifest["normalized_geotiff"]["band_count"] == 3
|
||||
assert Path(manifest["review_preview"]["path"]).read_bytes().startswith(b"\x89PNG")
|
||||
with pytest.raises(RuntimeError, match="will not be overwritten"):
|
||||
MANAGER.stage_artifacts(args, release_report, request, opener=opener)
|
||||
assert len(calls) == 1
|
||||
|
||||
|
||||
def test_getmap_redirect_and_response_limits_fail_closed(tmp_path: Path) -> None:
|
||||
@@ -397,6 +400,47 @@ def test_official_flight_dates_are_persisted_without_inventing_a_catalog_date()
|
||||
MANAGER.parse_flight_dates(["spring 2025"])
|
||||
|
||||
|
||||
def test_applied_evidence_is_immutable_on_idempotent_retry(tmp_path: Path) -> None:
|
||||
args, plan_path, plan, staged = staged_plan(tmp_path)
|
||||
manifest = MANAGER.validate_staged_artifacts(args, Path(staged["manifest_path"]))
|
||||
args.approve = True
|
||||
args.reviewer = "Jens"
|
||||
review = MANAGER.build_review_evidence(args, plan_path, plan, manifest)
|
||||
review_path = MANAGER.default_review_path(args, "2025.04")
|
||||
dataset = {
|
||||
"id": "dataset-1",
|
||||
"checksum_sha256": manifest["normalized_geotiff"]["sha256"],
|
||||
}
|
||||
final_report = report(status="current", local="2025.04")
|
||||
final_report["release"]["comparison_status"] = "same"
|
||||
|
||||
path, first = MANAGER.applied_evidence(
|
||||
args,
|
||||
plan_path,
|
||||
plan,
|
||||
review_path,
|
||||
review,
|
||||
dataset,
|
||||
final_report,
|
||||
reused=False,
|
||||
)
|
||||
original_bytes = path.read_bytes()
|
||||
_, second = MANAGER.applied_evidence(
|
||||
args,
|
||||
plan_path,
|
||||
plan,
|
||||
review_path,
|
||||
review,
|
||||
dataset,
|
||||
final_report,
|
||||
reused=True,
|
||||
)
|
||||
|
||||
assert second == first
|
||||
assert path.read_bytes() == original_bytes
|
||||
assert second["dataset_status"] == "imported"
|
||||
|
||||
|
||||
def test_release_manager_is_packaged_and_compiled_by_readiness() -> None:
|
||||
dockerfile = (ROOT / "deploy" / "unraid" / "Dockerfile.all-in-one").read_text(encoding="utf-8")
|
||||
readiness = (ROOT / "scripts" / "run_readiness_check.sh").read_text(encoding="utf-8")
|
||||
|
||||
Reference in New Issue
Block a user