Repository navigation
OpenConceptLab/ocl_online#736 | A reference whose system URL names a version is evaluated in that version - #1066
Conversation
…version is evaluated in that version and recorded as explicit
|
Review, round 1: approve with nits. An independent review of 51130c3, reading the code only. Checked and fine
Nits
|
…ce, a private named version and a resource-versioned system without a slash; the HEAD rule is documented
|
Round 1 nits, in feaba95:
Checks: |
|
Review, round 2: approve with nits. An independent review of feaba95. It found no correctness problems in the production change or in round 1's additions. Checked and fine
Nits
|
…versionless_expression alone, and a concept-version URL as a system is tested as unversioned
|
Round 2 nits, in cf83e2c:
Checks: The loop stops here: approve with nits, nits fixed. |
Ticket: OpenConceptLab/ocl_online#736 (finding F2.2 of the #1028 review, and the mismatch F1.3 left for later) · Epic: OpenConceptLab/ocl_issues#2942
A reference whose
systemURL names a repository version (/orgs/O/sources/S/v1/,/orgs/O/sources/S/v1, orurl|v1) with an emptyversionfield is now treated as naming that version. Before, only theversionfield counted:v1gotv2's members, and a missingv1evaluated nothing.evaluated_source_versions, as if it were a lock, rather thanexplicit_source_versions. So a later unversioned reference to the same source could take it as its lock, and TBv3 called it movable (found in the OpenConceptLab/ocl_issues#3009 | Say why new releases are offered, and compare before rebuilding oclweb3#114 review).system-version: the parameter overrode a version the system URL names, though it only applies to a system with no version.The change (
core/collections/models.py)names_repo_versionreads the system as the resolver does:versionfield;|;/orgs|users/<owner>/<repo type>/<repo>/<version>/), exceptHEAD. No repository's URL has aHEADsegment, so such a system never resolves, andget_evaluated_repo_version_urlsalready excluded it.This is the reading
get_evaluated_repo_version_urlsalready used since OpenConceptLab/ocl_online#736 | Unresolved-reference details list only repository versions the requester can view #1028, moved into the property so both share it. Read by position:/orgs/O/sources/S/v1without the trailing slash counts;sources(/orgs/sources/sources/S/), a canonical URL whose path merely looks versioned, and a concept-version URL used as a system (/orgs/O/sources/S/concepts/c1/123/). The resolver reads that last one as the source's HEAD.The old check counted
url|v1and the trailing-slash form, as this one does. Itsis_versioned_uripart got the other four wrong.is_versionless_expressionis nownot names_repo_version and not resource_version. It decides:add_referencesreuses a recorded evaluated version;get_source_versions_resolved_byreturns for the reference (resolved_repo_versions);can_compute_against_other_system_versionusesnames_repo_versiontoo, sosystem-versiondoesn't override a version the system URL names, as it already didn't for aversionfield.version_lists(rebuild_expansion_version_lists) already counted the trailing-slash andurl|v1forms as explicit throughnames_repo_version. Now every form counts, andis_explicitreadsnot is_versionless_expressionalone, which agrees with whatadd_referencesrecords.A resource-versioned reference (
system,codeandresource_version) whose system names a version without a trailing slash (/S/v1) is now pinned to that version, as the trailing-slash form already was. It no longer resolves to a version that holds its resource version.No toggle: this is a correctness fix, and the docs (OpenConceptLab/ocl-docs#83, rule 1) already say a reference that names a version, by
versionor by URL, uses that version. Existing expansions keep what master recorded until they're rebuilt, or untilrebuild_expansion_version_lists --applyruns. Adding references doesn't remove a version master recorded as evaluated, so later references, and version create'slock, still read it until then.Tests
CollectionReferenceTest.test_names_repo_version_reads_the_system_as_the_resolver_doescovers each form:|v1;/HEAD/, and an owner namedsources;|v1, and a canonical URL whose path merely looks versioned.It checks
is_versionless_expressionalongside.test_can_compute_against_other_system_versionadds the system-URL forms.ExpansionTest.test_add_references_evaluates_a_reference_in_the_version_its_system_names, with and without the trailing slash: with the expansion locked to v2, adding a reference whose system names v1 evaluates it in v1, records v1 as explicit and keeps v2 as the lock.get_source_versions_resolved_byreturns v1.ExpansionTest.test_system_version_parameter_does_not_override_a_version_the_system_names: a rebuild withsystem-version=S|v2keeps the reference on v1.ExpansionTest.test_a_later_unversioned_reference_takes_the_latest_release_not_a_version_another_reference_names: after a reference naming v1, an unversioned one resolves to the latest release v2, not to v1 as a lock.ExpansionTest.test_a_named_version_its_creator_cannot_view_adds_nothing_as_a_missing_one_does: with the expansion locked to public v1, a reference naming a private v2 adds nothing, as one naming a missing v3 does. On master, it added v1's members.CollectionReferenceTest.test_resolve_system_version_keeps_a_repo_version_its_system_names_without_a_trailing_slash: a resource-versioned reference whose system is/S/v2resolves to v2, with or without the slash.All of these fail on
master.OpenConceptLab/ocl_online#769 | A retired version named by its relative URL still resolves #1065's
test_rebuild_resolves_a_reference_whose_system_names_a_retired_version_by_its_urlnow expects v1 inexplicit_source_versions. That's what this PR changes.Run locally in a one-off container:
core.collections,core.integration_tests.tests_collectionsandcore.common.tests(951 tests): the only failure was that OpenConceptLab/ocl_online#769 | A retired version named by its relative URL still resolves #1065 test, before its update, and that test now passes;SourceTest,core.fhir.tests_resolve,core.url_registry.tests_resolutionand the updated test (189 tests): all pass;core.collections,core.integration_tests.tests_collectionsandcore.common.tests(954 tests): all pass.pylint on the changed files exits 0.
Sibling PRs
🤖 Generated with Claude Code