Skip to content

fix: recognize DEV-version files that need serialization upgrade#6099

Open
antonydellavecchia wants to merge 4 commits into
masterfrom
adv/fix-upgrade-detection
Open

fix: recognize DEV-version files that need serialization upgrade#6099
antonydellavecchia wants to merge 4 commits into
masterfrom
adv/fix-upgrade-detection

Conversation

@antonydellavecchia

Copy link
Copy Markdown
Collaborator

The load path gated upgrades on file_version < VERSION_NUMBER. For DEV builds the file's version string carries a commit hash (e.g. "1.8.0-DEV-"), so this compared two VersionNumbers by their hash characters rather than by upgrade state. A file could then be judged up-to-date and skip upgrades it actually needed, causing load to fail.

Gate instead on the newest upgrade script's version, applied to the file's effective upgrade version (which decodes the n_upgrades count encoded in DEV version strings). upgrade() now uses the same effective version so the gate and the per-script loop stay consistent.

Most of these changes have been brought in from #6016 save for the neccessary gate described above.
Since #6016 might still need some time to be approved and merged I am bringing them in here.

Having a test for these type of issues seems to be hard as they only affect old dev versions

The load path gated upgrades on `file_version < VERSION_NUMBER`. For DEV
builds the file's version string carries a commit hash (e.g.
"1.8.0-DEV-<hash>"), so this compared two VersionNumbers by their hash
characters rather than by upgrade state. A file could then be judged
up-to-date and skip upgrades it actually needed, causing load to fail.

Gate instead on the newest upgrade script's version, applied to the
file's effective upgrade version (which decodes the n_upgrades count
encoded in DEV version strings). `upgrade()` now uses the same effective
version so the gate and the per-script loop stay consistent.

Verified by loading a file saved as "1.8.0-DEV-<hash>" that previously
failed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Comment thread src/Serialization/Upgrades/main.jl Outdated
Co-authored-by: Lars Göttgens <lars.goettgens@rwth-aachen.de>
@lgoettgens lgoettgens added bug Something isn't working release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes labels Jul 6, 2026
@benlorenz benlorenz closed this Jul 6, 2026
@benlorenz benlorenz reopened this Jul 6, 2026
@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.24%. Comparing base (cd3d581) to head (9751d7c).
⚠️ Report is 10 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6099      +/-   ##
==========================================
+ Coverage   84.21%   84.24%   +0.02%     
==========================================
  Files         787      787              
  Lines      107376   107506     +130     
==========================================
+ Hits        90432    90568     +136     
+ Misses      16944    16938       -6     
Files with missing lines Coverage Δ
src/Serialization/Upgrades/main.jl 97.95% <100.00%> (+0.69%) ⬆️
src/Serialization/main.jl 88.05% <100.00%> (ø)

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working embarrassing-bugfix Whoops! release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes serialization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants