Skip to content

Feat/support tapis app#2

Merged
mosoriob merged 8 commits intomainfrom
feat/support-tapis-app
May 2, 2026
Merged

Feat/support tapis app#2
mosoriob merged 8 commits intomainfrom
feat/support-tapis-app

Conversation

@mosoriob
Copy link
Copy Markdown
Contributor

@mosoriob mosoriob commented May 1, 2026

Summary

Three independent changes bundled on this branch:

  1. Tapis app proxy endpoints — migrate /tapis/{tenant}/apps listing + /tapis/{tenant}/apps/{app_id}/{app_version} lookup from the legacy model-catalog-fastapi. Uses the @tapis/tapis-typescript SDK and forwards the caller's Authorization: Bearer … as the Tapis X-Tapis-Token (via Configuration.apiKey). Errors propagate the upstream status; missing tenant/token return 400/401; SDK failures fall back to 502.

  2. Phase 12 is_optional on junction rows — surface the is_optional flag stored on modelcatalog_*configuration*_input junction tables on the v1.8.0 hasInput contract.

    • RelationshipConfig gets an optional junctionColumns map (field-maps.ts, resource-registry.ts).
    • Writes: service.ts (PUT delete-then-insert) and request.ts (buildJunctionInserts CREATE) spread junctionColumns onto the outer junction row; nested entity copy loop now excludes those camelCase keys so isOptional does not leak into the nested dataset_specification insert.
    • Reads: response.ts hoists declared junctionColumns from the junction row onto the nested entity as scalars (not array-wrapped). The first attempt wrapped them like v1.8.0 object relationships, which made the UI checkbox truthy on every refresh because !![false] === true.
    • openapi.yaml adds isOptional (nullable boolean) to DatasetSpecification.
  3. CI: feature-branch docker imagesci.yml was hardcoded to refs/heads/main, so slashed branches like feat/support-tapis-app never produced an image. Mirrors the ui repo fix:

    • branches: '**'
    • build-and-push runs on every push
    • SAFE_BRANCH replaces / with - (Docker tag spec forbids /)
    • :latest retag gated to a separate post-build job that only fires on main

Test plan

  • npm testrequest.test.ts covers is_optional propagation (D-21, D-22); response.test.ts asserts scalar (not array) hoisting for true/false/null.
  • PUT /modelconfigurations/{id} with hasInput[].isOptional round-trips through GET.
  • GET /tapis/{tenant}/apps with a valid Bearer token returns [{tenant, id, version}, …].
  • GET /tapis/{tenant}/apps/{app_id}/{app_version} returns the merged Tapis app payload.
  • Missing Authorization → 401; missing path params → 400; upstream Tapis error → upstream status forwarded.
  • CI produces a docker image tagged feat-support-tapis-app and does not retag :latest.

…ntries

- Add junctionColumns optional field to RelationshipConfig interface
- Set junctionColumns: { is_optional: isOptional } on modelconfigurations.hasInput
- Set junctionColumns: { is_optional: isOptional } on modelconfigurationsetups.hasInput
- Set junctionColumns: { is_optional: isOptional } on configurationsetups.hasInput alias
…d request CREATE paths

- field-maps.ts: add is_optional at junction row level (sibling of input {})
- service.ts: spread junctionColumns onto junction rows in PUT delete-then-insert path
- request.ts: spread junctionColumns onto outer junction row in buildJunctionInserts CREATE path
…s_optional (D-21, D-22)

- Test 10: isOptional=true flows to is_optional on outer junction row (D-21)
- Test 11: absent isOptional produces no is_optional key on junction row (D-22)
- Fix: exclude junctionColumns camelCase keys from nested entity data copy loop
  to prevent isOptional leaking into the nested dataset_specification insert
…ema in openapi.yaml

- Declare isOptional as nullable boolean on DatasetSpecification
- Field represents junction-row metadata surfaced on hasInput items
…es build

CI was hardcoded to refs/heads/main, so branches like gsd/phase-12-is-optional
never produced a docker image. Mirrors the ui repo fix (e0547dd):
- branches: '**' so slashed feature branches trigger
- build-and-push fires on any push event
- SAFE_BRANCH replaces '/' with '-' (Docker tag spec forbids '/')
- :latest gated to a separate post-build retag job that only fires on main
GET /modelconfigurations/{id} dropped is_optional from hasInput[] because
transformRow's junction traversal pivoted into the nested target entity
(DSpec) and discarded outer junction-row scalars. Hoist any column listed
in relConfig.junctionColumns onto the transformed entity (array-wrapped
per v1.8.0 contract) so writes round-trip through GET.
…mapper

Junction column values like is_optional (bool) were wrapped in a
single-element array, mirroring v1.8.0's array-wrapped object property
convention. That convention is for relationship/object fields, not for
plain junction scalars. The wrap broke the UI: !![false] is true (any
array is truthy), so the isOptional checkbox flipped to checked on every
refresh regardless of the DB value.

Emit junction column hoist as scalar so the SDK FromJSONTyped patch
copies it through to ds.isOptional verbatim and the UI sees the real
boolean.

Test: response.test.ts now asserts isOptional is scalar (not array) for
both true and false junction column values, and omits the field when the
column is null.
Migrate Tapis app listing and lookup from legacy model-catalog-fastapi.
Uses @tapis/tapis-typescript SDK; forwards Bearer JWT as X-Tapis-Token.
@mosoriob mosoriob merged commit 48eec83 into main May 2, 2026
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