Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ad categories should be calculated based upon segment name and top level of segment name #2111

Merged
merged 1 commit into from
Apr 1, 2019

Conversation

tmancey
Copy link
Collaborator

@tmancey tmancey commented Mar 28, 2019

fixes brave/brave-browser#3922

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Verified that these changes build without errors on
    • Windows
    • macOS
    • Linux
  • Verified that these changes pass automated tests (npm test brave_unit_tests && npm test brave_browser_tests && npm run test-security) on
    • Windows
    • macOS
    • Linux
  • Verified that all lint errors/warnings are resolved (npm run lint)
  • Ran git rebase master (if needed).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.
  • Request a security/privacy review as needed.
  • Add appropriate QA labels (QA/Yes or QA/No) to include the closed issue in milestone

Test Plan:

Confirm segments in the catalog, i.e.

"segments": [
  {
    "code": "b6O0KdkEyr",
    "name": "Sports"
  },
  {
    "code": "q5qPgp5KncWi",
    "name": "Technology & Computing-Unix",
  }

are created as follows in the database located at Defaults/ads_service/bundle_state under the table name ad_info_category contains:

sports
technology & sports
technology & sports-unix

Test Case:

Site visited https://www.popularmechanics.com/adventure/sports/a20066488/how-to-start-sailing/,
immediateWinner is sports-sailing and winnerOverTime is sports-sailing
  • Once the website has been classified as sports-sailing, check Default/ads_service/catalog.json and you should see the following:
"segments": [
  {
    "code": "OfetQo4wKhT1",
    "name": "Sports-sailing",
    "parentCode": "b6O0KdkEyr"
  }
],
  • open bundle_state and ensure that sports-sailing is appearing under both the category and ad_info_category tables, examples:

Screen Shot 2019-04-17 at 8 31 56 PM

Screen Shot 2019-04-17 at 9 30 22 PM

[19679:775:0417/202911.463110:INFO:confirmations_impl.cc(846)] ConfirmAd:
[19679:775:0417/202911.463142:INFO:confirmations_impl.cc(847)]   creative_set_id: cbc176a5-0269-4afd-a246-67f4ab2c802d
[19679:775:0417/202911.463167:INFO:confirmations_impl.cc(848)]   category: sports-sailing
[19679:775:0417/202911.463191:INFO:confirmations_impl.cc(849)]   url: https://www.vacationstogo.com/cruise_lines.cfm
[19679:775:0417/202911.463211:INFO:confirmations_impl.cc(850)]   text: Vacations to go!
[19679:775:0417/202911.463225:INFO:confirmations_impl.cc(851)]   advertiser: Cruises
[19679:775:0417/202911.463239:INFO:confirmations_impl.cc(852)]   uuid: aec1123d-f97e-46a9-bd7f-6741fe670547
[19679:775:0417/202911.463257:INFO:confirmations_impl.cc(853)]   type: dismiss
  • ensure that the uuid of the ad that you received matches the sports-sailing ad_info_uuid that's under the ad_info_category table via bundle_state
  • visit several boxing sports websites so you eventually get something similar to the following:
[19700:775:0417/205141.529707:INFO:ads_impl.cc(418)] Site visited https://www.boxingnews24.com/, immediateWinner is sports-boxing and winnerOverTime is sports-boxing
  • trigger an ad and ensure that the ad uuid that you receive matches sports as we don't have any specific ads for sports-boxing

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

emerick
emerick previously approved these changes Mar 28, 2019
Copy link
Contributor

@emerick emerick left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@emerick emerick left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ad categories should be calculated based upon segment name and top level of segment name
2 participants