#133 Patched the version management to handle the newer method FOCUS is using with hosting Requirements Model files#134
Conversation
…ing with hosting Requirements Model files. Enabling users to find the latest patched version of RM. Bumped version to 2.0.2 for release Signed-off-by: Mike Fuller <mike@finops.org>
Signed-off-by: Mike Fuller <mike@finops.org>
Matt-Cowsert
left a comment
There was a problem hiding this comment.
Nice work on the semantic version matching, Mike. The design decision to key by model version from filename (instead of release tag) is the right call — it correctly handles patched models shipping in later releases.
Version bump and pyproject.toml changes look clean.
Non-blocking comments
1. No tests for new version-matching logic
Four new helpers (_parse_version_from_filename, _parse_version_tuple, _find_best_version_match, _filter_to_highest_versions) are pure functions with zero test coverage. test_spec_rules_unsupported_version.py already exists and tests version resolution, so extending it would be natural. The prefix-matching logic in _find_best_version_match is subtle enough to warrant edge case tests (e.g., requesting "1" vs "1.2" vs "1.2.0").
2. _parse_version_tuple fails silently on malformed versions
A filename like model-1.2.abc.json would silently parse to (0,) and sort to the bottom. Consider a log.warning so operators can spot corrupted filenames.
3. Double JSON parse in load_rules
The model JSON gets parsed twice: once by load_json_rules_with_dependencies_and_types and again by load_json_rules (to read FOCUSVersion/ModelVersion from Details). If the first call already parses the full JSON, you could extract Details there and avoid the second read. Low priority.
…loads Added warning for malformed versions Added unittests for new version handling Dropped old model file from repo Signed-off-by: Mike Fuller <mike@finops.org>
Signed-off-by: Mike Fuller <mike@finops.org>
Signed-off-by: Mike Fuller <mike@finops.org>
Signed-off-by: Mike Fuller <mike@finops.org>
Enabling users to find the latest patched version of RM.
Bumped version to 2.0.2 for release
Signed-off-by: Mike Fuller mike@finops.org