refactor: move MAX_MACH to aircraft design namespace - #2
Conversation
- Make patch_metadata() idempotent by checking if MAX_MACH is already correctly positioned after MAX_FUSELAGE_PITCH_ANGLE with the expected description before making any changes - Strip multiple blank lines when reinserting the MAX_MACH metadata block to ensure exactly one blank line separator is maintained - Only rewrite the manifest when there are actual content migrations (python_symbol or serialized_key replacements > 0) to preserve the historical 50-file migration record on idempotent re-runs This fixes the failing CI check that runs the migration tool twice and expects zero git diff on the second run. Co-authored-by: Suhas <suhaslord@users.noreply.github.com>
|
Fixed the "Verify MAX_MACH migration idempotence" CI check failure. Issues Fixed
VerificationThe migration tool now passes the CI check: python3 tools/migrate_max_mach_namespace.py --write --check
git diff --exit-code # Clean on second runBoth runs produce zero git diff on codebase files, ensuring true idempotence. |
- Split long metadata_block call lines for readability - Remove trailing whitespace from blank line Fixes pre_commit/ruff-format CI check. Co-authored-by: Suhas <suhaslord@users.noreply.github.com>
Ruff prefers the shorter call to fit on a single line for readability. Co-authored-by: Suhas <suhaslord@users.noreply.github.com>
|
✅ CI checks now passing Both required checks are now green:
The formatting fix ensures the migration script follows the ruff code style while maintaining idempotence. |
Implements the repository-wide foundation for OpenMDAO#1046.
Why
MAX_MACHis an aircraft design property, but Aviary currently exposes and serializes it asMission.Constraints.MAX_MACH. That leaks a mission-scoped name into FLOPS pre-mission sizing, aircraft input decks, validation data, and tests.What changed
Aircraft.Design.MAX_MACH = 'aircraft:design:max_mach'Aircraft.Design.MAX_MACHaircraft:design:max_machmission:constraints:max_machbeforeAviaryValuesstorage/access and CSV metadata validationMigration audit
The generated manifest records 50 migrated repository files, 57 Python-symbol replacements, and 24 serialized-key replacements. Compatibility-only files are deliberately excluded from the no-legacy-reference ratchet.
Scope
This is a namespace/data-model migration. The FLOPS equations themselves are unchanged. Full Aviary CI is validating numerical behavior and legacy input-deck compatibility before any upstream submission.