-
Couldn't load subscription status.
- Fork 48
Convert voluptuous schema to msgspec #752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Convert voluptuous schema to msgspec #752
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this is shaping up nicely!
I don't think I have any other major concerns, it's mostly all nits and a minor changes. So I think you can go ahead and start converting Gecko without fear of a major new request (from me at least :p)
...utter.project_name}}/taskcluster/{{cookiecutter.project_slug}}_taskgraph/transforms/hello.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks for the updates! I don't see any fundamental problems or anything, though I'll reserve the right to request future changes as we test this out in Gecko ;)
I'll avoid approving this for now because I want to hold off landing until we have a working patch for Gecko, but I think you can go ahead and get started on that! Hopefully claude or some clever macros can help with the conversion, because there's going to be a lot of schemas :)
87e0de9 to
750511c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't get a chance to review the whole thing, but I'll leave the comments I had so far for now and resume tomorrow. Figured you might want to get a head start
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more comments, still not all the way through though.
| # List of package tasks this docker image depends on. | ||
| packages: Optional[List[str]] = None | ||
| # Information for indexing this build so its artifacts can be discovered. | ||
| index: Optional[Any] = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should import the schema from gecko_taskgraph.transforms.task and reference the index key there when we come across these "cross references".
|
Thanks, looks like you have some merge conflicts too. Please rebase and push your latest iteration and hopefully I can do one final review (of just the interdiff this time) |
a1e336a to
b936ea5
Compare
7623612 to
7c1b2ab
Compare
|
Is there any chance we can do this in a backwards-compatible way, e.g. by leaving existing util/schema.py APIs alone and adding the msgspec schemas as an alternative, so we can convert things piecemeal and avoid massive changes and likely regressions/back and forth? Or is that impossible for some reason? |
Yep, I am currently working on it, I think we will go with just a different name for each of the schemas. eg volutpous is still called |
96adc30 to
4f129da
Compare
4fcf590 to
75ca904
Compare
75ca904 to
6fa1be5
Compare
|
|
||
|
|
||
| def optionally_keyed_by(*arguments): | ||
| def optionally_keyed_by(*arguments, use_msgspec=False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see what you meant now by having separate functions for this.. For some reason I was thinking there'd be an object passed in here we could test, but that obviously isn't the case. I like this approach though.
| omit_defaults=True, | ||
| rename="kebab", | ||
| forbid_unknown_fields=True, | ||
| ): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you like Struct as a name? Do you have any other ideas? I'm not sure if I like it, but I can't really think of anything better.
| ) | ||
|
|
||
| # Fetches schema using msgspec | ||
| class FetchesStruct(Struct): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind splitting all the actual schema conversion work into a separate commit from supporting msgspec in validate_schema? This way it will be easy to prove that the generation works before and after the change.
No description provided.