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

Rewards Greaselion - Github #6789

Merged
merged 1 commit into from
Oct 13, 2020
Merged

Rewards Greaselion - Github #6789

merged 1 commit into from
Oct 13, 2020

Conversation

emerick
Copy link
Contributor

@emerick emerick commented Oct 6, 2020

Resolves brave/brave-browser#11463
Resolves brave/brave-browser#11766
Resolves brave/brave-browser#10434

Associated Greaselion script PR: brave/brave-site-specific-scripts#20

Submitter Checklist:

Test Plan:

Note: In order to test this PR, you must manually install the Github Greaselion script at the moment. This involves pulling down the appropriate branch and running the following commands (the example is Windows specific, it will need to be modified slightly for Mac/Linux):

npm run build
cp -R dist/Greaselion.json /c/Users/$USERNAME/AppData/Local/BraveSoftware/Brave-Browser/User\ Data/afalakplffnnnlkncjhbmahjfjhmlkal/1.0.29/1/
cp -R dist/scripts /c/Users/$USERNAME/AppData/Local/BraveSoftware/Brave-Browser/User\ Data/afalakplffnnnlkncjhbmahjfjhmlkal/1.0.29/1/

Desktop

Pull Request

  • Clean profile
  • Run browser
  • Install Github Greaselion script as explained above
  • Restart browser
  • Visit a Github pull request URL (e.g., https://github.com/brave/brave-core/pull/6743)
  • Verify that correct publisher information appears in Rewards panel
  • Verify that tipping works as expected
  • Verify that verified checkmark appears in Rewards icon for verified publishers
  • Verify that tip icon is inserted in expected locations

Issue

  • Clean profile
  • Run browser
  • Install Github Greaselion script as explained above
  • Restart browser
  • Visit a Github issue URL (e.g., https://github.com/brave/brave-browser/issues/12013)
  • Verify that correct publisher information appears in Rewards panel
  • Verify that tipping works as expected
  • Verify that verified checkmark appears in Rewards icon for verified publishers
  • Verify that tip icon is inserted in expected locations

Commits

  • Clean profile
  • Run browser
  • Install Github Greaselion script as explained above
  • Restart browser
  • Visit a Github commits page URL (e.g., https://github.com/brave/brave-browser/commits/master)
  • Verify that correct publisher information appears in Rewards panel
  • Verify that tipping works as expected
  • Verify that verified checkmark appears in Rewards icon for verified publishers
  • Verify that tip icon is inserted in expected locations

Starred Repos

  • Clean profile
  • Run browser
  • Install Github Greaselion script as explained above
  • Restart browser
  • Visit a Github starred repos URL (e.g., https://github.com/emerick?tab=stars)
  • Verify that correct publisher information appears in Rewards panel
  • Verify that tipping works as expected
  • Verify that verified checkmark appears in Rewards icon for verified publishers
  • Verify that tip icon is inserted in expected locations

Organization Members

  • Clean profile
  • Run browser
  • Install Github Greaselion script as explained above
  • Restart browser
  • Visit a Github organization members URL (e.g., https://github.com/orgs/brave/people)
  • Verify that correct publisher information appears in Rewards panel
  • Verify that tipping works as expected
  • Verify that verified checkmark appears in Rewards icon for verified publishers
  • Verify that tip icon is inserted in expected locations

Team Members

  • Clean profile
  • Run browser
  • Install Github Greaselion script as explained above
  • Restart browser
  • Visit a Github team members URL (e.g., https://github.com/orgs/brave/teams/brave-core/members)
  • Verify that correct publisher information appears in Rewards panel
  • Verify that tipping works as expected
  • Verify that verified checkmark appears in Rewards icon for verified publishers
  • Verify that tip icon is inserted in expected locations

Gist

  • Clean profile
  • Run browser
  • Install Github Greaselion script as explained above
  • Restart browser
  • Visit a Github Gist URL (e.g., https://gist.github.com/darkdh/85fed2542190510aaee0f3ad91091818)
  • Verify that correct publisher information appears in Rewards panel
  • Verify that tipping works as expected
  • Verify that verified checkmark appears in Rewards icon for verified publishers
  • Verify that tip icon is inserted in expected locations

Excluded URL

  • Clean profile
  • Run browser
  • Install Github Greaselion script as explained above
  • Restart browser
  • Visit an excluded Github URL (e.g., https://github.com/about)
  • Verify that correct publisher information appears in Rewards panel (github.com)
  • Verify that tipping works as expected

Activity

  • Clean profile
  • Run browser
  • Install Github Greaselion script as explained above
  • Restart browser
  • Visit a Github URL (e.g., https://github.com/emerick)
  • Verify that activity_info database table is updated as expected
  • Verify that auto-contribute table is updated to reflect new activity

History

  • Navigate to various Github URLs in the same tab
  • Verify that appropriate publisher information appears in the panel
  • Verify that back/forward navigation updates the panel with correct publisher info

Tab Activation

  • Navigate to various Github URLs in multiple tabs
  • Verify that appropriate publisher information appears in the panel
  • Verify that switching between tabs updates the panel with correct publisher info

Tipping non-Github Publishers

  • Verify that tipping works as expected on non-Github publishers (we only made changes to Github and only on desktop)
  • Verify that the panel looks as expected on non-Github publishers

Mobile

No changes were made to mobile platforms, so verify that Github navigation / tipping / Rewards panel continue to work as expected on those platforms.

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

After-merge Checklist:

  • The associated issue milestone is set to the smallest version that the
    changes has landed on.
  • All relevant documentation has been updated.

@@ -134,7 +134,7 @@ class Banner extends React.Component<Props, State> {
} else if (mediaMetaData.mediaType === 'reddit') {
return `u/${mediaMetaData.userName}`
} else if (mediaMetaData.mediaType === 'github') {
return `@${mediaMetaData.userName}`
return `@${mediaMetaData.publisherScreenName}`
Copy link
Contributor

Choose a reason for hiding this comment

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

I see that in tipMediaUser.tsx we use '@' + mediaMetaData.publisherName, where here we use mediaMetaData.publisherScreenName. I would suggest that we do the same in both places and this way you don't need to introduce new parameter

Copy link
Contributor Author

@emerick emerick Oct 7, 2020

Choose a reason for hiding this comment

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

I think that's just a bug in tipMediaUser.tsx (which is leading to issue #4 that you noticed below). The issue is that the Github tip dialog wants to show both the screen name (e.g. emerick) and the publisher name (e.g., Emerick Rogul). For some reason, the Twitter integration only ever showed one name so we were good.

Copy link
Contributor

@NejcZdovc NejcZdovc left a comment

Choose a reason for hiding this comment

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

  1. black bubble (probably translation is not working)
    image

  2. verified publisher don't get image https://github.com/jumde
    image

  3. regular site should have github.com https://github.com/team
    image

  4. @ should be the same. Now one is @yrliou another is @Jocelyn Liu

image

@emerick emerick force-pushed the rewards-greaselion-github branch 2 times, most recently from 3743116 to 08d1799 Compare October 7, 2020 13:38
@emerick
Copy link
Contributor Author

emerick commented Oct 7, 2020

@NejcZdovc Regarding missing localizations, it seems that there's some unreliability with retrieving localizations from a content script via chrome.i18n.getMessage. See https://bugs.chromium.org/p/chromium/issues/detail?id=83549 for some details. Restarting the browser fixes it for me. I was thinking that I could remove the call to chrome.i18n.getMessage from the content script and just send a request to the background page for the given string. We only have two strings, so I think the cost would be negligible. WDYT?

Scratch that, it would require putting localizations in brave-core. We'll just guard against empty translations in our content script.

@emerick emerick requested a review from NejcZdovc October 7, 2020 18:39
@emerick
Copy link
Contributor Author

emerick commented Oct 7, 2020

All feedback should be addressed.

@emerick emerick force-pushed the rewards-greaselion-github branch from 08d1799 to 9de3d28 Compare October 13, 2020 17:04
@emerick emerick merged commit 3e955e1 into master Oct 13, 2020
@emerick emerick deleted the rewards-greaselion-github branch October 13, 2020 20:09
@emerick emerick added this to the 1.17.x - Nightly milestone Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants