Skip to content

#133 Patched the version management to handle the newer method FOCUS is using with hosting Requirements Model files#134

Merged
mike-finopsorg merged 6 commits intodevfrom
133-update-focus-validator-to-pull-requirements-model-from-latest-release-of-the-focus-repository
Feb 26, 2026
Merged

#133 Patched the version management to handle the newer method FOCUS is using with hosting Requirements Model files#134
mike-finopsorg merged 6 commits intodevfrom
133-update-focus-validator-to-pull-requirements-model-from-latest-release-of-the-focus-repository

Conversation

@mike-finopsorg
Copy link
Contributor

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

…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>
Copy link
Collaborator

@Matt-Cowsert Matt-Cowsert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Collaborator

@Matt-Cowsert Matt-Cowsert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

…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>
@mike-finopsorg mike-finopsorg merged commit 9bf159f into dev Feb 26, 2026
6 checks passed
@mike-finopsorg mike-finopsorg deleted the 133-update-focus-validator-to-pull-requirements-model-from-latest-release-of-the-focus-repository branch February 26, 2026 02:19
@Matt-Cowsert Matt-Cowsert mentioned this pull request Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants