fix(sdk/python/core): honor kms_cache_file_name override in KSMCache cache path (KSM-1019)#1046
Open
mgallego-keeper wants to merge 3 commits into
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.
stas-schaller
requested changes
Jul 6, 2026
… (KSM-1019) Replace the value-equality override check in KSMCache.get_cache_file_path with an identity comparison against a _DefaultCachePath(str) sentinel, so an explicit kms_cache_file_name assignment is honored even when its text equals the import-time default (e.g. "ksm_cache.bin" when KSM_CACHE_DIR was unset at import). The previous "!=" check silently dropped such an override once KSM_CACHE_DIR was set, a narrower case of the KSM-1004 regression this line fixes. Add a collision-case regression test and the 17.3.1 README changelog entry. KSM-1004 lazy KSM_CACHE_DIR resolution and all default behavior are preserved.
Contributor
Author
|
Thanks for the review — all three points addressed in 6e590b0:
Full suite green locally: |
…d into 17.4.0) This fix is being consolidated into the 17.4.0 release. The single version bump and the KSM-1019 changelog entry now live in the 17.4.0 release PR (#1057), so revert _version.py, keeper_globals.py, smoke_test.py and the README changelog back to the release-branch baseline. This PR now carries only the KSMCache code fix and its regression tests.
mgallego-keeper
changed the base branch from
release/sdk/python/core/v17.3.1
to
release/sdk/python/core/v17.4.0
July 9, 2026 22:46
stas-schaller
force-pushed
the
release/sdk/python/core/v17.4.0
branch
from
July 24, 2026 17:38
d541f29 to
c80bdd5
Compare
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).