feat: async the logic for cloning feature states into a cloned environment #4005
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thanks for submitting a PR! Please check the boxes below:
pre-commit
to check lintingdocs/
if required so people know about the feature!Changes
This PR utilises the task processor to handle the cloning of feature states when cloning an environment. This stemmed from work I did to handle the cloning of an environment that is using v2 versioning, however, even the cloning of an environment on the old versioning system is pretty intensive.
This PR also adds a new field
is_creating
to the environment model which can be used by the frontend to determine when an environment has been successfully cloned.Before merging this, we will need to get the FE to use the
is_creating
field to show some indication that the environment is not yet ready for use.Related issue: #4489
How did you test this code?
Since we're enforcing synchronous running of tasks in the test suite, the existing tests on the
Environment.clone
method cover the behaviour. I added an extra assertion to a couple of existing tests for the newis_creating
field that I added to the environment model.