Repository navigation
Apply resolve-config version constraints to digest pins and real name lookups - #84
Merged
Volv-G merged 1 commit intoNov 11, 2026
Conversation
… lookups A resolve-config entry's `version` constraint was ignored for `digest` entries, including one inherited from `_defaults`: the pinned component (or its deprecation successor) shipped whatever its version. For `name` entries the constraint never matched anything against a real server, because it was checked against a version field the published-components listing does not return; the version only exists in the component spec. Constraints are now checked against the spec's own version (metadata.annotations.version, then top-level version): - name: only candidates whose spec satisfies the constraint are considered, and the highest is chosen, as before. - digest: deprecation successors are followed only while they satisfy the constraint. Starting at the pin, links that do not satisfy are passed until one does, and the walk stops before a successor that would leave the range, so a deprecated pin or intermediate successor can ship (1.0 -> 1.5 -> 2.1 with "<2" ships 1.5). With upgrade_deprecated=False only the pin is checked. A custom digest resolver's result is checked, not replaced. A mismatch is a miss: the entry's local source or the next entry is tried, and if nothing matches hydration reports the component as not found. A digest whose specs are all missing is still an error, as without a constraint. A spec without a version never satisfies a constraint. TangleApiClient.resolve_digest takes an optional `accept` predicate for the constrained walk; without it the result is unchanged.
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.
Problem
A resolve-config entry's
versionconstraint did not work:digestentries: the constraint (direct or inherited from_defaults) was ignored. The pin, or its deprecation successor, shipped whatever its version.nameentries: a constrained lookup never matched against a real server. It compared againstComponentInfo.version, but the published-components listing (PublishedComponentResponse) has no version field, so that was alwaysNone. The version only exists in the component spec (GET /api/components/{digest}). Existing tests hid this by fabricatingComponentInfo(version=...).Change
Constraints are checked against the spec's own version (
metadata.annotations.version, then top-levelversion):"<2"ships 1.5."<2"ships 1.0.">=2".upgrade_deprecated=Falseonly the pin is checked.digestresolver's result is checked, not replaced.TangleApiClient.resolve_digesttakes an optionalacceptpredicate for the constrained walk. Without it, the result is unchanged.Unchanged and out of scope: entries without a constraint,
urlprimaries, version-parsing quirks, and a local source winning on a higher version (now documented).Tests
tests/test_resolve_config_version_constraints.pydrivesPipelineHydrator.resolve_componentsoverresolve://fragments. Only the client's HTTP transport is faked, returning server-shaped listing rows without a version and specs that carry one. Assertions are on the shipped component or the error raised.The
tests/test_symbolic_publisher_hydration.pyfixture is now server-shaped as well.