Giter Club home page Giter Club logo

myqonly's Introduction

MyQOnly

Install from AMO here.

Suggestions for a better name welcome!

This WebExtension attempts to provide a reasonably accurate count of how many reviews a Mozillian might have in their queue. It knows how to talk to Phabricator, Bugzilla and GitHub. It displays a badge in the toolbar showing how many reviews are in the queue, and the popup takes you to the dashboards for those two review tools.

Usage

Phabricator

MyQOnly will use any pre-existing browser session to get at your Phabricator data, so just login to Phabricator, and stay logged in.

Bugzilla

You'll need to generate an API key. Visit the API keys section of Bugzilla Preferences to generate a new key.

Once you have that API key, go to about:addons and visit the Preferences for MyQOnly. Paste in the API key, and set the update interval to your liking.

GitHub

You need to enter your GitHub username into the about:addons preferences in MyQOnly.

YMMV

This is still very much a WIP, so it might not work perfectly. Please file bugs!

myqonly's People

Contributors

ahal avatar callek avatar dblohm7 avatar dependabot[bot] avatar jaredhirsch avatar mikeconley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

myqonly's Issues

If a Phabricator review request is still pending, but another reviewer has Approved, the review isn't included in the total

There's a limitation in the Differential revision query API where review requests are not listed in the following scenario:

  1. The user is one of several reviewers on a revision
  2. The user is a non-blocking reviewer
  3. Another user has given an approval such that the revision gets the Approved status

This is something that mcote's team has been banging against too.

It might be simpler to get an accurate total of Phabricator reviews by just scraping the dashboard.

Could we add more request types for Bugzilla?

Could there be some way to add, say, data-review requests to the total in the way needinfo is handled? Maybe an advanced option for listing the types of BMO requests we're interested in via comma-separated list?

I can imagine that others might want feedback added, so this isn't 100% a selfish request, right? : D

Alternative impl: Include all request types returned by the API query and blacklist ones you don't want in the badge count?

Make it possible to assign contextualIdentity's to the review tools doing page scraping

As a paranoia/defense-in-depth measure, I have my Bugzilla and Phabricator accounts logged in only in an account container. Since Phabricator support moved to scraping a logged in page, it isn't working for me, I suspect due to it only being able to access an uncontained Phabricator login (as it works when I log in outside of a container).

Just a note for the backlog...

Ability to snooze requests for the rest of the day

myqonly has a nice feature where you can configure which days of
the week and between what hours you would like your requests to
appear. I think a good extension to this would be to add a “snooze”
feature, which hides the requests for the remainder of the day.

What are your thoughts? Would this be a welcome feature?

Add manual refresh ability

It would be nice if I could set a longer timeout but still have a link for manual refresh... e.g. I set a 1 min refresh right now, but in reality a 10 or 20 minute refresh is all I need, but an occasional "I'm between tasks, let me see if I have any new ones" button would be useful.

Add diagnostic goop

Something happened to @snorp in #14, and it's hard for me to know what it was.

It'd be nice if there was a debugging mode to MyQOnly that'd let me get a sense of what was going wrong. It'd also be nice to be able to kick off the fetches / updates without waiting for the timer every time.

We already have console.log'ing, but I think I want something a little more comprehensive.

support for multi-account containers

I have my phabricator account logged into a container; I'm guessing that's why my review counts aren't showing up for myqonly.

If there's some way to add a token pref like we do for bugzilla, that would probably also resolve this.

Phabricator login cookie can't be detected anymore

Today I noticed that MyQOnly is complaining on both of my machines that my default container isn't logged into Phabricator (when they both clearly are).

Digging into it a little more, I'm seeing this error in the console:

Request to access cookie or storage on “https://phabricator.services.mozilla.com/differential/query/active/” was blocked because we are blocking all third-party storage access requests and content blocking is enabled.

And then links to this Learn More page, which is unfortunately pretty sparse.

If ctrl-clicked, MyQOnly's review links are opened in Container of currently-focused tab

STR:

  1. Open a Container Tab (by e.g. long-pressing the "+" icon on your tabs toolbar, if you're using Nightly, and picking "Banking")
  2. Be sure that container tab is your currently active tab.
  3. Click the MyQOnly icon on your toolbar.
  4. Ctrl-click (Cmd-click on Mac) one of the links for your pending reviews, assuming you've got some.
    (Or middle-mousebutton-click, which has the same semantics on Linux at least.)

ACTUAL RESULTS:
The review page opens in a new tab in the background, and that tab is in the same container as your currently active tab, e.g. "Banking", which you can tell because:

  • It's got the colorful underline to indicate this
  • it doesn't have your login state (assuming your auth cookie is in your default container)

EXPECTED RESULTS:
New tab should be in the default container.

Note that I get expected results if I simply left-click the link (no keyboard modifiers), and I also get expected results if I shift-click the link (which opens a new window, whose sole tab is in the default container). Only ctrl-click/middle-mousebutton-click have this problem.

PTO Mode

I love the "Work Hours" feature of MyQOnly, but unfortunately it doesn't magically take my PTO into account. It'd be awesome to add a "PTO Until" feature to the settings menu to hide review requests until you're back!

Even cooler might be to take into account your Phabricator "availability" status, and not show your queue while you're marked as "unavailable".

Allow displaying Github reviews

I do some of my work in mozilla-central (which means BZ and Phab reviews) but a lot of my work in github.com/mozilla/application-services, for example (which means GH reviews). Can we generalize to a third system?

Refresh button doesn't actually refresh

From Callek in #phabricator:

mconley: so btw, myqonly refresh doesn't seem to work right, I upped the auto-refresh interval to 5 min, Just approved a github PR, and then was clicking refresh and it wasn't clearing my only review item... (but clicking the reviews to do link was indeed showing me a blank review queue on github)
9:02 AM (now it's clear, presumably due to the auto-refresh timer)

Ability to ignore specifc GitHub repos

I'm part of team (releng) that gets requested for reviews on a variety of repositories. Some of them I'm familiar with, and others I'm not. I don't want to ignore the entire team because many of the reviews are important. But I do want to ignore reviews requested to that team for a given set of repositories.

This is tricky because I likely would still want to be notified if I as an individual were flagged. I imagine you aren't interested in building an arbitrarily complex filter rule creator into the options :)

So I'd propose for the sake of simplicity, that there just be a blanket ignoredRepos config setting that only applies if the request comes via "any" team (so individual requests are never ignored).

0 Phabricator reviews?

I'm seeing "0 Phabricator reviews" in the popup alongside my non-zero number of Github reviews:

Screen Shot 2020-02-10 at 4 46 45 PM

It seems like the Phabricator line should just not be shown if there are 0 reviews.

Not sure if this is a new bug, or if I've just never noticed this before.

Pop-up window is blank

myqonly

The content is there, I can click on it. Sometimes the contents of the window is rendered, but usually it is not.

This could well be a Firefox bug (reminds me of bug 1408446) but I don't see it with other add-ons like uBlock Origin. Also not sure where to file!

Consider using the Conduit API

Hey!
This seems really awesome, thanks for making it! It may make the most sense to continue using web scraping to get phabricator review information, but there is an API which you can probably ping: https://phabricator.services.mozilla.com/conduit/ (I think having the cookie should mean you don't need a token? Not sure)

In specific, I think you'd want to fetch https://phabricator.services.mozilla.com/api/user.whoami to get the user's PHID, and then https://phabricator.services.mozilla.com/api/differential.revision.search with { "queryKey": "active", "constraints": { "reviewerPHIDs": ["PHID_HERE"] } } to get revisions where you're the reviewer.

After that you can scan through them and find the ones in the needs-review state to build up the queue :-).

Separate review requests for a reviewer group from other review requests

I was just added to a reviewer group, so now my review count in myqonly has skyrocketed even though most of those reviews aren't directly intended for me.

It would be nice to have two things:

  • Have the myqonly dropdown display separate items for reviewer-group requests vs requests specifically requested of me;
  • Be able to optionally filter out review group requests from the total number of reviews shown in the badge on the toolbar button.

Ability to use it with private github projects

This could be via token, or using browser session similar to how phabricator works.

My new (non-mozilla) role operates nearly solely in private github repos for code review, and this would be beneficial for me.

Ability to hide and/or snooze specific requests

More and more folks are using review groups (both in phabricator and via Github teams). Often certain members of the review group are better candidates to review a given patch then others. Sometimes I'll see a review that I know other people in the group would be much better at handling. In this case it would be awesome to have a way to hide that specific request as I know I likely won't be the one to look at it. There might be a risk of everyone in the group hiding it (all assuming that other people will get to it), so maybe a "snooze" button would be better to help avoid reviews being lost in the ether.

Add mechanism for unobtrusively telling users about add-on updates

Now that real people are actually using it, and relying on it for work, I want to make sure MyQOnly updates are as non-disruptive as possible.

So, as a policy, I aim to:

  1. Not spam users by opening a new tab automatically with changelists after updates
  2. Make it possible for the add-on to alert users that there have been changes that they might want to do something about, but maybe only if their review queue is empty, and only unobtrusively. My current idea is to show a non-red "*" as a badge iff there are no reviews to do. When in that updated state, the panel should show a link to let the user open up a new tab talking about recent changes.
  3. If switching mechanisms so that a user needs to go back into about:addons to reconfigure MyQOnly, support the old configuration for at least a few weeks to give people time to migrate over

Add google docs action items?

Google docs has a way to assign comments to specific people which leads to action items floating around and it makes me sad that people try to assign stuff to me.

Mostly, because there is no great overview to see which documents have assigned actions and how many there are. The only thing you can do is go to https://docs.google.com/document/u/0/?tgif=d and scrape it like so

// loop through list of docs
for (let doc of document.querySelectorAll(".docs-homescreen-list-item-title")) {
    // find those that have an action item count
    for (let needsFollowUp of doc.querySelectorAll(".docsshared-action-items-badge-count")) {
        let docTitle = doc.title;
        let amnt = needsFollowUp.textContent;
        let url = ""; //FIXME
        
    }
}```

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.