Repository navigation
fix(manifest): refetch manifests cached by another dtvem version - #308
Merged
Merged
Conversation
The manifest cache only checked its format and age, so a newly installed dtvem kept reading a manifest an older build had cached for up to a day. A pre-release build had cached the Python manifest in the current format from before it listed python.org builds, and the release then reported no signed builds until the cache expired or dtvem update ran. The cache now records the dtvem version that wrote it, and a cache from any other version is fetched again.
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.
Description
After upgrading to v0.7.3,
dtvem install python 3.12.10 --signedreported that no 3.12 version had a signed build for windows-amd64, although the live manifest lists one.dtvem updatefixed it.The manifest cache only checked its
formatand its 24-hour age. A pre-release build of #304 had cached the Python manifest in the current format (2), but from before the manifest listed python.org builds. v0.7.3 read that cache as valid and saw no signed builds. It would have kept doing so until the cache expired.Installing a new dtvem should always fetch fresh manifests. A new version may read manifest fields that the version which wrote the cache didn't know about, or that didn't exist yet when it wrote it.
Type of Change
Related Issues
Relates to #304
Changes Made
cli_version). A cache file from any other version is treated as missing and fetched again, like an expired one.cmd.ExecutepassesVersiontomanifest.SetCLIVersionbefore any command runs.DefaultSourcegives that version to its cache. The shim doesn't use the manifest package, so it's unaffected.dev, so two of them share a cache, as before. A release never reads a cache adevbuild wrote.formatcheck stays. CLAUDE.md now describes both checks.Testing
Test Environment
Test Steps
TestCachedSource_IgnoresOtherVersion: a stale manifest cached bydev, by an older release, or with no recorded version is fetched again by0.7.4, and the fresh copy is then served from the cache. A version reading its own cache doesn't fetch.TestSetCLIVersion_DefaultSource: the default source's cache uses the version passed toSetCLIVersion.-X ...cmd.Version=0.7.4-testranlist-all pythonagainst a scratch root whose cache an earlier build had written. It fetched again, recording"cli_version":"0.7.4-test", and a second run used that cache unchanged.Test Results
golangci-lint: 0 issues../rnr checkfails only onTestGlobalVersion_NoConfigFileandTestGlobalVersion_RuntimeNotInConfigininternal/config, which fail the same way on unmodifiedmainon the machine I tested on.Checklist
golangci-lint runand fixed all issues (includes gofmt, govet, and 40+ linters)go mod tidyto clean up dependenciesgo test ./...) (apart from the twointernal/configtests above, unchanged frommain)Breaking Changes
N/A. The first run of the new version fetches each manifest once; after that, caching works as before.