fix(types): handle CurrentStatus enum suffix shift after MonitorDto.currentStatus addition#26
Merged
Merged
Conversation
…dds currentStatus mono v0.13.0 adds `MonitorDto.currentStatus`. datamodel-code-generator names inline enums by iteration order, so the existing inline StatusPageComponentDto.currentStatus enum shifts from CurrentStatus1 to CurrentStatus2 (MonitorDto + ResultSummaryDto share CurrentStatus — deduped because their value sets are identical). Update the type alias in `types.py` to match the new generator output and re-pin _generated.py + spec to mono v0.13.0. Adds a comment explaining the suffix-stability hazard so future authors don't repeat this lesson the hard way. Caught by mono#369's Spec Evolution Harness — 16 sdk-python tests + 11 mcp-server tests (which depends on sdk-python) failed to import. Co-authored-by: Cursor <cursoragent@cursor.com>
The previous test asserted managedBy was required. mono v0.13 made it optional with a server-side default of API, so SDK consumers can omit it. Replace the negative test with a positive assertion that omitting it parses cleanly with managed_by == None. Co-authored-by: Cursor <cursoragent@cursor.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.
Summary
Unblocks mono#369 launch sprint. When mono v0.13.0 adds
`MonitorDto.currentStatus`, datamodel-code-generator's iteration order
shifts the inline enum suffixes:
`types.py` imports `CurrentStatus1 as StatusPageComponentCurrentStatus`
which fails to resolve after regen. Fix the alias and add a comment
documenting the suffix-stability hazard.
Changes
`MonitorDto.currentStatus` field as Optional)
field can shift suffixes again
Why now
mono#369 Spec Evolution Harness regenerates sdk-python (and mcp-server,
which depends on it) against the new spec and fails to import. 16
sdk-python tests + 11 mcp-server tests gated on this.
Test plan
Made with Cursor