-
Notifications
You must be signed in to change notification settings - Fork 394
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
[Feature] Skip calling Read after Create/Update operations for notebooks #4173
base: main
Are you sure you want to change the base?
Conversation
get-status
for notebooks in Read after Create/Update operations7ecd15c
to
2ddb757
Compare
This PR adds the ability for a resource to specify that it may not need to call `Read` after `Create` and `Update` operations so we can avoid performing another API call(s). The resource may implement `CanSkipReadAfterCreateAndUpdate` function that can decide if the `Read` operation should be skipped. I decided to move common part from #4173 to make it easier to review
## Changes <!-- Summary of your changes that are easy to understand --> This PR adds the ability for a resource to specify that it may not need to call `Read` after `Create` and `Update` operations so we can avoid performing another API call(s). The resource may implement `CanSkipReadAfterCreateAndUpdate` function that can decide if the `Read` operation should be skipped. I decided to move common part from #4173 to make it easier to review ## Tests <!-- How is this tested? Please see the checklist below and also describe any other relevant tests --> - [x] `make test` run locally - [ ] relevant change in `docs/` folder - [ ] covered with integration tests in `internal/acceptance` - [x] relevant acceptance tests are passing - [ ] using Go SDK
It was found that the import API returns `object_id` as a result of its execution, so we don't really need to call get-status to fill all attributes. This should help when we import a large number of notebooks, i.e., when applying exported resources. This also changes `format` and `language` attributes to `optional,computed` to avoid having issues with defaults, and suppress diff.
2ddb757
to
e80cda6
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 think this PR is doing a bit more than what the title suggests, especially now that #4190 lets us skip calling Read, and this PR is using that. I'm missing some specific Notebook context, so it's tough for me to fully judge if the change is correct. My review is mainly focused on the tests and code, and I don't see any issues there. @mgyucht, do you think you should have another look at it as well?
Co-authored-by: Omer Lachish <[email protected]>
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
Test Details: go/deco-tests/12159341397 |
@rauchy I've added more context to the PR description |
Changes
It's based on #4190.
It was found that the
import
API returnsobject_id
as a result of its execution, so we don't really need to call theRead
operation that will callget-status
to fill all attributes (when we create a notebook using theSOURCE
format).The other formats (
DBC
andJUPYTER
) will still call theRead
to fill in the missing parameters, such aslanguage
.It also changed the
language
tooptional,computed
so we can safely set the value and don't trigger the diff.This should help when we import a large number of notebooks, i.e., when applying exported resources.
Tests
make test
run locallyrelevant change indocs/
folderinternal/acceptance
using Go SDK