Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions api/features/versioning/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
extensions={
"x-gram": {
"name": "get_environment_feature_versions",
"description": "Retrieves version information for a feature flag in a specific environment.",
"description": "Retrieves version information for a feature flag in a specific environment. Use this for environments with v2 feature versioning.",
},
},
),
Expand All @@ -66,7 +66,7 @@
extensions={
"x-gram": {
"name": "create_environment_feature_version",
"description": "Creates a new version for a feature flag in a specific environment.",
"description": "Creates a new version for a feature flag in a specific environment. Use this for environments with v2 feature versioning.",
},
},
),
Expand Down Expand Up @@ -158,6 +158,15 @@ def perform_destroy(self, instance: EnvironmentFeatureVersion) -> None:

super().perform_destroy(instance)

@extend_schema(
tags=["mcp"],
extensions={
"x-gram": {
"name": "publish_environment_feature_version",
"description": "Publishes a feature version to make it live in the environment. Use this for environments with v2 feature versioning.",
},
},
)
@action(detail=True, methods=["POST"])
def publish(self, request: Request, **kwargs) -> Response: # type: ignore[no-untyped-def]
ef_version = self.get_object()
Expand Down Expand Up @@ -217,7 +226,7 @@ def get_queryset(self): # type: ignore[no-untyped-def]
extensions={
"x-gram": {
"name": "get_environment_feature_version_states",
"description": "Retrieves feature state information for a specific version in an environment.",
"description": "Retrieves feature state information for a specific version in an environment. Use this for environments with v2 feature versioning.",
},
},
),
Expand All @@ -229,7 +238,7 @@ def get_queryset(self): # type: ignore[no-untyped-def]
extensions={
"x-gram": {
"name": "create_environment_feature_version_state",
"description": "Creates a new feature state for a specific version in an environment.",
"description": "Creates a new feature state for a specific version in an environment. Use this for environments with v2 feature versioning.",
},
},
),
Expand All @@ -241,7 +250,7 @@ def get_queryset(self): # type: ignore[no-untyped-def]
extensions={
"x-gram": {
"name": "update_environment_feature_version_state",
"description": "Updates an existing feature state for a specific version in an environment.",
"description": "Updates an existing feature state for a specific version in an environment. Use this for environments with v2 feature versioning.",
},
},
),
Expand Down
12 changes: 12 additions & 0 deletions api/features/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,18 @@ def update_feature_state_value(self, value, feature_state): # type: ignore[no-u
return feature_state_value


@method_decorator(
name="update",
decorator=extend_schema(
tags=["mcp"],
extensions={
"x-gram": {
"name": "update_environment_feature_state",
"description": "Updates a feature state in an environment, including enabled status and value. Use this for environments without v2 feature versioning.",
},
},
),
)
class EnvironmentFeatureStateViewSet(BaseFeatureStateViewSet):
permission_classes = [EnvironmentFeatureStatePermissions]

Expand Down
Loading