Skip to content

[DISCO-3979] Add client variant logic to AMP thompson sampling#1338

Merged
ncloudioj merged 4 commits intomainfrom
client-variant-check
Mar 25, 2026
Merged

[DISCO-3979] Add client variant logic to AMP thompson sampling#1338
ncloudioj merged 4 commits intomainfrom
client-variant-check

Conversation

@tiftran
Copy link
Copy Markdown
Contributor

@tiftran tiftran commented Mar 20, 2026

References

JIRA: DISCO-3979

Description

PR Review Checklist

Put an x in the boxes that apply

  • This PR conforms to the Contribution Guidelines
  • The PR title starts with the JIRA issue reference, format example [DISCO-####], and has the same title (if applicable)
  • [load test: (abort|skip|warn)] keywords are applied to the last commit message (if applicable)
  • Documentation has been updated (if applicable)
  • Functional and performance test coverage has been expanded and maintained (if applicable)

┆Issue is synchronized with this Jira Task


# MERINO_WEB__API__V1__CLIENT_VARIANT_ALLOW_LIST
# list of client variants the merino will be aware about
client_variant_allow_list = ["engagement_guided_suggestions"]
Copy link
Copy Markdown
Contributor Author

@tiftran tiftran Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking since there's going to only be one right now, this would be okay.
I'm not sure if we would ever have provider specific client_variants, and if so we might want to adjust the structure of this to maybe a dict

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's OK for now, we can always store it in another form in Merino if needed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense.

@tiftran tiftran requested a review from a team March 20, 2026 19:47
Copy link
Copy Markdown
Contributor

@Herraj Herraj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!


# MERINO_WEB__API__V1__CLIENT_VARIANT_ALLOW_LIST
# list of client variants the merino will be aware about
client_variant_allow_list = ["engagement_guided_suggestions"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense.

user_agent=user_agent,
source=source,
is_soft_pii=is_soft_pii,
client_variants=client_variants_list,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this keeps getting bigger and bigger! 😅 Curious if a middleware implementation would work for this and if it would make at any better 🤔

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, not sure if middleware would be helpful in this case. But we could group the related properties into nested sub-models :)

@ncloudioj ncloudioj force-pushed the client-variant-check branch from a279d69 to 78eb229 Compare March 25, 2026 14:24
Copy link
Copy Markdown
Contributor

@misaniwere misaniwere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add tests to verify when should_check_client_variants is True and we have a variant in the allow list?

@ncloudioj ncloudioj requested a review from misaniwere March 25, 2026 16:01
@ncloudioj ncloudioj added this pull request to the merge queue Mar 25, 2026
Merged via the queue into main with commit b19675f Mar 25, 2026
7 checks passed
@ncloudioj ncloudioj deleted the client-variant-check branch March 25, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants