Skip to content
This repository was archived by the owner on Jan 29, 2026. It is now read-only.

feat(recommendations): [MC-125] Add id to recommendations#63

Merged
mmiermans merged 2 commits intomainfrom
mc-125-recommendation-id
Sep 28, 2023
Merged

feat(recommendations): [MC-125] Add id to recommendations#63
mmiermans merged 2 commits intomainfrom
mc-125-recommendation-id

Conversation

@mmiermans
Copy link
Copy Markdown
Contributor

@mmiermans mmiermans commented Sep 22, 2023

Goal

Return the CorpusRecommendation.id for recommendations, which is unique for each request.

Once Glean pings include this property, it will allow us to better track recommendations through our content pipeline, because we'll be able to join between impressions, clicks, and recommendation responses. We only emit recommendation id through Glean, and stop emitting Activity Stream. This will bring Firefox in line with our other clients in how we identify recommendations. We will have to coordinate with the Analytics team to ensure our data modeling is updated before Firefox 120 is released on November 21.

I'd love feedback/perspectives on:

  • Should this property be called id or recommendationId? The former seemed more consistent with other properties, but I'm open to either.

Implementation Decisions

  • Copied .husky pre-commit hook from content-feed-service to include codegen.

References

JIRA ticket:

BugZilla ticket:

Slack channel:

Documentation:

@mmiermans mmiermans requested review from a team as code owners September 22, 2023 15:29
@mmiermans mmiermans requested a review from n0coast September 22, 2023 15:29
*/
listTopics: Array<Topic>;
/** ----- In Development (2023-08-16) -----Get a slate of ranked recommendations for the MozSocial. */
mozSocialSlate: CorpusSlate;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is unrelated to this change, and no longer needed. I will create a PR in recommendation-api to remove it.

Comment thread openapi.yml
- Recommendation
id:
type: string
description: String identifier for the Recommendation. This value is expected to be different on each request.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@ScottDowne I mainly wanted to get your eyes on the openapi.yml changes. Adding a property is non-breaking, right? Is the naming of id good, or would you prefer recommendationId?

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.

So nothing is wrong with it from a breaking standpoint.

However the name id vs recommendationId is hard to comment on without some help understanding it.

Is it the idea that we migrate the client from using tileId to this new id? If so, I think id is right.

Right now we convert tileId to id in the client anyway because of backwards comp reasons while the client was supporting both apis. Having it go back to just id is nice and clean.

If it's a new id, is different from tileId, then it would be weird having 2 different ids, both being called at one point id. If that makes sense.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks, that context is helpful.

In the BugZilla meta ticket I proposed adding both this id and tileId to Glean, but based on what you said, it sounds better only to emit id to Glean. I believe that would work for us. I'll update the BugZilla ticket accordingly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@ScottDowne will check that id will is not used by any supported version of Firefox Desktop. I'll add a tag to hold deployment until that's done.

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.

The browser does not use id for any versions that use this API. You can see it here: https://searchfox.org/mozilla-central/source/browser/components/newtab/lib/DiscoveryStreamFeed.jsm#1465-1473

Older versions use the fallback legacy api we setup, which I imagine is the same, so we should be fine here.

@mmiermans mmiermans removed the request for review from n0coast September 22, 2023 15:36
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.

🚀

@mmiermans mmiermans merged commit 0afcf8e into main Sep 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants