Skip to content

feat: support cache location overrides (#177)#178

Merged
stephantul merged 1 commit into
MinishLab:mainfrom
ciaranj:add-cache-location-env
Jun 3, 2026
Merged

feat: support cache location overrides (#177)#178
stephantul merged 1 commit into
MinishLab:mainfrom
ciaranj:add-cache-location-env

Conversation

@ciaranj

@ciaranj ciaranj commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Adds support for a neew environment variable 'SEMBLE_CACHE_LOCATION'. The value of this variable will be the full path location of the cache folder that semble stores its caches and savings information.

This variable takes precedence over and OS defaults and the Arch XDG_CACHE_HOME convention.

Linked issue

Closes #177

Summary

Adds an environment variable to allow specifying the semble cache location if OS defaults do not suffice.

Checklist

  • I have read CONTRIBUTING.md
  • This PR is linked to an existing issue (above)
  • make test passes
  • make lint and make typecheck pass (or make pre-commit)
  • Added or updated tests for any behaviour changes
  • Updated docstrings / docs for any public API changes
@greptile-apps

greptile-apps Bot commented Jun 3, 2026

Copy link
Copy Markdown

Confidence Score: 3/5

Safe to merge after fixing the test isolation gap; the production code change is correct and self-contained.

The production code in cache.py is correct. The test suite has a gap: test_resolve_cache_folder does not unset SEMBLE_CACHE_LOCATION before exercising the platform helpers, so running make test in an environment where that variable is already configured will cause a spurious assertion failure. Combined with the broken Markdown rendering in the README, there are two issues that should be fixed before merging.

tests/test_cache.py needs the existing parametrized test updated to neutralize SEMBLE_CACHE_LOCATION; README.md needs the mismatched quote fixed.

Comments Outside Diff (1)

  1. tests/test_cache.py, line 86-91 (link)

    P1 The existing test_resolve_cache_folder parametrized test doesn't clear SEMBLE_CACHE_LOCATION from the environment. With the new precedence order in resolve_cache_folder, if a developer has already set SEMBLE_CACHE_LOCATION in their shell (e.g., after adopting this feature), os.getenv("SEMBLE_CACHE_LOCATION") will return a truthy value, bypass all the mocked platform helpers, and cause mock_fn.assert_called_once_with("semble") to fail with an unexpected assertion error.

Reviews (1): Last reviewed commit: "feat: support cache location overrides (..." | Re-trigger Greptile

Comment thread src/semble/cache.py Outdated
Comment thread README.md Outdated
Adds support for a neew environment variable 'SEMBLE_CACHE_LOCATION'.
The value of this variable will be the full path location of the cache
folder that semble stores its caches and savings information.

This variable takes precedence over and OS defaults and the Arch
XDG_CACHE_HOME convention.
@ciaranj ciaranj force-pushed the add-cache-location-env branch from 1d63a6b to 761ee16 Compare June 3, 2026 11:09
@codecov

codecov Bot commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/semble/cache.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
@stephantul

Copy link
Copy Markdown
Contributor

Looks good from our side, thanks for your contribution!

@stephantul stephantul merged commit 512142e into MinishLab:main Jun 3, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants