-
Notifications
You must be signed in to change notification settings - Fork 179
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
feat(app,api): allow rich version specification for python protocols #4358
Conversation
This allows and requires apiv2 users to have 'apiLevel': '2.0' in their metadata dict. This is parsed and stored along with the protocol and passed along with RPC. This allows specification of API minor versions. Closes #4338
Codecov Report
@@ Coverage Diff @@
## edge #4358 +/- ##
==========================================
- Coverage 56.05% 55.65% -0.41%
==========================================
Files 896 897 +1
Lines 25125 25410 +285
==========================================
+ Hits 14085 14142 +57
- Misses 11040 11268 +228
Continue to review full report at Codecov.
|
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.
Right now in simulation I get an error when I run an api v1 protocol with a version level 2.0
, I think we should modify get_version
to return api versions based on the feature flag. More detail in-line
@@ -46,7 +50,7 @@ def _parse_python( | |||
filename=ast_filename) | |||
metadata = extract_metadata(parsed) | |||
protocol = compile(parsed, filename=ast_filename, mode='exec') | |||
version = infer_version(metadata, parsed) | |||
version = get_version(metadata, parsed) |
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.
For this function, I think we should only evaluate the metadata blob for a version if we are in server api v2. For server api v1 we should default to infer the version using AST --> this will allow simulation to still be able to differentiate protocols while we finish up backcompat.
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.
Talked F2F with Seth and realized that the v1/v2 feature flag won't be relevant in our next prod release so my comment wouldn't matter at that point.
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.
JS side LGTM
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 good, tested on 🌆 2.0
update.apiLevel = apiSession.api_level || 1 | ||
if (Array.isArray(apiSession.api_level)) { | ||
update.apiLevel = apiSession.api_level | ||
} else if (apiSession.api_level) { |
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.
maybe it's obvious to ppl but might be good to have comment explaining that this case is to support back-compat
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.
👍
This allows and requires apiv2 users to have
'apiLevel': '2.0'
in their metadata dict.
This is parsed and stored along with the protocol and passed along with RPC.
This allows specification of API minor versions.
Closes #4338