-
Notifications
You must be signed in to change notification settings - Fork 275
feat(staging): use GCS/new entities for API #3776
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
Conversation
another-rex
left a comment
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.
Looks pretty good to me
gcp/api/server_new.py
Outdated
|
|
||
| import osv | ||
|
|
||
| CURSOR_LAST_ID = 'last_id' |
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.
Hmm can this be done at the metadata's type level? I.e. make metadata a struct with specific fields, and parse it into those fields, rather than having a dict that anyone can fill with anything. This way we can also limit the length of the ID to something reasonable as well.
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've turned metadata into a dataclass, and made it raise the invalid page token error for unknown keys.
I didn't feel like doing the length check, since it isn't passed directly to datastore anyway.
Trying out the new GCS-backed vulnerabilities for making API queries on the staging instance (only). This should give us a good idea on the performance improvements.
server_new.pyto (temporarily) keep the new matching logic a bit separate