From da4311883769f51dda5af1977fc2fcb4a7a415ef Mon Sep 17 00:00:00 2001 From: Mathieu Leplatre Date: Wed, 4 Dec 2019 14:13:11 +0100 Subject: [PATCH] Expose 'uses_only_baseline_capabilities' field in Remote Settings (ref #2047) --- normandy/recipes/exports.py | 7 ++++++- normandy/recipes/tests/test_exports.py | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/normandy/recipes/exports.py b/normandy/recipes/exports.py index 28956dd08..305a1efec 100644 --- a/normandy/recipes/exports.py +++ b/normandy/recipes/exports.py @@ -25,9 +25,14 @@ def recipe_as_record(recipe): SignatureSerializer, ) # avoid circular imports + recipe_fields = { + **MinimalRecipeSerializer(recipe).data, + # Allow to filter retro compatible recipes in Remote Settings. + "uses_only_baseline_capabilities": recipe.uses_only_baseline_capabilities() + } record = { "id": str(recipe.id), - "recipe": MinimalRecipeSerializer(recipe).data, + "recipe": recipe_fields, "signature": SignatureSerializer(recipe.signature).data, } return record diff --git a/normandy/recipes/tests/test_exports.py b/normandy/recipes/tests/test_exports.py index 5ba233275..792e5de8f 100644 --- a/normandy/recipes/tests/test_exports.py +++ b/normandy/recipes/tests/test_exports.py @@ -333,6 +333,7 @@ def test_recipe_as_remotesettings_record(self, mocked_autograph): "name": recipe.name, "revision_id": str(recipe.revision_id), "capabilities": Whatever(lambda caps: set(caps) == recipe.capabilities), + "uses_only_baseline_capabilities": False, }, "signature": { "public_key": Whatever.regex(r"[a-zA-Z0-9/+]{160}"),