Skip to content

Commit 6f090f5

Browse files
committed
Merge branch 'chore/create-flag-migration' into feat/edit-versioned-change-request
2 parents 7cf7c8b + 42704e8 commit 6f090f5

106 files changed

Lines changed: 2828 additions & 1805 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/e2e-tests/action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ runs:
4444
max_attempts: 2
4545
retry_on: error
4646
timeout_minutes: 20
47+
on_retry_command: |
48+
lsof -ti:3000 | xargs kill -9 || true
4749
env:
4850
E2E_TEST_TOKEN: ${{ inputs.e2e_test_token }}
4951
SLACK_TOKEN: ${{ inputs.slack_token }}

.github/workflows/.reusable-docker-e2e-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ jobs:
7676
max_attempts: 2
7777
retry_on: error
7878
timeout_minutes: 20
79+
on_retry_command: |
80+
cd frontend
81+
docker compose down --remove-orphans || true
7982
env:
8083
opts: ${{ inputs.args }}
8184
API_IMAGE: ${{ inputs.api-image }}

.pre-commit-config.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
33
# Ruff version.
4-
rev: v0.14.6
4+
rev: v0.14.10
55
hooks:
66
# Run the linter.
77
- id: ruff
@@ -41,13 +41,17 @@ repos:
4141
require_serial: true
4242
pass_filenames: false
4343
types: [python]
44+
stages: [pre-push]
4445

4546
- repo: https://github.com/python-poetry/poetry
4647
rev: 2.2.1
4748
hooks:
4849
- id: poetry-check
4950
args: ["-C", "api"]
5051

52+
default_install_hook_types: [pre-commit, pre-push]
53+
default_stages: [pre-commit]
54+
5155
ci:
5256
skip: [generate-docs, python-typecheck]
5357
autoupdate_commit_msg: "ci: pre-commit autoupdate"

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "2.205.1"
2+
".": "2.205.7"
33
}

CHANGELOG.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,61 @@
11
# Changelog
22

