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

feat: async the logic for cloning feature states into a cloned environment #4005

Merged
merged 13 commits into from
Oct 30, 2024

Conversation

matthewelwell
Copy link
Contributor

@matthewelwell matthewelwell commented May 22, 2024

Thanks for submitting a PR! Please check the boxes below:

  • I have run pre-commit to check linting
  • I have added information to docs/ if required so people know about the feature!
  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?
  • I have used a Conventional Commit title for this Pull Request

Changes

Adds a new field to the clone environment endpoint which allows the creation of feature states to be offloaded to the task processor. 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.

Related issue: #4489

How did you test this code?

Added a new unit test and updated existing ones where needed, but I have not changed the default behaviour so existing test coverage should be sufficient in most cases.

Copy link

vercel bot commented May 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) Visit Preview Oct 28, 2024 4:41pm
flagsmith-frontend-preview ⬜️ Ignored (Inspect) Visit Preview Oct 28, 2024 4:41pm
flagsmith-frontend-staging ⬜️ Ignored (Inspect) Visit Preview Oct 28, 2024 4:41pm

Copy link
Contributor

github-actions bot commented May 22, 2024

Uffizzi Preview deployment-57691 was deleted.

Copy link

codecov bot commented May 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.30%. Comparing base (8fbc662) to head (475e80b).
Report is 14 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4005   +/-   ##
=======================================
  Coverage   97.30%   97.30%           
=======================================
  Files        1173     1174    +1     
  Lines       40835    40862   +27     
=======================================
+ Hits        39733    39760   +27     
  Misses       1102     1102           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@matthewelwell
Copy link
Contributor Author

Note that this PR is only marked as draft as we need to discuss with the FE team how to implement the 'pending creation' logic. I don't want to review / merge this PR before then as it includes a migration that might need to change.

# Conflicts:
#	api/environments/models.py
# Conflicts:
#	api/environments/serializers.py
@github-actions github-actions bot added the feature New feature or request label Oct 28, 2024
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Oct 28, 2024
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Oct 28, 2024
@matthewelwell matthewelwell marked this pull request as ready for review October 28, 2024 16:31
@matthewelwell matthewelwell requested a review from a team as a code owner October 28, 2024 16:31
@matthewelwell matthewelwell requested review from khvn26 and removed request for a team October 28, 2024 16:31
@github-actions github-actions bot removed the feature New feature or request label Oct 28, 2024
Copy link
Contributor

github-actions bot commented Oct 28, 2024

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-e2e:pr-4005 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api-test:pr-4005 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-4005 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api:pr-4005 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-4005 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-4005 Finished ✅ Results

@github-actions github-actions bot added the feature New feature or request label Oct 28, 2024
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Oct 28, 2024
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Oct 28, 2024
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Oct 28, 2024
@matthewelwell matthewelwell added this pull request to the merge queue Oct 30, 2024
Merged via the queue into main with commit 02f5f71 Oct 30, 2024
35 checks passed
@matthewelwell matthewelwell deleted the feat/async-environment-clone branch October 30, 2024 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the REST API feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants