fix(BA-5983): make ModelConfig GQL input fields optional#11531
Draft
jopemachine wants to merge 6 commits intomainfrom
Draft
fix(BA-5983): make ModelConfig GQL input fields optional#11531jopemachine wants to merge 6 commits intomainfrom
jopemachine wants to merge 6 commits intomainfrom
Conversation
The addModelRevision mutation rejected requests that omitted
ModelConfigInput.name (and similarly model_path, ModelServiceConfigInput.port,
ModelHealthCheckInput.path), even though those fields are routinely supplied
by other layers in the revision merge chain — the runtime variant's
default_model_definition, the model vfolder's model-definition.yaml, a
revision preset, or the model_mount_destination default.
Bind the input types (ModelConfigInputGQL, ModelDefinitionInputGQL,
ModelServiceConfigInputGQL, ModelHealthCheckInputGQL) to the *Draft DTO
variants from common/config so every field that the merge chain can
supply is nullable at the GQL boundary. Required-field validation stays
where it belongs — in {ModelConfig,ModelHealthCheck,ModelServiceConfig}Draft
.to_resolved() after the full merge.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: octodog <mu001@lablup.com>
Re-route the GraphQL/REST v2 input boundary through dedicated
``Model{HealthCheck,Metadata,ServiceConfig,Config,Definition}Input``
DTOs in ``common/dto/manager/v2/deployment/request.py`` instead of
binding directly to the merge-chain ``*Draft`` domain models from
``common/config``. The ``*Draft`` types remain the internal merge-chain
representation; the boundary types are owned by the v2 DTO package.
- New v2 Input DTOs mirror the structure of the corresponding
``*Draft`` types (every field optional) so the request layer stays
permissive and lower-priority sources (runtime variant default,
revision preset, vfolder ``model-definition.yaml``) can supply
whatever the request omits.
- ``CreateRevisionInputDTO``/``AddRevisionGQLInputDTO``/v2
``RevisionInput`` now type ``model_definition`` as
``ModelDefinitionInput`` instead of leaking
``ModelDefinitionDraft`` from ``common/config`` into the v2 DTO
package.
- Add ``to_model_definition_draft`` converter alongside the DTOs and
call it at the GQL adapter boundary (``manager/api/adapters/
deployment/adapter.py``) before constructing
``ModelRevisionCreator``; the legacy REST path is unchanged
(still uses the deprecated ``common/dto/manager/deployment``
``RevisionInput``).
- Re-bind ``Model*InputGQL`` types in
``manager/api/gql/deployment/types/revision.py`` to the new v2
Input DTOs and drop the temporary ``*DraftDTO`` aliases introduced
in the previous commit.
Required-field validation still happens in
``ModelConfigDraft.to_resolved`` / ``ModelHealthCheckDraft.to_resolved``
/ ``ModelServiceConfigDraft.to_resolved`` after the merge, which is
called in ``DeploymentController.add_revision``.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Drop verbose per-field descriptions on the new v2 ModelConfig / ModelDefinition / ModelServiceConfig / ModelHealthCheck Input DTOs and their GQL counterparts where the field name is already self-describing or the description merely repeated the merge-chain note. Keep one class-level note on ModelDefinitionInput as the single canonical explanation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Resolves BA-5983
Summary
addModelRevisionrejected requests that omittedModelConfigInput.name(and similarlymodel_path,ModelServiceConfigInput.port,ModelHealthCheckInput.path) withModelConfig.name is required, even though those fields are routinely supplied by other layers in the revision merge chain — the runtime variant'sdefault_model_definition, the model vfolder'smodel-definition.yaml, a revision preset, or themodel_mount_destinationdefault.ModelConfigInputGQL/ModelDefinitionInputGQL/ModelServiceConfigInputGQL/ModelHealthCheckInputGQLto the*DraftDTO variants fromcommon/configso every field the merge chain can supply is nullable at the GQL boundary.{ModelConfig,ModelHealthCheck,ModelServiceConfig}Draft.to_resolved()after the full merge inDeploymentController.add_revision().Schema impact (input-only, non-breaking):
ModelConfigInput.{name, modelPath}: non-null → nullableModelServiceConfigInput.{port, shell, preStartActions}: non-null → nullableModelHealthCheckInput.{path, interval, maxRetries, maxWaitTime, expectedStatusCode, initialDelay}: non-null → nullableModelDefinitionInput.models: non-null → nullableModelConfig,ModelDefinition, etc.) types untouched.The supergraph /
schema.graphql/v2-schema.graphqlregeneration will be pushed by theupdate-api-schemaworkflow on this PR.Test plan
addModelRevisionsucceeds whenmodelDefinition.models[].name/modelPathare omitted and the runtime variant or vfoldermodel-definition.yamlsupplies them.addModelRevisionsucceeds whenmodelDefinitionis omitted entirely (variant baseline alone is sufficient).name/modelPathcontinue to work unchanged.addModelRevisionstill fails with a clear error when no layer supplies a required field (validation atto_resolved()is preserved).update-api-schemaworkflow regeneratesschema.graphql/v2-schema.graphql/supergraph.graphqlcleanly.🤖 Generated with Claude Code
📚 Documentation preview 📚: https://sorna--11531.org.readthedocs.build/en/11531/
📚 Documentation preview 📚: https://sorna-ko--11531.org.readthedocs.build/ko/11531/