{"action":"created","issue":{"url":"https://api.github.com/repos/brave/brave-core/issues/428","repository_url":"https://api.github.com/repos/brave/brave-core","labels_url":"https://api.github.com/repos/brave/brave-core/issues/428/labels{/name}","comments_url":"https://api.github.com/repos/brave/brave-core/issues/428/comments","events_url":"https://api.github.com/repos/brave/brave-core/issues/428/events","html_url":"https://github.com/brave/brave-core/pull/428","id":358656908,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE0MzM5OTI5","number":428,"title":"Add support for referral promos","user":{"login":"emerick","id":5033691,"node_id":"MDQ6VXNlcjUwMzM2OTE=","avatar_url":"https://avatars1.githubusercontent.com/u/5033691?v=4","gravatar_id":"","url":"https://api.github.com/users/emerick","html_url":"https://github.com/emerick","followers_url":"https://api.github.com/users/emerick/followers","following_url":"https://api.github.com/users/emerick/following{/other_user}","gists_url":"https://api.github.com/users/emerick/gists{/gist_id}","starred_url":"https://api.github.com/users/emerick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emerick/subscriptions","organizations_url":"https://api.github.com/users/emerick/orgs","repos_url":"https://api.github.com/users/emerick/repos","events_url":"https://api.github.com/users/emerick/events{/privacy}","received_events_url":"https://api.github.com/users/emerick/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"emerick","id":5033691,"node_id":"MDQ6VXNlcjUwMzM2OTE=","avatar_url":"https://avatars1.githubusercontent.com/u/5033691?v=4","gravatar_id":"","url":"https://api.github.com/users/emerick","html_url":"https://github.com/emerick","followers_url":"https://api.github.com/users/emerick/followers","following_url":"https://api.github.com/users/emerick/following{/other_user}","gists_url":"https://api.github.com/users/emerick/gists{/gist_id}","starred_url":"https://api.github.com/users/emerick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emerick/subscriptions","organizations_url":"https://api.github.com/users/emerick/orgs","repos_url":"https://api.github.com/users/emerick/repos","events_url":"https://api.github.com/users/emerick/events{/privacy}","received_events_url":"https://api.github.com/users/emerick/received_events","type":"User","site_admin":false},"assignees":[{"login":"emerick","id":5033691,"node_id":"MDQ6VXNlcjUwMzM2OTE=","avatar_url":"https://avatars1.githubusercontent.com/u/5033691?v=4","gravatar_id":"","url":"https://api.github.com/users/emerick","html_url":"https://github.com/emerick","followers_url":"https://api.github.com/users/emerick/followers","following_url":"https://api.github.com/users/emerick/following{/other_user}","gists_url":"https://api.github.com/users/emerick/gists{/gist_id}","starred_url":"https://api.github.com/users/emerick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emerick/subscriptions","organizations_url":"https://api.github.com/users/emerick/orgs","repos_url":"https://api.github.com/users/emerick/repos","events_url":"https://api.github.com/users/emerick/events{/privacy}","received_events_url":"https://api.github.com/users/emerick/received_events","type":"User","site_admin":false}],"milestone":null,"comments":13,"created_at":"2018-09-10T14:45:50Z","updated_at":"2018-09-24T17:50:44Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/brave/brave-core/pulls/428","html_url":"https://github.com/brave/brave-core/pull/428","diff_url":"https://github.com/brave/brave-core/pull/428.diff","patch_url":"https://github.com/brave/brave-core/pull/428.patch"},"body":"Fixes brave/brave-browser#287\r\n\r\nAlso relies on https://github.com/brave/brave-browser/pull/1244\r\n\r\n## Submitter Checklist:\r\n\r\n- [x] Submitted a [ticket](https://github.com/brave/brave-browser/issues) for my issue if one did not already exist.\r\n- [x] Used Github [auto-closing keywords](https://help.github.com/articles/closing-issues-via-commit-messages/) in the commit message.\r\n- [x] Added/updated tests for this change (for new code or code which already has tests).\r\n- [x] Ran `git rebase -i` to squash commits (if needed).\r\n- [x] Tagged reviewers and labelled the pull request as needed.\r\n- [x] Request a security/privacy review as needed.\r\n- [ ] Add appropriate QA labels (QA/Needed or QA/No-QA-Needed) to include the closed issue in milestone \r\n\r\n## Automated Test Plan\r\n`npm run test -- brave_unit_tests --filter=BraveReferralsNetworkDelegateHelperTest.*`\r\n\r\n## Test Plan:\r\n\r\n- Install a version of Brave with an associated referral code in its filename (on Mac, this requires running the .pkg installer not the .dmg)\r\n  - Verify that after installation but before running Brave for the first time, `promoCode` file is in `user-data-directory` and contains the appropriate code.\r\n- Run installed Brave\r\n  - Verify that promo-appropriate URL (if any) opens in a new browser tab.\r\n  - Verify that when visiting a referral domain, we send the promo-appropriate request headers.\r\n  - Verify that we no longer send referral code to update server after 90 days.\r\n  - Verify that `promoCode` file is deleted after promo code is read and stored in `local_state` preferences.\r\n  - Verify that service checks for referral finalization 30 days after referral initialization.\r\n  - Verify that service retries checking for referral finalization up to 30 times (with 24-hour pauses between attempts) if it doesn't receive \"true\" on its first try.\r\n\r\n## Reviewer Checklist:\r\n\r\n- [ ] New files have MPL-2.0 license header.\r\n- [x] Request a security/privacy review as needed.\r\n- [x] Adequate test coverage exists to prevent regressions \r\n- [ ] Verify test plan is specified in PR before merging to source"},"comment":{"url":"https://api.github.com/repos/brave/brave-core/issues/comments/424064818","html_url":"https://github.com/brave/brave-core/pull/428#issuecomment-424064818","issue_url":"https://api.github.com/repos/brave/brave-core/issues/428","id":424064818,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNDA2NDgxOA==","user":{"login":"bsclifton","id":4733304,"node_id":"MDQ6VXNlcjQ3MzMzMDQ=","avatar_url":"https://avatars3.githubusercontent.com/u/4733304?v=4","gravatar_id":"","url":"https://api.github.com/users/bsclifton","html_url":"https://github.com/bsclifton","followers_url":"https://api.github.com/users/bsclifton/followers","following_url":"https://api.github.com/users/bsclifton/following{/other_user}","gists_url":"https://api.github.com/users/bsclifton/gists{/gist_id}","starred_url":"https://api.github.com/users/bsclifton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsclifton/subscriptions","organizations_url":"https://api.github.com/users/bsclifton/orgs","repos_url":"https://api.github.com/users/bsclifton/repos","events_url":"https://api.github.com/users/bsclifton/events{/privacy}","received_events_url":"https://api.github.com/users/bsclifton/received_events","type":"User","site_admin":false},"created_at":"2018-09-24T17:50:44Z","updated_at":"2018-09-24T17:50:44Z","author_association":"MEMBER","body":"OK great - so what I was missing above was the API key (which gets embedded via https://github.com/brave/brave-browser/pull/1244, which I also pulled in). I manually set this via environment variable and ensured:\r\n- page was presented 👍 \r\n- promoCode was deleted + put into `local_state` file\r\n- For requests to the partner page, `User-Agent` wasn't modified (was set to default of `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.16 Safari/537.36`, but I did see the `x-brave-partner` header"}}
{"actor":{"display_login":"bsclifton"}}