Repository navigation
OpenConceptLab/ocl_issues#3004 | Health badge and reasons for collection versions and expansions - #113
Conversation
…ions show the API's expansion health, with its reasons in the details dialog
|
Review round 1: verdict "changes needed" This was a high-effort review of the diff against the API on oclapi2
Not changing:
These are consistent with neighbouring strings and minor. Component render tests also aren't added: the repo's tests are Fixes follow in the next commit. |
…hows health, unknown states show as given, and deleted locks are plain text
|
Review round 2: verdict "changes needed" Round 1's fixes check out:
Fixes follow in the next commit. |
…current version summary beats a stale loaded expansion, and es and pt-BR have their many plurals
|
Review round 3: verdict "changes needed" Round 2's fixes check out:
Fixes follow in the next commit. |
… a version's health comes from its default expansion and is never older than its summary
…ts cached rows' expansions, a failed fetch keeps them, and a refresh shows them instead of a spinner
|
Review round 4: verdict "approve with nits" Round 3's fixes check out:
|
paynejd
left a comment
There was a problem hiding this comment.
Review lead (Claude, for Jon), round 1
This is a comment, not an approval. The ticket's first AC is Jon's approval of the mockup, which he gives separately, and the wording is part of that review.
Thanks, Sunny. I checked the display against oclapi2's health.py and serializers on master, and it reads them correctly:
- the four states (
healthy,head_resolved,unhealthy,empty); - all twelve reason codes, with the URLs each one names;
- the
locked_version_deletedcount minus the versions it names; - the HEAD counts on
version_mismatchesandambiguous_members; - the seven member classes,
head_resolved_repositories,multiple_named_versionsandcomputed_at; - the three values of
health_is_current, and the versions list'sexpansion_healthsummary.
Showing health only for a version's default expansion matches what the API keeps current. Showing it to anyone who can view the version matches Jon's Nov 3 decision. All four locales have every string: es and pt-BR with the _many forms, zh with other only. CI is green.
One fix: a failed expansions request is now retried without end (suggestion inline).
APIServiceresolves a failed request with the error body, soresponse.dataisn't an array, and nothing is cached.loadingByVersionthen changes, which givesfetchExpansionsa new identity, and the effect sends the same request again at once.- A version whose
expansions/call keeps failing (a 403, 404 or 5xx) is requested in a tight loop for as long as the tab is open. - Before this PR, a failure cached an empty list, which stopped it. The suggestion keeps what's cached on a failed refresh, and caches an empty list on a failed first load, as before.
Smaller, no action needed:
- The details dialog shows the expansion as it was when opened, so a refresh that lands while it's open shows on the chips but not in the dialog until it's reopened.
- When a version's default expansion isn't on the first page of
expansions/, the version chip shows the summary but has nothing to open.
| .then(response => { | ||
| const data = response?.data || []; | ||
| setExpansionsByVersion(prev => ({ ...prev, [versionKey]: formatExpansions(version, data) })); | ||
| // a failed request keeps what was loaded | ||
| if (Array.isArray(response?.data)) | ||
| setExpansionsByVersion(prev => ({ ...prev, [versionKey]: formatExpansions(version, response.data) })); | ||
| setLoadingByVersion(prev => ({ ...prev, [versionKey]: false })); | ||
| }); |
There was a problem hiding this comment.
A failed request leaves no cache entry, so the effect above calls it again as soon as loadingByVersion changes. This keeps a failed refresh's cache, and caches an empty list on a failed first load as before:
| .then(response => { | |
| const data = response?.data || []; | |
| setExpansionsByVersion(prev => ({ ...prev, [versionKey]: formatExpansions(version, data) })); | |
| // a failed request keeps what was loaded | |
| if (Array.isArray(response?.data)) | |
| setExpansionsByVersion(prev => ({ ...prev, [versionKey]: formatExpansions(version, response.data) })); | |
| setLoadingByVersion(prev => ({ ...prev, [versionKey]: false })); | |
| }); | |
| .then(response => { | |
| // a failed refresh keeps its cache; a failed first load caches nothing found, so it isn't retried in a loop | |
| const data = Array.isArray(response?.data) ? response.data : null; | |
| setExpansionsByVersion(prev => (data || !prev[versionKey] | |
| ? { ...prev, [versionKey]: formatExpansions(version, data || []) } : prev)); | |
| setLoadingByVersion(prev => ({ ...prev, [versionKey]: false })); | |
| }); |
There was a problem hiding this comment.
Applied in 248c1c5, with the comment shortened to one line.
paynejd
left a comment
There was a problem hiding this comment.
Review lead (Claude, for Jon), round 1, from screenshots
Sunny, one code fix came out of screenshots of the Health dialog (production build, API mocked in the stored health shape): the Members list adds concepts and mappings together.
getMemberClassCountssumshealth.members.conceptsandhealth.members.mappingsper class.- So each line, such as "In a release", is one number for concepts and mappings together, while the rest of the page counts them apart.
- Show the counts per resource type, as
health.pystores them.
…nger retried in a loop, and the Health dialog counts members per resource type
|
Thanks. Both fixes from round 1 (review, screenshots) are in 248c1c5. CI is green.
I left the two "no action needed" notes as they are: the dialog shows the expansion as it was when opened, and a default expansion that isn't on the first page has nothing to open. The fixes are merged into #114. |
snyaggarwal
left a comment
There was a problem hiding this comment.
Review (Expansion Health epic, reviewed with OpenConceptLab/oclapi2#1069–#1073 and #114–#116): approve with nits
This is an independent pass at c991254, checked against the open API PRs. It doesn't repeat the four earlier rounds or the lead's review; their fixes hold.
Nits
- Deploy order: OpenConceptLab/oclapi2#1071 should deploy before this PR or with it, and the description should name it.
- The flow: Set as default (
onMarkExpansionDefault,CollectionVersionsTab.jsx~L502) reformats the cached expansions locally, then RepoHome's refresh forces an expansions refetch. - With #1071:
- the new default reads
health_is_current: falseand shows "Checking health", or its last state marked as out of date; - the old default's health is cleared, and its chip is hidden anyway, since it isn't the default.
- the new default reads
- Without #1071:
- an expansion that was the default before still holds its old health with
health_is_current: true, so its chip shows stale health as current; - one never computed shows no chip until the nightly recheck.
- an expansion that was the default before still holds its old health with
- The flow: Set as default (
- Nothing re-reads health after the queued recompute finishes. After Set as default, the version chip and the row chip stay on "Checking health" until the next manual refresh. Either do one delayed refetch after Set as default, or say in the description that it updates on refresh.
- For an expansion still building, the API marks
None, notFalse(OpenConceptLab/oclapi2#1071, noted there). The chip then says it will be checked when health checks run, though the build computes it when it ends. Only API callers reach this, since Set as default is disabled while processing.
Checked, no issue
- Right after the switch:
getVersionHealthStatusmatches onversion.expansion_url, includingversionOverrides, so it picks the new default at once. - Field shapes:
annotate_expansion_healthand the expansion serializer'shealthandhealth_is_currentmatch whatexpansionHealth.jsreads. - No conflict with #1071's DB check:
update_health's new default-in-DB guard agrees with the client's default-only gating. - Refresh: a failed refresh keeps its cache, and the forced refetch doesn't loop.
- i18n: every new key is in en, es and pt-BR (with
_many) and zh (with_other). Placeholders match en. - Open core: no plan, quota or entitlement wording or logic.
- CI is green.
|
Thanks. Both nits from the independent review are handled in the description, with no code change:
|
paynejd
left a comment
There was a problem hiding this comment.
Review lead (Claude, for Jon), round 2
COMMENT. At c991254 every code point from round 1 is met and CI is green. This PR can't be approved yet: it settles two things in code that Jon's "Collection and Expansion Rules" page still lists as open, so the wording and the empty-expansion call wait on Jon.
Earlier points (all met or accepted)
- Retried without end after a failed expansions request: met.
CollectionVersionsTab.jsx:289stores only an array response, keeps the cache on a failed refresh, and caches an empty list on a failed first load, so the effect stops asking. - The Members list added concepts and mappings together: met.
getMemberClassCountsreturns counts per resource type, and the dialog lists Concepts and Mappings apart. - Dialog shows the expansion as it was when opened; a default expansion off the first page has nothing to open: accepted, as before.
- Sunny's 11-25 points (deploy order, no re-read after the queued recheck,
Nonewhile building): met in the description or accepted with a reason. - The display matches
core/collections/health.pyon master: four states, all twelve reason codes with the field each one names,head_conceptandhead_mapping,health_is_currentas true, false and null, and the versions list'sexpansion_health {state, is_current}.
Waiting on Jon's rules page (not a defect in the code)
- How states are named to users. The chip, the dialog and all four locale files show "Healthy" and "Unhealthy" (
state_unhealthy; es "No saludable", pt-BR "Não saudável", zh "不健康"). Jon's direction is that people never see "unhealthy", and that a version that checks out gets no label, with each problem named in plain words. The page lists this as still open, with this PR's wording as one of three options. When Jon picks, the change is small:HEALTH_STATESinexpansionHealth.js,ExpansionHealthChip.jsx:26to return nothing when the state checks out, and the four locale files. - An expansion with no members. The chip says "Empty" and the named problems appear only in the dialog, which keeps what the API reports today. Jon hasn't decided whether the problems should come first.
- The four problems Sunny added (value set without an expansion, unresolved system-version entry, references that disagree, members without a reference) are shown as problems. Jon hasn't given his second opinion on them yet.
- "Named at more than one version on purpose" is shown as information, as the rules page proposes, and "source recorded twice" as a problem. Both stay open until Jon rules on references that name their own version.
New finding, optional (nit)
CollectionVersionsTab.jsx:305: when a versions load lands while an earlierexpansions/request for a cached version is still in flight,fetchExpansions(version, true)returns at once (loadingByVersionis true), and the older response can then be the one shown until the next load. It needs two requests overlapping and a health change between them, so no action is needed. If you want it closed, remember the forced refresh and run it when the in-flight request ends.
Tickets' other criteria: Jon's mockup approval, the owners' note and the link to the fixed-version flow (ocl_issues#3006) are not code and aren't here, as the description says.
CI: "Lint and test" passes at c991254.
|
@paynejd a reminder: this PR is ready in code (CI green, all review points met) and is waiting only on your decisions:
Ticket: OpenConceptLab/ocl_issues#3004. |
… health chip; each named problem gets its own, and Uses HEAD and No members are neutral Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d problem, the neutral facts and Unsupported filter Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review lead (Claude, for Jon), round 3, head 39c274e. Verdict: one gap left: the chip labels. Answers 2 to 4 on OpenConceptLab/ocl_online#549 are carried out. Answer 5 (concept and mapping version references) waits for Jon's review, and until then they stay a problem, as built. Met
Gap: answer 1 asks for the rules page's state labels. Most chips use other words. Please use these labels as they stand; the count can follow the label or go in the details:
CI: Lint and test pass. It ships with the badge after Dec 1, as agreed. |
…bels, with the count after them Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s health chips beside the release notice imports Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review lead (Claude, for Jon), round 4, head 4c59632. Verdict: ready to approve. Answers 1 to 4 on OpenConceptLab/ocl_online#549 are carried out. Answer 5 (concept and mapping version references) waits for Jon's review, and until then they stay a problem, as built. It ships with the badge after Dec 1, as agreed.
Nit (optional): three plural forms still put the count first and change the label: "2 sources recorded twice", "2 locked versions deleted", "2 unsupported filters". "Source recorded twice (2)", "Locked version deleted (2)" and "Unsupported filter (2)" would match the others. CI: Lint and test pass. It merges cleanly with main, and #114 no longer conflicts with it. |
…upported-filter chips put the count after the label, like the others Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…list of repo chips marked explicit, evaluated and locked; health lists use repo chips Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd its chip Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…versions column beside the rebuild confirmation's notice lock Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…section's comment Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nformation: a neutral chip after the problems, under their own heading in the details Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review at c1f86b5: changes needed. Update: 1 to 4 are fixed in c736d7c, so only nits (5 to 7) are left: approve with nits. An independent pass over what is new since the round 4 verdict from @paynejd: the repo version chips, the lock icon and the information reasons. It also covers the lock rework, now in c736d7c.
Fine: the fields the chips read in the row and the dialog, the c736d7c also makes the lock a small grey badge on the chip, removes the list's left indent and adds 4px between the two icons. Those display changes were made after the review. |
…, shown only where HEAD's locking or a rebuild keeps the version; no left indent Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ticket: OpenConceptLab/ocl_issues#3004 · Epic: OpenConceptLab/ocl_issues#2942
TBv3 shows the expansion health the API stores (OpenConceptLab/oclapi2#1029, classifier in
core/collections/health.py). Nothing about health is computed in the browser. Expansion rows and the details dialog also show the repo versions as chips.What changes
Health
Chips. An expansion that checks out shows no chip. Otherwise there is one chip per problem, with its count if more than one, such as "Source recorded twice" or "References not resolved (2)". Neutral chips come after the problems: "Concept-version references", "Uses HEAD" and "No members".
Information, not a problem. References that name a concept or mapping version show as a neutral chip, and under their own "Information" heading in the dialog (OQ-39 on OpenConceptLab/ocl_online#549). Health stored before OpenConceptLab/ocl_issues#3003 | Concept- and mapping-version references are information in expansion health, not a problem oclapi2#1106 shows the same way.
Versions table. Each collection version shows its default expansion's chips under its status. It reads the default expansion's
healthandhealth_is_current. Until the expansions load, it uses the version's ownexpansion_health. Clicking a chip opens the details dialog.Expansion rows. The default expansion shows the same chips. The API keeps health for the default expansion only, so other expansions show none.
Not current. The chips keep the last state and are marked out of date. The dialog says whether a recheck is queued. A first check still queued shows "Checking health".
Refreshing. Each later load of the versions list reads the shown rows' expansions again, so the row and the dialog agree. A failed fetch keeps what is shown.
Details dialog. A Health section at the top shows:
A reason code or state this UI doesn't know yet still shows, as the API gives it.
Repo versions as chips
system-versionparameter names it, or it's a value set on a version made with Copy HEAD's parameters;EXPANSION_LOCKED_REPO_VERSION_TOGGLEon, and only the newest evaluated version of each repository.Also
EXPANSION_HEALTH_TOGGLEoff from the start, no expansion has health and no health shows. If it's turned off later, stored health still shows, and nothing rechecks it.Known changes in behaviour
system-versionnames by a URL only the URL registry knows isn't matched, so it has no "a rebuild keeps this version" badge.Deploy order
Not done here
ExpansionHealthChipis built from the MUIChipwith the theme's colours.Tests
expansionHealth.test.js: each state, not-current cases, a version falling back to its own summary, every reason code, information reasons, unknown codes, member counts, and every string in four locales.expansionRepoVersions.test.js: the list's order, when a version is locked, each formsystem-versiontakes, and the strings.npm test334 pass, eslint (npx eslint src --ext js,jsx) is clean, and CI passes.Related
🤖 Generated with Claude Code