diff --git a/services/common/package.json b/services/common/package.json index 243595f7e4..0d3ecaf728 100644 --- a/services/common/package.json +++ b/services/common/package.json @@ -32,7 +32,7 @@ "@syncfusion/ej2-react-filemanager": "27.1.55", "@syncfusion/ej2-react-pdfviewer": "27.1.58", "@syncfusion/ej2-splitbuttons": "27.1.56", - "flagsmith": "3.19.1", + "flagsmith": "7.0.2", "p-limit": "3.1.0", "query-string": "5.1.1", "ts-loader": "9.5.1" diff --git a/services/core-api/app/api/utils/feature_flag.py b/services/core-api/app/api/utils/feature_flag.py index 77b958bf52..4b9ea64d7d 100644 --- a/services/core-api/app/api/utils/feature_flag.py +++ b/services/core-api/app/api/utils/feature_flag.py @@ -23,14 +23,17 @@ def __str__(self): flagsmith = Flagsmith( - environment_id=Config.FLAGSMITH_KEY, - api=Config.FLAGSMITH_URL, + environment_key=Config.FLAGSMITH_KEY, + api_url=Config.FLAGSMITH_URL, ) def is_feature_enabled(feature): try: - return flagsmith.has_feature(feature) and flagsmith.feature_enabled(feature) + feature = str(feature).strip() + flags = flagsmith.get_environment_flags() + + return feature in flags.flags and flags.is_feature_enabled(feature) except Exception as e: current_app.logger.error(f'Failed to look up feature flag for: {feature}. ' + str(e)) return False diff --git a/services/core-api/requirements.txt b/services/core-api/requirements.txt index 16cdd748b3..cc104a9ed7 100644 --- a/services/core-api/requirements.txt +++ b/services/core-api/requirements.txt @@ -1,7 +1,7 @@ Authlib==1.3.0 cached-property==1.5.1 factory-boy==2.12.0 -flagsmith==2.0.1 +flagsmith==3.8.0 Flask==3.0.1 Flask-Caching==2.1.0 Flask-Cors==4.0.0 diff --git a/yarn.lock b/yarn.lock index 0e6a37395d..58c5cf42ca 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1683,7 +1683,7 @@ __metadata: "@testing-library/jest-dom": 6.4.8 clean-webpack-plugin: 4.0.0 copy-webpack-plugin: 12.0.2 - flagsmith: 3.19.1 + flagsmith: 7.0.2 hard-source-webpack-plugin: 0.13.1 html-webpack-plugin: 5.6.2 image-minimizer-webpack-plugin: 4.1.0 @@ -9125,10 +9125,10 @@ __metadata: languageName: node linkType: hard -"flagsmith@npm:3.19.1": - version: 3.19.1 - resolution: "flagsmith@npm:3.19.1" - checksum: df96b650a73354eb1fcba44ff94fe28c69dbb5b58061fa8782b69b8e959817a9f821070c211bbcb807bda7c9317fc954811ba055718845fb2da7cbd0028da07b +"flagsmith@npm:7.0.2": + version: 7.0.2 + resolution: "flagsmith@npm:7.0.2" + checksum: c58b1340fbcac3bf2d95ae9ebd38240d196ecbee1afcacfb8919b53ad6f9041162b62361cb4f5a7cde232b062ea16a697f51de25eb12cd9b3df6154a178bff9b languageName: node linkType: hard