-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Protected block compatibility #6986
Conversation
✅ Deploy Preview for prefect-orion ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
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.
The overall approach looks good to me. Just a couple of small nits on the tests.
response = await client_with_unprotected_block_api.delete( | ||
f"/block_schemas/{block_schema.id}" | ||
) | ||
assert response.status_code != 403 |
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.
Should we assert that status code is 204 like the other tests that have a successful deletion?
tests/orion/api/test_block_types.py
Outdated
response = await client_with_unprotected_block_api.delete( | ||
f"/block_types/{system_block_type.id}" | ||
) | ||
assert response.status_code != status.HTTP_403_FORBIDDEN |
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.
Should we assert that status code is 204 like the other tests that have a successful deletion?
tests/orion/api/test_block_types.py
Outdated
description="Hi there!", | ||
).dict(json_compatible=True), | ||
) | ||
assert response.status_code != status.HTTP_403_FORBIDDEN |
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.
assert response.status_code != status.HTTP_403_FORBIDDEN | |
assert response.status_code != status.HTTP_204_NO_CONTENT |
json_compatible=True | ||
), | ||
) | ||
assert response.status_code != 403 |
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.
assert response.status_code != 403 | |
assert response.status_code != 201 |
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.
Can you use the fastapi.status
enums?
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 do think this is mildly out of scope since I didn't want to go and change every assertion in the block schema test suite but I went ahead and did this anyway
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 for taking it on anyway. Didn't realize the whole file was out of date.
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!
The addition of protected block types is a breaking API version change. In order to prevent disruption to users we both bump the API version and add a passthrough for older clients.
Closes #6981
Example
Checklist
<link to issue>
"fix
,feature
,enhancement