diff --git a/merino/curated_recommendations/corpus_backends/corpus_api_backend.py b/merino/curated_recommendations/corpus_backends/corpus_api_backend.py index 12127c3ab..7b6039fec 100644 --- a/merino/curated_recommendations/corpus_backends/corpus_api_backend.py +++ b/merino/curated_recommendations/corpus_backends/corpus_api_backend.py @@ -85,13 +85,13 @@ def headers(self): For ids not in the table, null is returned. """ SCHEDULED_SURFACE_ID_TO_UTM_SOURCE: dict[ScheduledSurfaceId, str] = { - ScheduledSurfaceId.NEW_TAB_EN_US: "pocket-newtab-en-us", - ScheduledSurfaceId.NEW_TAB_EN_GB: "pocket-newtab-en-gb", - ScheduledSurfaceId.NEW_TAB_EN_INTL: "pocket-newtab-en-intl", - ScheduledSurfaceId.NEW_TAB_DE_DE: "pocket-newtab-de-de", - ScheduledSurfaceId.NEW_TAB_ES_ES: "pocket-newtab-es-es", - ScheduledSurfaceId.NEW_TAB_FR_FR: "pocket-newtab-fr-fr", - ScheduledSurfaceId.NEW_TAB_IT_IT: "pocket-newtab-it-it", + ScheduledSurfaceId.NEW_TAB_EN_US: "firefox-newtab-en-us", + ScheduledSurfaceId.NEW_TAB_EN_GB: "firefox-newtab-en-gb", + ScheduledSurfaceId.NEW_TAB_EN_INTL: "firefox-newtab-en-intl", + ScheduledSurfaceId.NEW_TAB_DE_DE: "firefox-newtab-de-de", + ScheduledSurfaceId.NEW_TAB_ES_ES: "firefox-newtab-es-es", + ScheduledSurfaceId.NEW_TAB_FR_FR: "firefox-newtab-fr-fr", + ScheduledSurfaceId.NEW_TAB_IT_IT: "firefox-newtab-it-it", } diff --git a/tests/integration/api/v1/curated_recommendations/test_curated_recommendations.py b/tests/integration/api/v1/curated_recommendations/test_curated_recommendations.py index 7d2e11d98..aff1a28e2 100644 --- a/tests/integration/api/v1/curated_recommendations/test_curated_recommendations.py +++ b/tests/integration/api/v1/curated_recommendations/test_curated_recommendations.py @@ -184,7 +184,7 @@ async def test_curated_recommendations(repeat): expected_recommendation = CuratedRecommendation( scheduledCorpusItemId="de614b6b-6df6-470a-97f2-30344c56c1b3", url=HttpUrl( - "https://getpocket.com/explore/item/milk-powder-is-the-key-to-better-cookies-brownies-and-cakes?utm_source=pocket-newtab-en-us" + "https://getpocket.com/explore/item/milk-powder-is-the-key-to-better-cookies-brownies-and-cakes?utm_source=firefox-newtab-en-us" ), title="Milk Powder Is the Key to Better Cookies, Brownies, and Cakes", excerpt="Consider this pantry staple your secret ingredient for making more flavorful desserts.", @@ -296,7 +296,7 @@ async def test_curated_recommendations_utm_source(): assert len(corpus_items) == 80 # Assert all corpus_items have expected fields populated. # check that utm_source is present and has the correct value in all urls - assert all("?utm_source=pocket-newtab-en-us" in item["url"] for item in corpus_items) + assert all("?utm_source=firefox-newtab-en-us" in item["url"] for item in corpus_items) assert all(item["publisher"] for item in corpus_items) assert all(item["imageUrl"] for item in corpus_items) diff --git a/tests/unit/curated_recommendations/test_corpus_api_backend.py b/tests/unit/curated_recommendations/test_corpus_api_backend.py index d107a6bdb..6c614b865 100644 --- a/tests/unit/curated_recommendations/test_corpus_api_backend.py +++ b/tests/unit/curated_recommendations/test_corpus_api_backend.py @@ -138,13 +138,13 @@ def test_get_utm_source_return_none(scheduled_surface_id): @pytest.mark.parametrize( ("scheduled_surface_id", "expected_utm_source"), [ - (ScheduledSurfaceId.NEW_TAB_EN_US, "pocket-newtab-en-us"), - (ScheduledSurfaceId.NEW_TAB_EN_GB, "pocket-newtab-en-gb"), - (ScheduledSurfaceId.NEW_TAB_EN_INTL, "pocket-newtab-en-intl"), - (ScheduledSurfaceId.NEW_TAB_DE_DE, "pocket-newtab-de-de"), - (ScheduledSurfaceId.NEW_TAB_ES_ES, "pocket-newtab-es-es"), - (ScheduledSurfaceId.NEW_TAB_FR_FR, "pocket-newtab-fr-fr"), - (ScheduledSurfaceId.NEW_TAB_IT_IT, "pocket-newtab-it-it"), + (ScheduledSurfaceId.NEW_TAB_EN_US, "firefox-newtab-en-us"), + (ScheduledSurfaceId.NEW_TAB_EN_GB, "firefox-newtab-en-gb"), + (ScheduledSurfaceId.NEW_TAB_EN_INTL, "firefox-newtab-en-intl"), + (ScheduledSurfaceId.NEW_TAB_DE_DE, "firefox-newtab-de-de"), + (ScheduledSurfaceId.NEW_TAB_ES_ES, "firefox-newtab-es-es"), + (ScheduledSurfaceId.NEW_TAB_FR_FR, "firefox-newtab-fr-fr"), + (ScheduledSurfaceId.NEW_TAB_IT_IT, "firefox-newtab-it-it"), ], ) def test_get_utm_source(scheduled_surface_id, expected_utm_source): @@ -160,26 +160,26 @@ def test_get_utm_source(scheduled_surface_id, expected_utm_source): # add new utm_source ( "https://getpocket.com/explore/item/example-article", - "pocket-newtab-en-us", - "https://getpocket.com/explore/item/example-article?utm_source=pocket-newtab-en-us", + "firefox-newtab-en-us", + "https://getpocket.com/explore/item/example-article?utm_source=firefox-newtab-en-us", ), # add new utm_source with another query param present in url ( "https://getpocket.com/explore/item/example-article?foo=bar", - "pocket-newtab-en-gb", - "https://getpocket.com/explore/item/example-article?foo=bar&utm_source=pocket-newtab-en-gb", + "firefox-newtab-en-gb", + "https://getpocket.com/explore/item/example-article?foo=bar&utm_source=firefox-newtab-en-gb", ), # replace old utm_source with new one ( "https://getpocket.com/explore/item/example-article?utm_source=old_source", - "pocket-newtab-en-intl", - "https://getpocket.com/explore/item/example-article?utm_source=pocket-newtab-en-intl", + "firefox-newtab-en-intl", + "https://getpocket.com/explore/item/example-article?utm_source=firefox-newtab-en-intl", ), # replace old utm_source with new one & when another query param present in url ( "https://getpocket.com/explore/item/example-article?utm_source=old_source&foo=bar", - "pocket-newtab-de-de", - "https://getpocket.com/explore/item/example-article?utm_source=pocket-newtab-de-de&foo=bar", + "firefox-newtab-de-de", + "https://getpocket.com/explore/item/example-article?utm_source=firefox-newtab-de-de&foo=bar", ), # pass empty utm_source (when no mapping is found) (