Skip to content

phase 12: optional dataset-specification checkbox + CI fixes#645

Merged
mosoriob merged 8 commits into
masterfrom
gsd/phase-12-is-optional
May 1, 2026
Merged

phase 12: optional dataset-specification checkbox + CI fixes#645
mosoriob merged 8 commits into
masterfrom
gsd/phase-12-is-optional

Conversation

@mosoriob
Copy link
Copy Markdown
Contributor

Summary

Phase 12 work to surface and persist the is_optional junction column on dataset specifications, plus CI workflow fixes that surfaced during the same plan.

Feature work (12-05)

  • 942ad36 — Add isOptional checkbox + badge to model-configuration.ts.
  • 6ac722b — Mirror isOptional changes in model-configuration-setup.ts.
  • 854fa75 — Move isOptional toggle from DSpec edit dialog to inline row checkbox (DSpec entity PUT cannot persist a junction column; toggle must save via the parent ModelConfiguration nested-write path).
  • d8caed2 — Patch the SDK serializer (DatasetSpecificationToJSON/FromJSON) to preserve isOptional. The current @mintproject/modelcatalog_client build strips the field; long-term fix is a new SDK release.
  • 6a04cf4 — Preserve isOptional across the lazy DSpec refetch in model-catalog-resource. Base setResources lazy-refetches each row by id; entity GET drops the junction column. Subclass override captures the inline isOptional and re-merges on requestUpdate so render and getResources (both read from _loadedResources) stay correct.
  • c1fa149 — Show optional checkbox only in edit mode; render a small grey badge in read mode (only when isOptional=true). User feedback during dev cluster verification.

CI fixes

  • e0547dd — Widen docker-publish.yml trigger to branches: '**' and tag with SAFE_BRANCH (sanitize /-) so slashed feature branches publish images.
  • 9a4459e — Allow Trivy security scan to fail without blocking the workflow.

Verification

  • Visual UI verification on dev cluster confirmed: optional checkbox renders inline in edit mode, badge renders only in read mode when set, value round-trips through ModelConfiguration nested-write path and survives DSpec refetch.
  • Pinned with mca 213bc6c (response mapper hoists junction column as scalar) and migration 1771200016000 applied to dev Hasura.

Test plan

  • CI builds green on slashed branch (gsd/phase-12-is-optional)
  • Image mintproject/mint-ui-lit:c1fa149... published and deployed to dev cluster
  • Optional checkbox + badge render correctly in edit/read modes (visual verification on dev)
  • isOptional persists across save → reload → save cycles

Related PRs

…n and ModelConfiguration

- dataset-specification.ts: add Optional checkbox in edit form, 'optional' badge in read row
- model-configuration.ts: explicit isOptional mapping in hasInput PUT path, informational note in Files section
- custom-apis/model-configuration.ts: override get() to restore isOptional from raw API response (bypasses DatasetSpecificationFromJSON stripping)
- model-configuration-setup.ts: explicit isOptional mapping in hasInput PUT path, informational notes in Files section, setResourcesAsCopy at line 285 preserves isOptional via _loadedResources spread
- custom-apis/model-configuration-setup.ts: override get() to restore isOptional from raw API response
The auto-generated @mintproject/modelcatalog_client v1.8.0 client strips
isOptional from DatasetSpecification request bodies because the field is
not in the v1.8.0 OpenAPI schema used to generate it. Monkey-patch
DatasetSpecificationToJSON / FromJSON / FromJSONTyped on the SDK's models
index module so internal API call sites pass the field through. This also
covers ModelConfiguration / ModelConfigurationSetup PUTs because their
ToJSON delegates to DatasetSpecificationToJSON for hasInput items.
…eckbox

The Optional flag lives on the configuration<->dspec junction row
(modelcatalog_configuration_input.is_optional), not on the DSpec entity.
PUT /datasetspecifications/{id} therefore cannot persist it -- the API
only updates the junction via the parent ModelConfiguration nested-write
path (junctionColumns mapping in resource-registry.ts).

Move the checkbox out of the DSpec edit dialog and into the inline input
list row in both ModelConfiguration and ModelConfigurationSetup editors.
Toggling now mutates the in-memory hasInput[].isOptional; the user clicks
Save Configuration to fire the PUT /modelconfigurations/{id} (or setup)
which carries hasInput[].isOptional, triggering the junction
delete-then-insert with the new flag.
…ation editor

Base ModelCatalogResource.setResources lazy-refetches each row by id and
stores the entity GET response in _loadedResources, which is what render
and getResources read from. The DSpec entity GET has no isOptional
(junction column on modelcatalog_configuration_input, hoisted only by
the parent ModelConfiguration response mapper), so the lazy refetch
wiped it from both render and save paths -- checkbox always showed
unchecked even when DB had is_optional=true.

Override setResources to capture inline isOptional per id into a
_junctionOverlay map, override requestUpdate to merge the overlay onto
_loadedResources when the entity GET resolves with isOptional undefined,
and keep the overlay synced on user toggles. Same component is reused
by ModelConfigurationSetup so the fix covers both editors.
@mosoriob mosoriob merged commit 46d794e into master May 1, 2026
5 of 6 checks passed
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