Repository navigation
OpenConceptLab/ocl_issues#3010 | Version create takes an expansion choice: lock, latest or none - #980
snyaggarwal wants to merge 5 commits into
Conversation
…oice: copy, generate or none
snyaggarwal
left a comment
There was a problem hiding this comment.
Verdict: Approve
P1–P5 findings: none.
Nits: none.
The optional expansion contract matches the issue: omission preserves existing behavior; copy, generate, and none reach the seeding path with the intended precedence over autoexpand; invalid values fail validation. The new task argument defaults to the old behavior, so already-queued four-argument tasks and existing callers remain compatible. Coverage exercises every choice with the toggle on and off, plus invalid input. No open-core boundary concern.
Verification: reviewed the serializer/model/task flow and affected callers/tests with the code graph; Pylint and Snyk are green. The GitHub Tests check was still running at review time.
|
The ACs on OpenConceptLab/ocl_issues#3010 changed after Jon's decision on Nov 5 (comment there). For the API:
|
…t or none, evaluating every reference
|
Reworked in 7653a83 for the new ACs. Against the notes above:
Members that resolve to a source's HEAD still become their latest concept version in the new version, as the copy path did. 🤖 Generated with Claude Code |
snyaggarwal
left a comment
There was a problem hiding this comment.
Supersedes my review of f9266a5.
Verdict: Request changes.
P1: none.
P2 — Rebuilding a version that resolved a source HEAD does not reproduce the members created here (core/collections/models.py:467). Initial creation calls replace_head_resources, converting HEAD concept/mapping rows to their latest immutable resource versions. The normal rebuild path (expansion.seed_children(..., force_reevaluate=True)) never calls that normalization; with a saved system-version ending in |HEAD, reevaluation selects HEAD rows again. Extend test_seed_children_task_swaps_head_resources_in_references by rebuilding and asserting the expansion/reference still contain latest: they currently flip back to HEAD. This violates the primary reproducibility AC, and the ticket’s known exception covers value-set references only. Put the normalization in the reusable rebuild path or persist enough information for rebuild to select the same resource versions.
P3 — The omitted expansion default is resolved in the worker instead of when the version-create request locks HEAD (core/common/models.py:1304-1309). Only explicit choices are saved in Task.kwargs; an omitted choice is saved as None, so seed_children_to_new_version later rechecks whether HEAD has an expansion. If HEAD gains or loses its expansion while the task waits, the documented default silently flips between latest and lock. Resolve the default after select_for_update() and record the resolved choice with the task; add a non-TEST_MODE regression that changes HEAD before running the queued task.
P4: none.
P5: none beyond the regression coverage requested above.
Nits: none.
Verification: reviewed the rewritten ticket and both PR discussions; traced the model/task/rebuild flows with the code graph; inspected the member-version, rebuild, default and task-record tests; changed Python files compile; Pylint is green. GitHub Tests was still running at review time. No open-core boundary concern.
…HEAD-resolved members; default choice settled at create
|
Both findings from the review of 7653a83 checked and fixed in 8662e1a. P2: rebuild flips HEAD-resolved members back to HEAD rows. Valid. A test reproduced it: after creating a version whose source resolves to HEAD,
P3: the omitted default was worked out in the worker. Valid. With no
Pylint 10/10; Still to do: this PR conflicts with #981 in one hunk of 🤖 Generated with Claude Code |
snyaggarwal
left a comment
There was a problem hiding this comment.
Re-review of 8662e1a against the rewritten Nov 5 ACs and the current PR description.
Verdict: Approve.
Findings:
- P1: none
- P2: none
- P3: none
- P4: none
- P5: none
- Nits: none
The prior rebuild/member-version finding is fixed: forced rebuilds of default version expansions now normalize HEAD resources again, with a regression test proving the locked member survives a rebuild. The prior queued-default race is also fixed: the default choice is settled while HEAD is locked, recorded on the task, and covered by a task-path regression test. The rewritten expansion semantics and old-worker-compatible four-argument task message match the posted ACs.
Validation: changed Python files compile with Python 3; Snyk is green. The latest Pylint job is still pending, so this verdict assumes that required check completes successfully.
This supersedes my earlier request-changes review.
…tests so they need no Redis
|
Red build on 8662e1a fixed in 3bc047d. The new 🤖 Generated with Claude Code |
Part of OpenConceptLab/ocl_issues#3010 (web: OpenConceptLab/oclweb3#96). Reworked for the ACs Jon rewrote on Nov 5.
Collection version create takes an optional
expansion:lock,latestornone; any other value is a 400.EXPANSION_LOCKED_REPO_VERSION_TOGGLEon and noexpansion, the default islockwhen HEAD has an expansion, elselatest.autoexpand: falsealone still means no expansion.lockandlateststart from HEAD's expansion parameters and evaluate every reference again (force_reevaluate,_asyncon each reference). Nothing is copied from HEAD's expansion.lockadds<url>|<version>tosystem-versionfor each source HEAD's expansion locked, unless HEAD's parameters already name it. The URL is the canonical URL when it resolves back to that version, else the OCL URL. It also starts from HEAD's evaluated collection versions, sincesystem-versiondoesn't reach value sets.latestresolves unversioned references to each repo's latest release, else its HEAD.nonematchesautoexpand: false. With the toggle off, nothing changes.Deploys.
seed_children_to_new_versionkeeps its four arguments. The choice is recorded in the task'skwargs, so a worker on older code takes the message as before and a new worker reads it back; the task hooks now keep recorded kwargs when a message carries none.Tests check member and evaluated versions: after a new release,
lockkeeps the locked release's member and a rebuild gives the same, andlatestgives the new release's. Also the default, the task-record path, every API choice with the toggle on and off, and the 400. Pylint 10/10; collections, sources and tasks suites pass (773).Known limit (as on the ticket): a later rebuild resolves unversioned value set references again.
🤖 Generated with Claude Code