Skip to content

Conversation

@abhishekmadan30
Copy link
Contributor

No description provided.

@abhishekmadan30 abhishekmadan30 marked this pull request as ready for review August 29, 2025 20:35
@abhishekmadan30 abhishekmadan30 requested a review from a team as a code owner August 29, 2025 20:35
@abhishekmadan30 abhishekmadan30 requested a review from ahal August 29, 2025 20:35
@abhishekmadan30 abhishekmadan30 changed the title WIP: Convert voluptuous schema to taskgraph Convert voluptuous schema to taskgraph Sep 2, 2025
@abhishekmadan30 abhishekmadan30 changed the title Convert voluptuous schema to taskgraph Convert voluptuous schema to msgspec Sep 2, 2025
@abhishekmadan30 abhishekmadan30 added the BREAKING CHANGE Backwards incompatible request that will require major version bump label Sep 2, 2025
Copy link
Collaborator

@ahal ahal left a 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)

Copy link
Collaborator

@ahal ahal left a 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 :)

@ahal ahal self-requested a review September 17, 2025 17:32
Copy link
Collaborator

@ahal ahal left a 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

Copy link
Collaborator

@ahal ahal left a 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
Copy link
Collaborator

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".

@ahal
Copy link
Collaborator

ahal commented Sep 25, 2025

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)

@abhishekmadan30 abhishekmadan30 force-pushed the schema-conversion branch 5 times, most recently from a1e336a to b936ea5 Compare September 29, 2025 22:21
@abhishekmadan30 abhishekmadan30 force-pushed the schema-conversion branch 4 times, most recently from 7623612 to 7c1b2ab Compare October 9, 2025 19:50
@abhishekmadan30 abhishekmadan30 requested a review from ahal October 9, 2025 20:22
@jcristau
Copy link
Contributor

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?

@abhishekmadan30
Copy link
Contributor Author

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 Schema while msgspec is called Struct and for shared functions, Ill add use_msgspec flag which by default is to false to limit future compatibility issues

@abhishekmadan30 abhishekmadan30 force-pushed the schema-conversion branch 4 times, most recently from 96adc30 to 4f129da Compare October 27, 2025 14:54
@abhishekmadan30 abhishekmadan30 marked this pull request as draft October 27, 2025 15:09
@abhishekmadan30 abhishekmadan30 force-pushed the schema-conversion branch 6 times, most recently from 4fcf590 to 75ca904 Compare October 27, 2025 21:11


def optionally_keyed_by(*arguments):
def optionally_keyed_by(*arguments, use_msgspec=False):
Copy link
Collaborator

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,
):
Copy link
Collaborator

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):
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BREAKING CHANGE Backwards incompatible request that will require major version bump

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants