Skip to content

feat(schema): add input can be optional on model configuration#114

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

feat(schema): add input can be optional on model configuration#114
mosoriob merged 7 commits into
masterfrom
gsd/phase-12-is-optional

Conversation

@mosoriob
Copy link
Copy Markdown
Contributor

Summary

  • Widen docker-publish trigger from branches: '*' to branches: '**' so slashed branch names (e.g. gsd/phase-12-is-optional) actually publish images. Mirrors fixes already applied in ui e0547dd and model-catalog-api 7109442.
  • Cast iterated thread_model.data_bindings to a local shape with model_io so executions/index.ts compiles. Phase 12-03 codegen removed the model_io: Model_Io field from Thread_Model_Io and replaced it with modelcatalog_dataset_specification. The query in thread/get.graphql still aliases that relationship as model_io, so runtime payload is correct, but the codegen schema type no longer carries the alias.

This bug only surfaced once branch trigger was widened (since the build never ran on slashed feature branches before). docker/metadata-action type=ref,event=branch already sanitizes slashes, and the SHA tag is also emitted, so trigger widening alone is sufficient on this repo (no SAFE_BRANCH step needed).

Verification

  • npx jest src/classes/tapis/adapters/tests/jobs.test.ts -t optional → both optional input ... is skipped and optional input ... is included pass.
  • Local NODE_OPTIONS=--openssl-legacy-provider npm run build compiles clean.
  • CI (this branch HEAD): green. Image mintproject/ensemble-manager:ef84ba3a7d0d7fbb05bd84a1c29636d4cabd5e4e deployed to dev cluster (helm rev 58, pod healthy on new tag, deployed phase 12-04 TapisJobService skip-when-optional logic).

Test plan

  • CI builds green on slashed branch
  • Unit tests: optional-input skip and include paths pass
  • Image tag visible in Docker Hub
  • helm upgrade rolls out cleanly to dev cluster
  • End-to-end Tapis submission with optional input + no dataslice (requires UI session against dev)

- Add is_optional?: boolean to ModelIO interface in mint-types.ts
- Add is_optional field at junction level in model-info.graphql inputs block
- Add is_optional field at junction level in get-modelcatalog-configuration.graphql inputs block
…behavior

- Import modelIOFromCatalogGQL in test file
- Test case: junction row with is_optional=true returns true
- Test case: junction row without is_optional defaults to false
…nction row

- Change signature from modelIOFromCatalogGQL(io) to modelIOFromCatalogGQL(junctionRow, entityKey?)
- Read is_optional from junctionRow (defaults false when absent)
- Update input_files caller to pass full row instead of row.input
- Update output_files caller to pass entityKey='output'
- Regenerate types.ts with is_optional in modelcatalog_configuration_input fragment types
- appWithOptionalInput: app with one OPTIONAL fileInput named optional_file
- appWithUnknownRequiredInput: app with REQUIRED fileInput not in model.input_files
- modelWithOptionalInput: model with one optional input (is_optional=true)
- Three new test cases: optional+no-dataset skipped, unknown-name throws, optional+dataset included
- When modelInput.is_optional=true and no datasets bound, return [] with info log
- Existing throw for unknown input name (name not found in model.input_files) unchanged
- Optional inputs with datasets bound continue to be included normally
Branch trigger '*' does not match slashed names like gsd/phase-12-is-optional,
so feature branch pushes never produced a docker image. Mirrors fix already
applied in ui (e0547dd) and model-catalog-api (7109442). docker/metadata-action
type=ref,event=branch already sanitizes slashes in the produced tag, and the
SHA tag is already emitted, so trigger widening alone is sufficient here.
Phase 12-03 codegen (0e765b1) removed the model_io: Model_Io field from
Thread_Model_Io and replaced it with modelcatalog_dataset_specification.
The thread/get.graphql query still aliases that relation as model_io, so
the runtime payload is correct, but the codegen schema type no longer
carries the alias. Casts the iterated binding to a local shape with
model_io and dataslice_id so the file compiles. Surfaced once CI started
actually running on slashed feature branches (2e57edd).
@mosoriob mosoriob changed the title ci+types: build slashed feature branches + cast aliased data_bindings feat(schema): add input can be optional on model configuration May 1, 2026
@mosoriob mosoriob merged commit 04c356c into master May 1, 2026
2 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