Skip to content

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
release/sdk/python/core/v17.3.1from
KSM-1004-honor-kms-cache-file-name-override
Closed

fix(sdk/python/core): honor kms_cache_file_name override in KSMCache cache path (KSM-1019)#1045
mgallego-keeper wants to merge 1 commit into
release/sdk/python/core/v17.3.1from
KSM-1004-honor-kms-cache-file-name-override

Conversation

@mgallego-keeper

@mgallego-keeper mgallego-keeper commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Jira: KSM-1019 · Fixes #1044

Summary

PR #1034 (KSM-1004) rerouted KSMCache.save_cache / get_cached_data / remove_cache_file through a new get_cache_file_path() that re-derives the path from KSM_CACHE_DIR and no longer reads the kms_cache_file_name class attribute. As a result, assigning KSMCache.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, since KSM_CACHE_DIR only controls the directory).

Changes

  • core.pyget_cache_file_path() returns an explicitly-overridden kms_cache_file_name (detected via an import-time default snapshot), otherwise resolves KSM_CACHE_DIR lazily 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 — add test_kms_cache_file_name_override_is_honored.
  • Version bump 17.3.0 → 17.3.1 across the three coupled sources: _version.py, the keeper_globals.py hardcoded fallback (version_revision_default), and the smoke_test.py version assertions.

Behavior (verified)

Scenario Result
Explicit kms_cache_file_name override honored (regression fixed)
No override, no env var ksm_cache.bin in CWD (unchanged)
KSM_CACHE_DIR set after import, attribute untouched honored (KSM-1004 preserved)

Testing

cd sdk/python/core && python -m pytest tests/127 passed, 1 skipped locally.

Note: the Test-Python workflow only triggers on PRs targeting master, so it will not auto-run against this release branch — the suite was run locally instead.

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).

…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.
@mgallego-keeper
mgallego-keeper deleted the KSM-1004-honor-kms-cache-file-name-override branch June 18, 2026 15:11
@mgallego-keeper mgallego-keeper changed the title fix(sdk/python/core): honor kms_cache_file_name override in KSMCache cache path fix(sdk/python/core): honor kms_cache_file_name override in KSMCache cache path (KSM-1019) Jun 18, 2026
@mgallego-keeper

mgallego-keeper commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #1046. The source branch was renamed to KSM-1019-honor-kms-cache-file-name-override to track Jira KSM-1019; the rename closed this PR, so #1046 is the active replacement (identical commit 869eef5). This one can stay closed.

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.

1 participant