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: Migrate given project's (edge) identities to environments v2 #3138

Merged
merged 8 commits into from
Dec 12, 2023

Conversation

khvn26
Copy link
Member

@khvn26 khvn26 commented Dec 11, 2023

Contributes to #3106.

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

This PR adds a migration task that is triggered whenever a given Project model's identity_overrides_v2_migration_status changes to IN_PROGRESS.

The task iterates over project's environments and Edge identities, mapping and writing them to the new flagsmith_environments_v2 table.

How did you test this code?

Added unit tests.

@khvn26 khvn26 requested review from a team and zachaysan and removed request for a team December 11, 2023 19:08
Copy link

vercel bot commented Dec 11, 2023

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

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 11, 2023 8:59pm
flagsmith-frontend-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 11, 2023 8:59pm
flagsmith-frontend-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 11, 2023 8:59pm

Copy link
Contributor

github-actions bot commented Dec 11, 2023

Uffizzi Preview deployment-42581 was deleted.

@khvn26 khvn26 force-pushed the feat/environments-v2-migrator branch from 05d2167 to a2fda31 Compare December 11, 2023 19:57
@khvn26 khvn26 changed the title feat: Migrate (edge) given project's identities to environments v2 feat: Migrate given project's (edge) identities to environments v2 Dec 11, 2023
Copy link
Contributor

@matthewelwell matthewelwell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a few comments but looks pretty good on the whole. Obviously need to fix unit tests too :)

api/projects/tasks.py Show resolved Hide resolved
api/tests/unit/environments/dynamodb/test_unit_services.py Outdated Show resolved Hide resolved
api/util/mappers/dynamodb.py Outdated Show resolved Hide resolved
api/tests/unit/util/mappers/test_unit_mappers_dynamodb.py Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (7883e28) 96.08% compared to head (a2fda31) 96.10%.
Report is 5 commits behind head on main.

❗ Current head a2fda31 differs from pull request most recent head 31ea532. Consider uploading reports for the commit 31ea532 to get more accurate results

Files Patch % Lines
api/environments/dynamodb/dynamodb_wrapper.py 91.30% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3138      +/-   ##
==========================================
+ Coverage   96.08%   96.10%   +0.01%     
==========================================
  Files        1054     1058       +4     
  Lines       31699    31838     +139     
==========================================
+ Hits        30459    30597     +138     
- Misses       1240     1241       +1     

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

khvn26 and others added 2 commits December 11, 2023 20:54
Co-authored-by: Matthew Elwell <matthew.elwell@flagsmith.com>
@khvn26 khvn26 force-pushed the feat/environments-v2-migrator branch from fba2ea3 to cba01f4 Compare December 11, 2023 20:54
@khvn26 khvn26 self-assigned this Dec 11, 2023
@khvn26 khvn26 linked an issue Dec 11, 2023 that may be closed by this pull request
@matthewelwell matthewelwell added this pull request to the merge queue Dec 12, 2023
Merged via the queue into main with commit 574a08e Dec 12, 2023
21 checks passed
@matthewelwell matthewelwell deleted the feat/environments-v2-migrator branch December 12, 2023 10:20
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Populate flagsmith_environments_v2 from flagsmith_identities
3 participants