lablup / lablup/backend.ai

Drop the dead Sentinel branch from GQL SDL generation and switch DTO docs to Unset

Closed
#14,368 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

## Scope

|Target|Change|||
|---|---|---|---|
|`manager/api/gql/schema.py` L11, L1100|Delete the `BackendSentinel` import and the `isinstance(default_value, BackendSentinel)` loop in `CustomizedSchema.as_str()`|
|`tests/unit/manager/api/gql/test_schema_defaults.py` (new)|Assert no input field default in the schema is a `Sentinel` or `Unset` value, and the SDL never prints `= "MISSING"` / `= SENTINEL`|
|`common/dto/manager/v2/AGENTS.md` L42-43|Replace the "SENTINEL = clear" wording with the {{X | None | Unset = Field(default=UNSET)}} rule from the "Update" section of `common/dto/AGENTS.md`|
|`common/dto/manager/v2/KNOWLEDGE.md` L4, L6, L33-42|Replace the two sections with "Update fields separate omitted from null with `Unset`" and "The DTO default never reaches the GraphQL SDL"|

## Note

- The branch is dead code. `gql_pydantic_input` is a plain `@strawberry.input` plus `PydanticInputMixin`; strawberry's pydantic integration (which copies pydantic defaults into the schema) is banned by ruff for inputs. An input field's default is its own `gql_field(default=strawberry.UNSET)`, and the DTO's `UNSET` is applied only when `to_pydantic()` skips the field, so neither `Sentinel` nor `Unset` ever reaches the SDL.

## Done when

- `schema.py` has no `Sentinel` / `Undefined` handling
- The new test fails if a `Sentinel` or `Unset` value ever appears as an input default
- Zero mentions of `SENTINEL` in the two docs

JIRA Issue: BA-7743

Contributor guide

Open the contributing guide

Research direction

Start in manager/api/gql/schema.py, especially CustomizedSchema.as_str(), and review tests/unit/manager/api/gql/test_schema_defaults.py alongside the DTO guidance in common/dto/manager/v2/AGENTS.md and KNOWLEDGE.md. Run the new schema-defaults test; done means dead Sentinel/Undefined handling is gone, input SDL defaults contain neither Sentinel nor Unset, forbidden sentinel spellings are absent, and both docs have no SENTINEL mentions.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, python
Domain
api, documentation, testing
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.