Skip to content

Registry - simplify versioning#370

Open
canelbirlik wants to merge 8 commits intodevfrom
fix/registry/versioning-simplification
Open

Registry - simplify versioning#370
canelbirlik wants to merge 8 commits intodevfrom
fix/registry/versioning-simplification

Conversation

@canelbirlik
Copy link
Contributor

@canelbirlik canelbirlik commented Feb 19, 2026

Currently there is no normalization on version keys, i.e. "1" and "1.0.0" are treated as different versions, causing a subtle bug when object is saved with first version "1" but later explicit call used "1.0.0". We need to normalize such that they are equivalent internally and user can retrieve the same object either with 1.0.0 or 1 explicitly.
2 options:
1- pad to three parts. e.g. 1->1.0.0
2. strips trailing 0s. - "1.0.0" → "1", "1.1.0" → "1.1", "1.0.1" → unchanged

went with option 2, so that auto increment increments on the first non zero key. e.g. if 1.0.0 present-> next version is 2.
if 1.0.1 -> next version is 1.0.2.

Inputs like save(..., version="1.0.0") still work, normalization is internal

-> In outputs versions are normalized versions, we can maybe pad them back for display purposes or leave as it is.

extra:

  • del registry["x@latest"]: add latest path to delete:
    if none given, delete all versions, if explicit version is given delete the explicit version or "latest" as a special key to delete the latest.
  • changed delete to be non idempotent for single(to match dict behaviour), matched pop behaviour
  • simplified cache facade( a bit further

@canelbirlik canelbirlik requested a review from vik-rant February 19, 2026 15:23
@vik-rant vik-rant requested a review from JeremyWurbs February 25, 2026 14:02
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