-
Notifications
You must be signed in to change notification settings - Fork 0
Add last-valid fallback for feature snapshots #105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,9 @@ | |
| class FeatureSnapshotRuntimeSettings: | ||
| feature_snapshot_path: str | None | ||
| feature_snapshot_manifest_path: str | None = None | ||
| feature_snapshot_fallback_mode: str | None = None | ||
| feature_snapshot_fallback_cache_dir: str | None = None | ||
| feature_snapshot_fallback_max_stale_days: int | None = None | ||
|
Comment on lines
+25
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Inserting these optional fields before Useful? React with 👍 / 👎. |
||
| strategy_config_path: str | None = None | ||
| strategy_config_source: str | None = None | ||
| dry_run_only: bool = False | ||
|
|
@@ -148,6 +151,9 @@ def evaluate_feature_snapshot_strategy( | |
| expected_config_name=runtime_config_name, | ||
| expected_config_path=runtime_config_path, | ||
| expected_contract_version=runtime_adapter.snapshot_contract_version, | ||
| fallback_mode=runtime_settings.feature_snapshot_fallback_mode, | ||
| fallback_cache_dir=runtime_settings.feature_snapshot_fallback_cache_dir, | ||
| fallback_max_stale_days=runtime_settings.feature_snapshot_fallback_max_stale_days, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When callers enable Useful? React with 👍 / 👎. |
||
| ) | ||
| guard_metadata = dict(guard_result.metadata) | ||
| if on_guard_metadata is not None: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This cache key preserves the iteration order of
required_columns, but the runtime path passesruntime_adapter.required_feature_columns, which is afrozenset. Because set iteration for strings changes with Python's hash seed, the successful run that writes the last-valid cache and a later failed run in a new process can compute different digest directories and reportlast_valid_missinginstead of using the saved snapshot. Since the guard itself treats required columns as a set, sort/deduplicate them before hashing.Useful? React with 👍 / 👎.