Repository navigation
OpenConceptLab/ocl_issues#3010 | Version create takes an expansion choice: lock, latest or none - #980
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 |
…n does; lock keeps sources named with an unresolved version
|
Two more fixes in ec5f893, each reproduced first with a test that fails without it:
For the merge with #981: 🤖 Generated with Claude Code |
…owner namespace, names sources of unresolved entries and adds no conflicts
|
Merged master (with #981) in 16879b6, taking #981's side of the one conflicting hunk in
🤖 Generated with Claude Code |
snyaggarwal
left a comment
There was a problem hiding this comment.
Delta re-review of 96cad6a since the previously approved 8662e1a, including the master/#981 merge and its follow-up resolution.
Verdict: Approve.
Findings:
- P1: none
- P2: none
- P3: none
- P4: none
- P5: none
- Nits: none
The post-approval changes resolve the remaining edge cases cleanly:
- rebuild now gives cascades the same uncapped evaluation as version creation, so members beyond the former 1,000-result boundary are preserved;
- lock generation uses #981's owner-scoped system-version resolution, falls back to the OCL URL when a canonical URL resolves elsewhere, and retains unresolved entries as naming their source;
- the shared repository-identification/conflict logic prevents lock generation from adding a second version of a source;
- the task-record test adjustment limits TEST_MODE=False to the queueing path and mocks only the indexing signal handlers, preserving the behavior under test.
Validation: the seven new/adjusted focused regressions pass, and the two affected test classes pass locally (55 tests). GitHub Pylint and Snyk are green. The full GitHub Tests job is still running, so this verdict assumes that required check completes successfully. No open-core boundary concern.
This supersedes my review of 8662e1a for the current head.
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