3+
## [2.205.7](https://github.com/Flagsmith/flagsmith/compare/v2.205.6...v2.205.7) (2026-01-04)
4+
5+
6+
### Bug Fixes
7+
8+
* optimise influxdb calls from handle_api_usage_notifications task ([#6458](https://github.com/Flagsmith/flagsmith/issues/6458)) ([26ac021](https://github.com/Flagsmith/flagsmith/commit/26ac0211e51c08ebc14d4903c79beffb6290627a))
9+
10+
## [2.205.6](https://github.com/Flagsmith/flagsmith/compare/v2.205.5...v2.205.6) (2026-01-02)
11+
12+
13+
### Bug Fixes
14+
15+
* add a batch size to the bulk_update of OrganisationSubscriptionInformationCache objects ([#6456](https://github.com/Flagsmith/flagsmith/issues/6456)) ([38ac162](https://github.com/Flagsmith/flagsmith/commit/38ac16206879e67ea3d72485659231fd61c3d362))
16+
17+
## [2.205.5](https://github.com/Flagsmith/flagsmith/compare/v2.205.4...v2.205.5) (2026-01-02)
18+
19+
20+
### Bug Fixes
21+
22+
* add throttle to flag analytics endpoint ([#6454](https://github.com/Flagsmith/flagsmith/issues/6454)) ([23d37ca](https://github.com/Flagsmith/flagsmith/commit/23d37ca202487dd9523bb5face31a098dd3e77b9))
23+
24+
## [2.205.4](https://github.com/Flagsmith/flagsmith/compare/v2.205.3...v2.205.4) (2026-01-02)
25+
26+
27+
### Bug Fixes
28+
29+
* add throttling for influx query endpoints ([#6453](https://github.com/Flagsmith/flagsmith/issues/6453)) ([64a216a](https://github.com/Flagsmith/flagsmith/commit/64a216a02bbf7639dbd2d1906f0bb4e9b99445cc))
30+
* clean-up-ci-cafe-port-3000-on-error ([#6430](https://github.com/Flagsmith/flagsmith/issues/6430)) ([e6aeff8](https://github.com/Flagsmith/flagsmith/commit/e6aeff8521109eb3a183ae9f86122419461ed785))
31+
* ignore-stale-identity-overrides ([#6444](https://github.com/Flagsmith/flagsmith/issues/6444)) ([5ce3df6](https://github.com/Flagsmith/flagsmith/commit/5ce3df6a3681de9eaa238e7e9a0e2b64f8f27720))
32+
33+
34+
### Dependency Updates
35+
36+
* bump filelock from 3.16.1 to 3.20.1 in /api ([#6425](https://github.com/Flagsmith/flagsmith/issues/6425)) ([d859638](https://github.com/Flagsmith/flagsmith/commit/d859638f256ccc9894e8a4f8f2678d1592b48a17))
37+
* bump js-yaml from 3.14.1 to 3.14.2 in /frontend ([#6329](https://github.com/Flagsmith/flagsmith/issues/6329)) ([5b8292b](https://github.com/Flagsmith/flagsmith/commit/5b8292b32554cfa716b732dc1677f258429e6f60))
38+
* bump marshmallow from 3.20.1 to 3.26.2 in /api ([#6440](https://github.com/Flagsmith/flagsmith/issues/6440)) ([c1d787f](https://github.com/Flagsmith/flagsmith/commit/c1d787f328ca0f2a09b9309abd550443d7244dd4))
39+
* bump qs and express in /docs ([#6449](https://github.com/Flagsmith/flagsmith/issues/6449)) ([bff8570](https://github.com/Flagsmith/flagsmith/commit/bff85709b8a2035ef11571f6ea1003e96203357b))
40+
* bump tmp, testcafe and inquirer in /frontend ([#6450](https://github.com/Flagsmith/flagsmith/issues/6450)) ([bdd9e87](https://github.com/Flagsmith/flagsmith/commit/bdd9e873f55c4a9e794030b2768a810f34acb267))
41+
* bump werkzeug from 3.0.6 to 3.1.4 in /api ([#6348](https://github.com/Flagsmith/flagsmith/issues/6348)) ([60506b9](https://github.com/Flagsmith/flagsmith/commit/60506b9594a59d8e30bee1188b06ab2649249f28))
42+
43+
## [2.205.3](https://github.com/Flagsmith/flagsmith/compare/v2.205.2...v2.205.3) (2025-12-19)
44+
45+
46+
### Dependency Updates
47+
48+
* bump urllib3 dependency ([#6435](https://github.com/Flagsmith/flagsmith/issues/6435)) ([2d208b1](https://github.com/Flagsmith/flagsmith/commit/2d208b18c383a756703eba926830770546eac6ff))
49+
50+
## [2.205.2](https://github.com/Flagsmith/flagsmith/compare/v2.205.1...v2.205.2) (2025-12-17)
51+
52+
53+
### Bug Fixes
54+
55+
* prevent infinite loading on Identity Overrides tab ([#6404](https://github.com/Flagsmith/flagsmith/issues/6404)) ([5295a74](https://github.com/Flagsmith/flagsmith/commit/5295a74a478c686ec3aa9cf5a8a314bc51a7ce13))
56+
* prevent invites with invalid permission groups ([#6407](https://github.com/Flagsmith/flagsmith/issues/6407)) ([d5fbcd7](https://github.com/Flagsmith/flagsmith/commit/d5fbcd784037c39f691ae1760b720110c49c19e1))
57+
* removed-skip-organisation-tests ([#6418](https://github.com/Flagsmith/flagsmith/issues/6418)) ([c69409f](https://github.com/Flagsmith/flagsmith/commit/c69409fe1f75625ba58d7500083d1c283bdc8772))
58+
359
## [2.205.1](https://github.com/Flagsmith/flagsmith/compare/v2.205.0...v2.205.1) (2025-12-16)
460

561

api/app/settings/common.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@
320320
"mfa_code": "5/min",
321321
"invite": "10/min",
322322
"user": USER_THROTTLE_RATE,
323+
"influx_query": "5/min",
323324
},
324325
"DEFAULT_FILTER_BACKENDS": ["django_filters.rest_framework.DjangoFilterBackend"],
325326
"DEFAULT_RENDERER_CLASSES": [
@@ -1468,3 +1469,5 @@
14681469
)
14691470

14701471
PYLON_IDENTITY_VERIFICATION_SECRET = env.str("PYLON_IDENTITY_VERIFICATION_SECRET", None)
1472+
1473+
OSIC_UPDATE_BATCH_SIZE = env.int("OSIC_UPDATE_BATCH_SIZE", default=500)

api/app/settings/test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"invite": "10/min",
1212
"signup": "100/min",
1313
"user": "100000/day",
14+
"influx_query": "50/min",
1415
}
1516

1617
AWS_SSE_LOGS_BUCKET_NAME = "test_bucket"

api/app_analytics/constants.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@
3636
"unknown",
3737
"5.0.0",
3838
],
39-
"flagsmith-java-sdk": ["unknown"],
39+
"flagsmith-java-sdk": [
40+
"unknown",
41+
"8.0.0",
42+
],
4043
"flagsmith-js-sdk": [
4144
"unknown",
4245
"9.3.1",

api/app_analytics/throttles.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from django.views import View
2+
from rest_framework.request import Request
3+
from rest_framework.throttling import SimpleRateThrottle
4+
5+
6+
class InfluxQueryThrottle(SimpleRateThrottle):
7+
scope = "influx_query"
8+
9+
def get_cache_key(self, request: Request, view: View) -> str:
10+
"""
11+
Since we want to throttle requests across multiple views and viewsets that don't
12+
necessarily have the option to define the scope themselves, we override the
13+
get_cache_key method to ensure that the throttling logic behaves as expected.
14+
"""
15+
if request.user and request.user.is_authenticated:
16+
return self.cache_format % {
17+
"scope": self.scope,
18+
"ident": request.user.pk,
19+
}
20+
return self.cache_format % { # pragma: no cover
21+
"scope": self.scope,
22+
"ident": self.get_ident(request),
23+
}

api/app_analytics/views.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from common.core.utils import using_database_replica
55
from drf_yasg.utils import swagger_auto_schema # type: ignore[import-untyped]
66
from rest_framework import status
7-
from rest_framework.decorators import api_view, permission_classes
7+
from rest_framework.decorators import api_view, permission_classes, throttle_classes
88
from rest_framework.fields import IntegerField
99
from rest_framework.generics import CreateAPIView
1010
from rest_framework.permissions import IsAuthenticated
@@ -20,6 +20,7 @@
2020
from app_analytics.mappers import (
2121
map_request_to_labels,
2222
)
23+
from app_analytics.throttles import InfluxQueryThrottle
2324
from environments.authentication import EnvironmentKeyAuthentication
2425
from environments.permissions.permissions import EnvironmentKeyPermissions
2526
from features.models import FeatureState
@@ -135,6 +136,7 @@ class SelfHostedTelemetryAPIView(CreateAPIView): # type: ignore[type-arg]
135136
)
136137
@api_view(["GET"])
137138
@permission_classes([IsAuthenticated, UsageDataPermission])
139+
@throttle_classes([InfluxQueryThrottle])
138140
def get_usage_data_total_count_view(request: Request, organisation_pk: int) -> Response:
139141
organisation = using_database_replica(Organisation.objects).get(id=organisation_pk)
140142
count = get_total_events_count(organisation)
@@ -151,6 +153,7 @@ def get_usage_data_total_count_view(request: Request, organisation_pk: int) -> R
151153
)
152154
@api_view(["GET"])
153155
@permission_classes([IsAuthenticated, UsageDataPermission])
156+
@throttle_classes([InfluxQueryThrottle])
154157
def get_usage_data_view(request: Request, organisation_pk: int) -> Response:
155158
filters = UsageDataQuerySerializer(data=request.query_params)
156159
filters.is_valid(raise_exception=True)

0 commit comments

Comments
 (0)