Skip to content

OpenConceptLab/ocl_issues#3010 | Expansion records whether version create built it with lock or latest, and a rebuild follows that - #986

Merged
snyaggarwal merged 2 commits into
masterfrom
issues#3010-build-choice
Nov 10, 2026
Merged

snyaggarwal merged 2 commits into
masterfrom
issues#3010-build-choice

Conversation

@snyaggarwal

Copy link
Copy Markdown
Contributor

Part of OpenConceptLab/ocl_issues#3010. Follow-up to #980 and bd6b11a.

A collection version built with lock or latest evaluates its references uncapped (_async) and swaps HEAD rows for resource versions. A rebuild has to do the same to give the same members. Until now seed_children worked that out from the lock toggle and the expansion's autoexpand-<version> mnemonic, which goes wrong in two cases:

  • Toggle turned off after creation: a lock/latest expansion rebuilt capped at 1,000 and kept HEAD rows, so its members changed.
  • Toggle turned on later: every existing auto-expansion (all built with the toggle off) matched the mnemonic, so a rebuild once it's no longer the default would uncap it and swap its HEAD rows, changing its members.

Change: a nullable Expansion.built_with (lock, latest, or null), set when version create builds the expansion with that choice. A rebuild uses it in place of the toggle and the mnemonic: one built with lock/latest is rebuilt uncapped with HEAD rows swapped, whatever the toggle or default expansion is now; everything else rebuilds as before. The version's references are still swapped only when that expansion is the default.

Migration 0072_expansion_built_with: adds the nullable column, with no data migration. Existing expansions stay null, which is right for them: none was built through lock/latest (that path needs #980 with the lock toggle on, and the toggle is off in production), and marking them would change their rebuilds.

Tests:

  • A lock expansion rebuilt after the toggle is turned off keeps its members past the cascade cap.
  • An expansion built with the toggle off stays capped when rebuilt with the toggle on and another expansion as the default.
  • The HEAD-swap test now expects a toggle-off rebuild to keep resource versions, and checks built_with is set.
  • Both cases fail on master (bd6b11a).

pylint -j0 core/ exits 0; makemigrations --check finds nothing missing; collections, collection and value set integration, URL registry, sources and tasks suites pass (837).

🤖 Generated with Claude Code

…eate built it with lock or latest, and a rebuild follows that
…st evaluates value-set-only references as built, whatever the toggle
@snyaggarwal
snyaggarwal merged commit 17333d9 into master Nov 10, 2026
2 of 3 checks passed
@snyaggarwal
snyaggarwal deleted the issues#3010-build-choice branch November 10, 2026 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant