-
Notifications
You must be signed in to change notification settings - Fork 405
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix conflicts and merge branch 'main' into feat/add_mypy_type_checking
- Loading branch information
Showing
53 changed files
with
1,365 additions
and
684 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: 'Manual E2E tests' | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
e2e-token: | ||
description: 'The authentication token used by the E2E process' | ||
required: true | ||
e2e-concurrency: | ||
description: 'The concurrency value to use when running the E2E process' | ||
default: 3 | ||
type: number | ||
api-url: | ||
description: 'Which database service to use to run the API against' | ||
default: 'https://api.flagsmith.com/api/v1/' | ||
|
||
jobs: | ||
run-e2e-tests: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
cache: npm | ||
node-version-file: frontend/.nvmrc | ||
cache-dependency-path: frontend/package-lock.json | ||
|
||
- name: Run tests | ||
working-directory: frontend | ||
env: | ||
E2E_TEST_AUTH_TOKEN: ${{ inputs.e2e-token }} | ||
FLAGSMITH_API_URL: ${{ inputs.api-url }} | ||
E2E_CONCURRENCY: ${{ inputs.e2e-concurrency }} | ||
run: | | ||
npm ci | ||
npm run env | ||
npm run test |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
".": "2.154.0" | ||
".": "2.155.0" | ||
} |
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,29 @@ | ||
# Generated by Django 3.2.23 on 2024-11-27 08:46 | ||
|
||
from django.db import migrations, models | ||
import uuid | ||
|
||
from core.migration_helpers import AddDefaultUUIDs | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("environments", "0036_add_is_creating_field"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="environment", | ||
name="uuid", | ||
field=models.UUIDField(editable=False, null=True), | ||
), | ||
migrations.RunPython( | ||
AddDefaultUUIDs("environments", "environment"), | ||
reverse_code=migrations.RunPython.noop, | ||
), | ||
migrations.AlterField( | ||
model_name="environment", | ||
name="uuid", | ||
field=models.UUIDField(default=uuid.uuid4, editable=False, unique=True), | ||
), | ||
] |
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 |
---|---|---|
|
@@ -44,6 +44,7 @@ class Meta: | |
model = Environment | ||
fields = ( | ||
"id", | ||
"uuid", | ||
"name", | ||
"api_key", | ||
"description", | ||
|
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
71 changes: 71 additions & 0 deletions
71
...s/versioning/migrations/0005_fix_scheduled_fs_data_issue_caused_by_enabling_versioning.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,71 @@ | ||
# Generated by Django 4.2.16 on 2024-11-28 13:45 | ||
from django.apps.registry import Apps | ||
from django.db import migrations | ||
from django.db.backends.base.schema import BaseDatabaseSchemaEditor | ||
from django.db.models import F | ||
|
||
|
||
def fix_corrupted_feature_states(apps: Apps, schema_editor: BaseDatabaseSchemaEditor) -> None: | ||
feature_state_model_class = apps.get_model("features", "FeatureState") | ||
environment_feature_version_model_class = apps.get_model( | ||
"feature_versioning", "EnvironmentFeatureVersion" | ||
) | ||
|
||
feature_states_to_update = [] | ||
environment_feature_versions_to_update = [] | ||
|
||
for feature_state in feature_state_model_class.objects.filter( | ||
# We're looking for feature states that live in environments | ||
# that don't have versioning enabled, but have an environment | ||
# feature version associated to them. Moreover, those environment | ||
# feature versions should have a change request associated with | ||
# them. See this PR for further details of the bug we're looking | ||
# to clean up after: https://github.com/Flagsmith/flagsmith/pull/4872 | ||
environment__use_v2_feature_versioning=False, | ||
environment_feature_version__isnull=False, | ||
environment_feature_version__change_request__isnull=False, | ||
).exclude( | ||
# Just to be safe, we exclude feature states for which the version | ||
# belongs to the same feature and environment. This will prevent us | ||
# from accidentally modifying any feature states that belong to | ||
# legitimate environment feature versions but perhaps versioning | ||
# has been switched off for the environment. | ||
environment_feature_version__feature=F("feature"), | ||
environment_feature_version__environment=F("environment") | ||
).select_related("environment_feature_version"): | ||
environment_feature_version = feature_state.environment_feature_version | ||
|
||
# 1. move the change request back to the feature state | ||
feature_state.change_request = environment_feature_version.change_request | ||
|
||
# 2. remove the change request from the EnvironmentFeatureVersion | ||
environment_feature_version.change_request = None | ||
|
||
# 3. remove the environment feature version from the feature state | ||
feature_state.environment_feature_version = None | ||
|
||
feature_states_to_update.append(feature_state) | ||
environment_feature_versions_to_update.append(environment_feature_version) | ||
|
||
feature_state_model_class.objects.bulk_update( | ||
feature_states_to_update, | ||
["environment_feature_version", "change_request"], | ||
) | ||
environment_feature_version_model_class.objects.bulk_update( | ||
environment_feature_versions_to_update, | ||
["change_request"], | ||
) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("feature_versioning", "0004_add_version_change_set"), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython( | ||
fix_corrupted_feature_states, | ||
reverse_code=migrations.RunPython.noop | ||
), | ||
] |
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
Oops, something went wrong.