Repository navigation
OpenConceptLab/ocl_online#776 | Seeded references keep HEAD's last resolved time instead of stamping now - #1070
Merged
Conversation
…solved_at instead of stamping now
snyaggarwal
commented
Nov 25, 2026
snyaggarwal
left a comment
Contributor
Author
There was a problem hiding this comment.
Review: approve with nits
No significant issues.
- Callers: both production callers were traced: core/common/tasks.py, and
seed_from_head_expansion_in_snapshot.- With the lock toggle on, the default expansion's write-back in
add_referencesre-stamps resolved and unresolved references honestly afterwards. - With it off, the copied HEAD value is final, the same as HEAD's own value.
- With the lock toggle on, the default expansion's write-back in
- Consumers: nothing reads
last_resolved_atbeyond the serializer, which already allowsNone. Health and FHIR don't use it. - The new test is sound:
clone(last_resolved_at=...)passes the value explicitly, sodefault=timezone.nowdoesn't apply, andsave()doesn't callclean(). It fails before the change and passes after it. - Imports: the new
timezoneandtimedeltaimports in tests.py don't clash with anything.
Nits
- The comment "one HEAD never resolved stays unresolved" reads oddly. Suggested: "copied, not resolved here: a reference HEAD never resolved stays unresolved".
- FYI: on the toggle-off auto-expand path, a version's references now show HEAD's resolve date, not the version's creation date. This is intended, but it will look different in the UI.
Contributor
Author
|
Fixed in 90a16b8: the comment now reads "copied, not resolved here: a reference HEAD never resolved stays unresolved". |
snyaggarwal
marked this pull request as ready for review
November 25, 2026 12:26
snyaggarwal
commented
Nov 25, 2026
snyaggarwal
left a comment
Contributor
Author
There was a problem hiding this comment.
Review round 2 (Expansion Health epic, reviewed with #1069 and #1071–#1073): approve
The round-1 nit (comment wording) is fixed in 90a16b8, and the master merges are clean.
Checked, no issue
- No conflict with the other four API PRs. It merges cleanly onto #1069, #1071 and #1072 together.
last_resolved_atcopied from HEAD composes with #1069: neither reads the other's field.- The toggle-off auto-expand path shows HEAD's resolve date, as noted in round 1. That's intended.
CI: Pylint and Tests pass. Nothing open.
paynejd
approved these changes
Nov 25, 2026
paynejd
left a comment
Member
There was a problem hiding this comment.
Review lead (Claude, for Jon), round 1
Verdict: APPROVE (head d94704c)
Reviewed against OpenConceptLab/ocl_online#776 and its two acceptance criteria. Both are met.
Earlier points
- Comment wording on
seed_references(round 1 nit): met. It now reads "copied, not resolved here: a reference HEAD never resolved stays unresolved" (core/collections/models.py:326). - Toggle-off auto-expand path shows HEAD's resolve date (FYI): accepted. It is intended, and nothing reads
last_resolved_atbeyond the serializer, which allowsNone.
This review
seed_referencescopiesreference.last_resolved_atthroughclone(...), so an unresolved HEAD reference staysNonein the new version. This is the ticket's fix, with no side effects onmembersor health.test_seed_references_copies_head_last_resolved_atchecks both cases (a dated reference keeps its date, an unresolved one staysNone) and would fail on the oldtimezone.now()stamp.- A real resolve still sets the value honestly (
add_referenceswrites it back at models.py:2207-2208), so the copy is only the starting value. - It merges cleanly with #1069, #1071 and #1072 in any order I tried, and none of them reads or writes this field.
- A Codex defect pass found nothing.
CI: Pylint and Tests pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes OpenConceptLab/ocl_online#776.
What changed
Collection.seed_referencesnow copies each HEAD reference'slast_resolved_atonto its clone in the new version. Before, it stampedtimezone.now().Why
Seeding only copies the reference and its member sets. It never resolves anything, so stamping "now" claimed a resolve that didn't happen. A reference that was dead or empty in HEAD (
last_resolved_at=None) showed "last resolved just now" in the new version, which hid exactly the references that need attention. A real resolve still sets the value honestly, for example the write-back inExpansion.add_references.Tests
test_seed_references_copies_head_last_resolved_at: a resolved HEAD reference keeps its timestamp, and an unresolved one staysNonein the new version.Focused pylint on the changed files passes (exit 0). The local Docker stack is down, so the tests haven't run locally. This relies on CI's Tests job.
🤖 Generated with Claude Code