Repository navigation
XRAY-167265 - jf ca Poetry cache - #945
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
eb85bec to
f949445
Compare
eb56bdc to
b437a2a
Compare
b399cde to
196a344
Compare
90156e2 to
e5f535d
Compare
|
General comment on the PR description (no line target). Could the description also cover a few things a reader will wonder about?
The four PR checklist boxes are also still unchecked. Review generated by xray-pr-review |
|
General comment (no line target; the code involved predates this PR, so a follow-up ticket may fit better). The description says a curation audit "should leave nothing on the machine", but when the Artifactory source has a password, the existing With real Poetry 2.4.3, a fake Poetry also reads Review generated by xray-pr-review |
172361b to
02672de
Compare
|
Suggested release note for XRAY-167265 (the ticket's release-note field is still empty):
Review generated by xray-pr-review |
0cc2099 to
d8c9aff
Compare
|

devbranch.jf ca for Poetry no longer touches the user's Poetry cache or credential store.
poetry lockruns against a throw-away cache inside the temp project copy, and it is deleted when the run ends.Why
poetry lockthrough the curation URL wrote into the user's real cache, and the source password was saved bypoetry config http-basicin the user's keyring orauth.toml. A curation audit should leave nothing on the machine.Behavior
<temp>/.jf-poetry-cacheand points Poetry at it (POETRY_CACHE_DIR,POETRY_VIRTUALENVS_PATH). virtualenv's own app-data cache, which Poetry does not control, is redirected into it too (VIRTUALENV_OVERRIDE_APP_DATA), so nothing is written under the user's home on any Poetry version. On Poetry 2+poetry lockalso runs withPOETRY_VIRTUALENVS_CREATE=false, as it only needs the lock file. Poetry 1.x keeps creating its virtualenv (inside the isolated cache): 1.2 and 1.4 needdistutilswithout one, which Python 3.12+ no longer has.poetry lockthat resolves, only the release-info part ofcache/repositoriesis copied in, read-only. The HTTP response caches (_http,_http_) are not copied: they are keyed by request URL, which differs for the curation source. A run with an up-to-datepoetry.lockskips seeding.POETRY_CACHE_DIR, and a leading~is expanded.POETRY_HTTP_BASIC_<NAME>_USERNAME/_PASSWORDinstead ofpoetry config http-basic, so nothing is saved in the keyring orauth.toml, and the password is not on a command line. They are removed from the environment when the run ends.poetryis stopped first).failed to create the isolated Poetry cache: <error>.Trade-offs
jf carun could be warm, becausepoetry lockcached under the user's cache. Now every run starts with an empty cache apart from the seeded release-info, so a user or CI job that only runsjf ca(no committed or up-to-date lock) pays the cold cost each time. A reviewer measured about 122-161 s cold vs about 31 s seeded on a 7-package project over a slow network (19.5 s vs 7 s on a smaller one).lib = {path = "../lib"}) already fail in the temp copy of the project (that copy predates this PR), so "leaves nothing behind" applies to projects without path dependencies.Alternatives considered
poetry lock --no-cachewrites nothing to the cache on Poetry 2.4.3, but its speed varied from about 22 s to over 3 minutes with the network, so it is not a drop-in replacement.python.goand there is no opt-out; one can be added if wanted.isolatePoetryCachecall ininstallPoetryDeps.Testing
Unit tests (fake Poetry and real Poetry), plus a manual matrix on Poetry 1.2, 1.4, 1.8, 2.0 and 2.4 against a curation-enabled Artifactory: the user's cache and config are unchanged, nothing is left in the temp dir, and Ctrl+C / SIGTERM at different moments leave nothing behind.
Release note
Improved
jf curation-auditfor Poetry projects:poetry locknow runs against a temporary, isolated cache that is deleted when the audit ends, so your Poetry cache is no longer modified. The Artifactory credentials are passed to Poetry through environment variables instead of being saved in your keyring orauth.toml.Related tickets
🤖 Generated with Claude Code