fix(ci): validate all test manifests before relocation

Merged
BL
18d ago
+20-1

Summary

Restoring an app-host test product rewrites each manifest as it goes. If a later manifest references a missing bundle, the restore fails after earlier manifests have already been relocated. Restore now validates and serializes every manifest before writing any of them, so a later validation failure leaves the downloaded product unchanged.

This protects against validation and serialization failures; it does not make multiple filesystem writes an atomic transaction.

Testing

  • The new regression fails on 4e81fbcf and passes on fdd01f61 with the same command:
    python3 tests/test_app_host_test_products.py TestProductHandoff.test_invalid_later_manifest_does_not_rewrite_earlier_products
  • python3 tests/test_app_host_test_products.py: all 15 tests pass on Linux using an exact source export. The new regression also passes on Windows. Two existing relocation fixtures assume POSIX path separators and fail identically on the original source on Windows.
  • Both commits ran the installed normal pre-commit hook successfully. verify-local.py --affected HEAD^ --list was used to inspect scope selection; it is a preview, not an executed static-check suite.

These checks exercise the portable product handoff code with real plist files. No Xcode build or macOS app execution was performed.

Changelog

none

Proof

CI tooling only; the regression compares all manifest bytes before and after the rejected restore.

Checklist

  • Behavior changes have added or updated tests
  • Reviewed with a subagent before merge (cmux-review), and all bot and human review comments resolved

AI assistance: Codex helped investigate, implement, and verify this change.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Fixes a bug in CI product restore where a later invalid manifest could leave earlier manifests already relocated. Restore now validates and serializes every manifest before writing any, so a validation failure leaves the downloaded product unchanged. Adds a regression test that fails on the old behavior.

Summary by CodeRabbit

  • Bug Fixes
    • Manifest files are now written only after all relocated manifests pass validation. If a manifest has a missing or unscoped test bundle, the restore operation fails without leaving previously processed manifests partially updated.