lablup / lablup/backend.ai

GQL addModelRevision fails with relay global ID for deployment_id

Open Beginner friendly
#10,411 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
670
Forks
183
Avg merge
15h 13m
Merged PRs (30d)
368

Description

## Bug Description

The `addModelRevision` mutation fails when `deploymentId` is passed as a relay global ID (base64-encoded). The resolver calls `input.to_pydantic()` which tries to convert the base64 global ID directly to UUID, causing `badly formed hexadecimal UUID string`.

## Root Cause

The `add_model_revision` resolver in `resolver/revision.py` passes `input.to_pydantic()` directly to the adapter without resolving the relay global ID first. In contrast, `activate_deployment_revision` correctly calls `resolve_global_id()` before constructing the DTO.

## Reproduction

```
mutation {
addModelRevision(input: {
deploymentId: "TW9kZWxEZXBsb3ltZW50OmFhYjUyNDIyLS4uLg==" # relay global ID
name: "v2"
...
}) { revision { id } }
}
```

Error: `badly formed hexadecimal UUID string`

## Fix

In the resolver, resolve the global ID before calling the adapter, matching the pattern used by `activate_deployment_revision`.

JIRA Issue: BA-5362

Contributor guide

Open the contributing guide

Research direction

Start in resolver/revision.py at the add_model_revision resolver and compare it with activate_deployment_revision, which already resolves the relay global ID. Verify the addModelRevision mutation with the provided deploymentId, and confirm that the relay ID is resolved before input.to_pydantic() reaches the adapter without the UUID error.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, python
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.