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: Edge V2 migration opt-in, capacity budget for migration #3881

Merged
merged 14 commits into from May 16, 2024

Conversation

khvn26
Copy link
Member

@khvn26 khvn26 commented May 3, 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 used a Conventional Commit title for this Pull Request
  • I have filled in the "How did you test this code" section below?

Changes

Naming

IdentityOverridesV2MigrationStatus enumeration is renamed to EdgeV2MigrationStatus.

Settings

Added:

  • EDGE_V2_MIGRATION_READ_CAPACITY_BUDGET: controls how much read capacity is allowed during migration to environments_v2. Default value is 0. The idea is to increase it to a sensible amount whenever Edge V2 is live.

Business logic

Renamed:

  • Project.identity_overrides_v2_migration_status -> Project.edge_v2_migration_status.

Modified:

  • DynamoIdentityWrapper.iter_all_items_paginated now accepts capacity_budget argument. If the budget is reached or exceeded during iteration, it raises a CapacityBudgetExceeded exception. If capacity_budget is 0, the error is raised before any request to DynamoDB is made.

Added:

  • Project.edge_v2_read_capacity_budget overrides the EDGE_V2_MIGRATION_READ_CAPACITY_BUDGET for the given project. Field value is null by default.
  • EdgeV2MigrationStatus.INCOMPLETE marks projects that have exceeded the read capacity budget during migration and have only environment documents migrated. Identity override migration is completely skipped for such projects.

API

  • Added edge_v2_migration_status to project endpoints so the migration can be triggered via REST API.
  • edge_v2_read_capacity_budget is only modifiable via Django admin page.

How did you test this code?

All code covered with unit tests.

Copy link

vercel bot commented May 3, 2024

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 May 15, 2024 4:01pm
flagsmith-frontend-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 15, 2024 4:01pm
flagsmith-frontend-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 15, 2024 4:01pm

@github-actions github-actions bot added the api Issue related to the REST API label May 3, 2024
@khvn26 khvn26 marked this pull request as draft May 3, 2024 10:44
@khvn26 khvn26 force-pushed the feat/environments-v2-opt-in branch from 6b73235 to e7dca08 Compare May 3, 2024 10:44
Copy link
Contributor

github-actions bot commented May 3, 2024

Uffizzi Preview deployment-51200 was deleted.

@codecov-commenter
Copy link

codecov-commenter commented May 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.17%. Comparing base (e8d1337) to head (031a0df).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3881      +/-   ##
==========================================
+ Coverage   96.01%   96.17%   +0.16%     
==========================================
  Files        1138     1141       +3     
  Lines       36443    36457      +14     
==========================================
+ Hits        34992    35064      +72     
+ Misses       1451     1393      -58     

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

@khvn26 khvn26 force-pushed the feat/environments-v2-opt-in branch from e7dca08 to a281a7b Compare May 3, 2024 12:53
@khvn26 khvn26 force-pushed the feat/environments-v2-opt-in branch from 119df5e to 66a64b0 Compare May 7, 2024 12:50
@khvn26 khvn26 requested review from a team, gagantrivedi and matthewelwell and removed request for a team May 7, 2024 13:05
@khvn26 khvn26 marked this pull request as ready for review May 7, 2024 13:06
@khvn26 khvn26 requested a review from gagantrivedi May 14, 2024 13:30
@khvn26 khvn26 force-pushed the feat/environments-v2-opt-in branch from bed542b to 42991cb Compare May 15, 2024 15:55
@github-actions github-actions bot added front-end Issue related to the React Front End Dashboard docs labels May 15, 2024
@khvn26 khvn26 added this pull request to the merge queue May 16, 2024
Merged via the queue into main with commit bca4165 May 16, 2024
24 checks passed
@khvn26 khvn26 deleted the feat/environments-v2-opt-in branch May 16, 2024 04:26
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 docs front-end Issue related to the React Front End Dashboard
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants