fix(sdk/python/core): honor kms_cache_file_name override in KSMCache cache path (KSM-1019)#1045
Closed
mgallego-keeper wants to merge 1 commit into
Closed
Conversation
…cache path PR #1034 (KSM-1004) routed cache operations through get_cache_file_path(), which re-derived the path from KSM_CACHE_DIR and ignored the kms_cache_file_name class attribute. Assigning KSMCache.kms_cache_file_name was silently dropped. Honor an explicit kms_cache_file_name override again (detected via an import-time default snapshot) while keeping lazy KSM_CACHE_DIR resolution. Add a regression test and bump to 17.3.1 (including the keeper_globals hardcoded fallback and smoke-test assertions). Fixes #1044.
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jira: KSM-1019 · Fixes #1044
Summary
PR #1034 (KSM-1004) rerouted
KSMCache.save_cache/get_cached_data/remove_cache_filethrough a newget_cache_file_path()that re-derives the path fromKSM_CACHE_DIRand no longer reads thekms_cache_file_nameclass attribute. As a result, assigningKSMCache.kms_cache_file_name = "/custom/path.bin"was silently ignored — a backward-incompatible change for consumers that set it (and it was the only way to customize the cache filename, sinceKSM_CACHE_DIRonly controls the directory).Changes
core.py—get_cache_file_path()returns an explicitly-overriddenkms_cache_file_name(detected via an import-time default snapshot), otherwise resolvesKSM_CACHE_DIRlazily at call time. KSM-1004: resolve KSMCache path lazily so KSM_CACHE_DIR is honored after import #1034's lazy behavior is preserved; the three cache methods already route through this method, so no caller changes were needed.tests/cache_test.py— addtest_kms_cache_file_name_override_is_honored._version.py, thekeeper_globals.pyhardcoded fallback (version_revision_default), and thesmoke_test.pyversion assertions.Behavior (verified)
kms_cache_file_nameoverrideksm_cache.binin CWD (unchanged)KSM_CACHE_DIRset after import, attribute untouchedTesting
cd sdk/python/core && python -m pytest tests/→ 127 passed, 1 skipped locally.Target
Point release on the v17.3.x line; base branch
release/sdk/python/core/v17.3.1(branched from the v17.3.0 release).