Page MenuHomePhabricator

Include nominated collection suggestions for country filter
Open, In Progress, HighPublic4 Estimated Story Points

Description

When there is a nominated collection for the target language and the current filter is a country, try to include up to 50% of suggestions from the nominated collection that match the country and the rest from the articlecountry search.

When there is no nominated collection, nothing different from the current state.

Recommended approach is the use the search API combining articlecountry with pageid with the ID of the pages in the collection in the source wiki.


Derived Requirements

  1. When a nominated collection exists for the target language and the active filter is country, the system must include suggestions from the nominated collection in the recommendation results.
  2. When a nominated collection exists and a country filter is applied, up to 50% of the returned suggestions must come from the nominated collection that matches the selected country.
  3. The remaining suggestions must be sourced from the existing articlecountry search results.
  4. Suggestions from the nominated collection must be filtered to include only pages that match the selected country.
  5. When no nominated collection exists for the target language, recommendation behavior must remain unchanged.
  6. The recommendation API must support combining articlecountry search results with pageid constraints from the nominated collection.
  7. The combined result set must not contain duplicate pages and must preserve the expected total number of suggestions.
  8. Result ordering must follow existing relevance rules unless explicitly overridden.
Test Steps

Test Case 1: Country Filter with Existing Nominated Collection

Preconditions

  • A nominated collection exists for the target language.
  • The nominated collection contains pages associated with the selected country.
  1. Navigate to the recommendation interface.
  2. Apply a country filter that matches pages in the nominated collection.
  3. Trigger the recommendation request.
  4. Review the returned suggestion list.
  5. ✅❓❌⬜ AC1: Verify that the results include a mix of suggestions where up to 50% are sourced from the nominated collection matching the selected country and the remaining suggestions are sourced from the articlecountry search, with no duplicate entries.

Test Case 2: Country Filter with No Nominated Collection

Preconditions

  • No nominated collection exists for the target language.
  1. Navigate to the recommendation interface.
  2. Apply a country filter.
  3. Trigger the recommendation request.
  4. Review the returned suggestion list.
  5. ✅❓❌⬜ AC2: Verify that recommendations behave exactly as in the current implementation, with all suggestions sourced solely from the articlecountry search and no nominated collection influence.

Test Case 3: API Combination Logic Validation

Preconditions

  • A nominated collection exists with known page IDs.
  • Network inspection or API logging is available.
  1. Apply a country filter and trigger the recommendation request.
  2. Inspect the outgoing API request.
  3. Inspect the API response payload.
  4. ✅❓❌⬜ AC3: Verify that the API request combines articlecountry search parameters with pageid constraints from the nominated collection and that the response includes only pages from the collection that match the selected country.

QA Results - TestWiki

ACStatusDetails
1T409337#11501809
2T409337#11501809
3T409337#11501809

Event Timeline

Nikerabbit moved this task from Needs Triage to Dashboard on the ContentTranslation board.
SBisson raised the priority of this task from Medium to High.Nov 13 2025, 1:34 PM
SBisson updated the task description. (Show Details)
SBisson moved this task from Incoming to Prioritized on the LPL Hypothesis board.
ngkountas set the point value for this task to 4.Nov 19 2025, 1:16 PM
ngkountas changed the task status from Open to In Progress.Dec 8 2025, 10:44 AM
ngkountas claimed this task.
ngkountas moved this task from Prioritized to In-progress on the LPL Hypothesis board.

Change #1216563 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] CX: Include featured suggestions in recommendations for country filter

https://gerrit.wikimedia.org/r/1216563

Change #1216563 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX: Include featured suggestions in recommendations for country filter

https://gerrit.wikimedia.org/r/1216563

Change #1216835 had a related patch set uploaded (by Sbisson; author: Sbisson):

[mediawiki/extensions/ContentTranslation@master] CX3 Build 1.0.0+2025120

https://gerrit.wikimedia.org/r/1216835

Change #1217181 had a related patch set uploaded (by Sbisson; author: Sbisson):

[mediawiki/extensions/ContentTranslation@wmf/1.46.0-wmf.5] CX3 Build 1.0.0+20251209

https://gerrit.wikimedia.org/r/1217181

Change #1216835 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX3 Build 1.0.0+20251209

