Skip to content
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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

alexott
Copy link
Contributor

@alexott alexott commented Oct 30, 2024

Changes

It's based on #4190.

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.

Tests

  • make test run locally
  • relevant change in docs/ folder
  • covered with integration tests in internal/acceptance
  • relevant acceptance tests are passing
  • using Go SDK

@alexott alexott requested review from a team as code owners October 30, 2024 12:21
@alexott alexott requested review from rauchy and removed request for a team October 30, 2024 12:21
@alexott alexott requested a review from mgyucht October 30, 2024 12:21
workspace/resource_notebook.go Outdated Show resolved Hide resolved
workspace/resource_notebook.go Outdated Show resolved Hide resolved
@alexott alexott changed the title [Fix] Skip calling get-status for notebooks in Read after Create/Update operations [Feature] Allow to skip calling Read after Create/Update operations Oct 30, 2024
@alexott alexott changed the title [Feature] Allow to skip calling Read after Create/Update operations [Feature] WIP: Allow to skip calling Read after Create/Update operations Oct 30, 2024
@alexott alexott changed the title [Feature] WIP: Allow to skip calling Read after Create/Update operations [Feature] WIP: Skip calling Read after Create/Update operations for notebooks Nov 3, 2024
alexott added a commit that referenced this pull request Nov 3, 2024
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
@alexott
Copy link
Contributor Author

alexott commented Nov 3, 2024

@mgyucht I've opened #4190 with changes in common so it will be easier to review. This PR will be used only for notebook changes.

github-merge-queue bot pushed a commit that referenced this pull request Nov 4, 2024
## 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.
@alexott alexott changed the title [Feature] WIP: Skip calling Read after Create/Update operations for notebooks [Feature] Skip calling Read after Create/Update operations for notebooks Nov 19, 2024
Copy link

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/terraform

Inputs:

  • PR number: 4173
  • Commit SHA: 7a54068be05b4c3bbe6b6c3dc9a410cf7f0dc997

Checks will be approved automatically on success.

@eng-dev-ecosystem-bot
Copy link
Collaborator

Test Details: go/deco-tests/11913582700

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants