Repository navigation
OpenConceptLab/ocl_online#769 | A retired version named by its relative URL still resolves - #1065
Conversation
…ve URL still resolves, in system-version and in a reference's system
|
Review, round 1: approve with nits. An independent review of beccb33 against Checked and fine
Nits
Info, no action: a retired repository (its HEAD) with a live v1 resolves |
… position, so an owner named like a resource keeps its HEAD rule, and FHIR serves a retired release by its path
|
Round 1 nits are fixed in 2edfba4.
Checks: the five resolver and rebuild tests and |
|
Review, round 2: approve with nits. An independent review of 2edfba4 against Checked and fine
Nits (description only)
Info, out of scope: an owner named |
|
Round 2 nits are fixed in the description: the FHIR bullet now says a retired release is served by its path only while the repository has a live release, and the Tests section says the owner-named test passes on |
Ticket: OpenConceptLab/ocl_online#769 · Epic: OpenConceptLab/ocl_issues#2942
A repository version named by its relative URL (
/orgs/O/sources/S/v1/) now resolves after it's retired, asurl|v1and a reference'sversionfield already do. Retiring a release no longer moves a lock or empties a reference on the next rebuild.The cause
resolve_reference_expressionmatched a relative URL to a row byuri, filteredis_active=True, retired=False. For a version URL, that row is the version itself, so a retired version didn't match. The canonical path finds the repository and then reads its version throughReferenceResolution.version(), which has no retired filter.The change
core/common/models.py: a relative URL that names a version, by its position (/orgs/O/sources/S/v1/, five segments), is matched withis_active=Trueonly. Position rather thanis_versioned_uri, which reads/orgs/sources/sources/S/(an owner named like a resource) as a version URL. A deactivated version still doesn't resolve. A repository's own URL keeps theretired=Falsefilter, and canonical URLs are unchanged.system-versionentries (resolve_system_version_entries): a rebuild keeps the pin, and the entry no longer lands inunresolved_repo_versions;systemis a version URL (resolve_expression_system_version): the reference keeps its members on a rebuild.$resolveReference, as it already did forurl|version;/orgs/O/CodeSystem/S/v1/), matching FHIR's rule that a retired release is served when named, while the repository has a live release (has_release). A retired HEAD still isn't served by path;Tests
SourceTest.test_resolve_reference_expression_relative_url_of_a_retired_version: a retired version resolves by relative URL, with or without the trailing slash, and asurl|v1. A deactivated version doesn't resolve, and a repository's URL still resolves to HEAD when its only release is retired.ExpansionTest.test_rebuild_keeps_a_retired_version_system_version_names_by_its_url: retire v1, then rebuild withsystem-versionas/orgs/O/sources/S/v1/and asurl|v1. v1 stays the lock and nothing is unresolved.ExpansionTest.test_rebuild_resolves_a_reference_whose_system_names_a_retired_version_by_its_url: the reference keeps its member from v1, and v1 stays recorded.SourceTest.test_resolve_reference_expression_relative_url_of_a_retired_head_of_an_owner_named_like_a_resource: an owner namedsourceswith a retired HEAD still doesn't resolve by path.FhirResolveCases.test_a_retired_release_named_by_its_ocl_path_is_served_beside_a_live_one: FHIR serves retired v1 by its path, in both path forms and as|v1, and the repository's own path still serves live v2.master. The owner-named test passes onmasterand fails on beccb33: it guards the positional rule.ExpansionTest,CollectionReferenceTest,SourceTest,core.url_registry.tests_resolution,core.fhirandcore.integration_tests.tests_collections, 1216 tests in all.*_not_test_modetests that need Redis, which the local run blocks. They fail the same way without this change.Notes
systemis a version URL but has noversionfield is recorded inevaluated_source_versions, notexplicit_*(is_versionless_expression). That's unchanged here, and the test doesn't depend on which list it is.system-versionversion URL as pinned while that version isn't retired. Both can be relaxed once this is deployed.Sibling PRs
🤖 Generated with Claude Code