https://gerrit.wikimedia.org/r/1216835

Change #1217181 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@wmf/1.46.0-wmf.5] CX3 Build 1.0.0+20251209

https://gerrit.wikimedia.org/r/1217181

Mentioned in SAL (#wikimedia-operations) [2025-12-10T14:04:56Z] <sbisson@deploy2002> Started scap sync-world: Backport for [[gerrit:1217181|CX3 Build 1.0.0+20251209 (T384485 T408845 T409332 T409337 T409338 T411779)]]

Mentioned in SAL (#wikimedia-operations) [2025-12-10T14:07:02Z] <sbisson@deploy2002> sbisson: Backport for [[gerrit:1217181|CX3 Build 1.0.0+20251209 (T384485 T408845 T409332 T409337 T409338 T411779)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-12-10T14:13:57Z] <sbisson@deploy2002> Finished scap sync-world: Backport for [[gerrit:1217181|CX3 Build 1.0.0+20251209 (T384485 T408845 T409332 T409337 T409338 T411779)]] (duration: 09m 01s)

@ngkountas Please review my questions for each of the AC's below, thanks!

**//UPDATE://** Pass per T409337#11503997

Test Result - Test Wiki

Status: ✅ PASS
Environment: Test Wiki
OS: macOS Tahoe 26.1
Browser: Chrome 143
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Country Filter with Existing Nominated Collection

Preconditions

  • A nominated collection exists for the target language.
  • The nominated collection contains pages associated with the selected country.
  1. Navigate to the recommendation interface.
  2. Apply a country filter that matches pages in the nominated collection.
  3. Trigger the recommendation request.
  4. Review the returned suggestion list.
  5. AC1: Verify that the results include a mix of suggestions where up to 50% are sourced from the nominated collection matching the selected country and the remaining suggestions are sourced from the articlecountry search, with no duplicate entries.

I did one for "US". Is this what you were talking about with a selected country? Is there a better collection with a country that I can also check out or is this fine?

2026-01-07_12-54-24.png (1×1 px, 176 KB)

Test Case 2: Country Filter with No Nominated Collection

Preconditions

  • No nominated collection exists for the target language.
  1. Navigate to the recommendation interface.
  2. Apply a country filter.
  3. Trigger the recommendation request.
  4. Review the returned suggestion list.
  5. AC2: Verify that recommendations behave exactly as in the current implementation, with all suggestions sourced solely from the articlecountry search and no nominated collection influence.

You are just talking about if it's no nomination while selecting a country. The nominated chip should be gone, as seen that "Software" is non-existent

UPDATE: Does not show

Recommendation InterfaceAPI
2026-01-07_12-55-54.png (1×1 px, 172 KB)
2026-01-08_11-48-46.png (676×825 px, 81 KB)

Test Case 3: API Combination Logic Validation

Preconditions

  • A nominated collection exists with known page IDs.
  • Network inspection or API logging is available.
  1. Apply a country filter and trigger the recommendation request.
  2. Inspect the outgoing API request.
  3. Inspect the API response payload.
  4. AC3: Verify that the API request combines articlecountry search parameters with pageid constraints from the nominated collection and that the response includes only pages from the collection that match the selected country.

Where can I find this API request with that information since this is all I can see?

UPDATE: Null per T409337#11503997

2026-01-07_13-08-44.png (1×2 px, 539 KB)

@GMikesell-WMF thank you for the review!

Regarding AC1, I believe that testing the "US" country filter when "Software" collection is selected as featured collection is enough. It can happen that no page suggestion satisfying both to the country filter and the collection filter, is found.

Regarding AC2, I'm not sure I understood the question correctly. Judging from the screenshot, it seems that the suggestions are fine, but I cannot understand how you removed the "Software" featured collection for the "english" language. Finally, I also tested that the request to the Recommendation API (example) includes the featured_collection URL param when a featured collection exists, and does NOT include it when featured collection is missing, which is the expected behaviour.

Regarding AC3, I don't think it's possible to test that the required API parameters are used, because this is something happening under the hood, inside Recommendation API. I think we can just skip this test.

GMikesell-WMF updated the task description. (Show Details)
GMikesell-WMF moved this task from Needs QA to Design Signoff on the LPL Hypothesis board.