-
Notifications
You must be signed in to change notification settings - Fork 406
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0135570
commit bcfb10e
Showing
64 changed files
with
3,355 additions
and
384 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
api/environments/migrations/0033_add_environment_feature_state_version_logic.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 3.2.23 on 2023-11-21 10:23 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('environments', '0032_rename_use_mv_v2_evaluation_to_use_in_percentage_split_evaluation'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='environment', | ||
name='use_v2_feature_versioning', | ||
field=models.BooleanField(default=False), | ||
), | ||
migrations.AddField( | ||
model_name='historicalenvironment', | ||
name='use_v2_feature_versioning', | ||
field=models.BooleanField(default=False), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
api/environments/permissions/migrations/0009_add_environment_feature_state_version_logic.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Generated by Django 3.2.23 on 2023-11-21 10:23 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
('environment_permissions', '0008_add_manage_segment_overrides_permission'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='userenvironmentpermission', | ||
name='user', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='environment_permissions', to=settings.AUTH_USER_MODEL), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import typing | ||
|
||
from features.dataclasses import EnvironmentFeatureOverridesData | ||
from features.versioning.versioning_service import get_environment_flags_list | ||
|
||
if typing.TYPE_CHECKING: | ||
from environments.models import Environment | ||
|
||
|
||
def get_overrides_data( | ||
environment: "Environment", | ||
) -> typing.Dict[int, EnvironmentFeatureOverridesData]: | ||
""" | ||
Get the number of identity / segment overrides in a given environment for each feature in the | ||
project. | ||
:param environment: the environment to get the overrides data for | ||
:return: dictionary of {feature_id: EnvironmentFeatureOverridesData} | ||
""" | ||
environment_feature_states_list = get_environment_flags_list(environment) | ||
all_overrides_data = {} | ||
|
||
for feature_state in environment_feature_states_list: | ||
env_feature_overrides_data = all_overrides_data.setdefault( | ||
feature_state.feature_id, EnvironmentFeatureOverridesData() | ||
) | ||
if feature_state.feature_segment_id: | ||
env_feature_overrides_data.num_segment_overrides += 1 | ||
elif feature_state.identity_id: | ||
env_feature_overrides_data.add_identity_override() | ||
all_overrides_data[feature_state.feature_id] = env_feature_overrides_data | ||
|
||
return all_overrides_data |
37 changes: 37 additions & 0 deletions
37
api/features/migrations/0061_add_environment_feature_state_version_logic.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Generated by Django 3.2.23 on 2023-11-21 10:23 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('feature_versioning', '0001_add_environment_feature_state_version_logic'), | ||
('environments', '0033_add_environment_feature_state_version_logic'), | ||
('segments', '0019_add_audit_to_condition'), | ||
('features', '0060_feature_group_owners'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='featuresegment', | ||
name='environment_feature_version', | ||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='feature_segments', to='feature_versioning.environmentfeatureversion'), | ||
), | ||
migrations.AddField( | ||
model_name='featurestate', | ||
name='environment_feature_version', | ||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='feature_states', to='feature_versioning.environmentfeatureversion'), | ||
), | ||
migrations.AddField( | ||
model_name='historicalfeaturesegment', | ||
name='environment_feature_version', | ||
field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='feature_versioning.environmentfeatureversion'), | ||
), | ||
migrations.AddField( | ||
model_name='historicalfeaturestate', | ||
name='environment_feature_version', | ||
field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='feature_versioning.environmentfeatureversion'), | ||
), | ||
] |
Oops, something went wrong.
bcfb10e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
flagsmith-frontend-staging – ./frontend
flagsmith-frontend-staging-git-main-flagsmith.vercel.app
flagsmith-staging-frontend.vercel.app
staging.flagsmith.com
flagsmith-frontend-staging-flagsmith.vercel.app