Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.

Count votes? #6

Closed
krlmlr opened this issue Feb 28, 2018 · 21 comments
Closed

Count votes? #6

krlmlr opened this issue Feb 28, 2018 · 21 comments
Assignees

Comments

@krlmlr
Copy link

krlmlr commented Feb 28, 2018

I've seen a few issues with a considerable number of votes in the dplyr repo. What's the best way to retrieve the issues most voted for?

@maelle
Copy link
Contributor

maelle commented Feb 28, 2018

oh nice one. I'll have a look. I think it'll involve iterating twice (issues, and then reactions).

I'm not sure one can ask for a number of reactions, that'd be cool, but I believe it'll first involve getting all reactions.

@maelle
Copy link
Contributor

maelle commented Feb 28, 2018

you'd want that only for opened issues right?

@maelle
Copy link
Contributor

maelle commented Feb 28, 2018

Hey by hand one can sort issues by reaction in a repo isaacs/github#600, I had no idea! (but I'll still investigate the API solution of course)

@maelle
Copy link
Contributor

maelle commented Feb 28, 2018

@maelle
Copy link
Contributor

maelle commented Feb 28, 2018

😢 not possible here to directly sort issues by +1 https://developer.github.com/v4/enum/issueorderfield/

@krlmlr
Copy link
Author

krlmlr commented Feb 28, 2018

Awesome, I haven't even looked there! This solves the problem for me, feel free to close. A recipe would be even nicer, of course!

Thanks a lot!

@krlmlr
Copy link
Author

krlmlr commented Feb 28, 2018

I haven't found how to exclude issues without reactions from the GUI.

@maelle
Copy link
Contributor

maelle commented Mar 7, 2018

I got the query 😎

query{
  repository(owner: "tidyverse", name: "dplyr"){
    issues(first: 100, states: OPEN){
      edges{
        node{
          number
          title
          reactions(content: THUMBS_UP){
            totalCount
          }
        }
      }
    }
  }
}

recipe to come

@maelle
Copy link
Contributor

maelle commented Mar 7, 2018

@krlmlr what would you want by issue on top on their thumbs up count, title and issue number? a direct link, the body? should the function also filter for thumbs up count > 0?

@maelle
Copy link
Contributor

maelle commented Mar 7, 2018

maybe labels and assignees?

@maelle maelle self-assigned this Mar 7, 2018
@krlmlr
Copy link
Author

krlmlr commented Mar 7, 2018

A link would be awesome, maybe the first paragraph (or 300 characters) of the body? Labels would be great, too.

A filter for count > 0 would be useful, that's the only thing I can't seem to do from the GUI. But that's easy enough to do when postprocessing.

How do we order by number of reactions?

@maelle
Copy link
Contributor

maelle commented Mar 7, 2018

A link would be awesome, maybe the first paragraph (or 300 characters) of the body? Labels would be great, too.

oh and milestones?

How would you use the recipe, would you currently look at the output in say the viewer of RStudio? (I guess in the future different teams could build different dashboard based on recipes)

How do we order by number of reactions?

I guess I could arrange by decreasing order before outputting the table. I could also add a parameter filter_null.

@krlmlr
Copy link
Author

krlmlr commented Mar 7, 2018

Thanks. Is the order still correct when you have first: 100 in your query?

I'd run it in RStudio for now.

@maelle
Copy link
Contributor

maelle commented Mar 7, 2018

Oh in the actual recipe I'll iterate over all open issues, not only the first 100 :-)

Ok!

maelle added a commit that referenced this issue Mar 7, 2018
@maelle
Copy link
Contributor

maelle commented Mar 7, 2018

There's now get_issues_thumbs.

As you see I currently handle labels in a bad way because I don't know yet how to paste them together with a separator. I also need to add assignees. And tell me anything that's wrong 😉

@maelle
Copy link
Contributor

maelle commented Mar 7, 2018

Note: When R CMD check the package examples all fail because I apparently handle .onLoad badly, but other than that it should work.

@maelle
Copy link
Contributor

maelle commented Mar 7, 2018

Oh and I'm not sure how to make URL clickable from RStudio Viewer?

@krlmlr
Copy link
Author

krlmlr commented Mar 8, 2018

Thanks, works for me! I don't know about jqr, can't help with the labeling issue. I'm amazed how concise you can express this query in that language.

Don't know about clickable URLs either.

I couldn't load the package without setting the GITHUB_GRAPHQL_TOKEN environment variable, could that explain the checking problem? I would make sure that loading always succeeds, though. It feels better to provide a way to reinitialize the ghql client. Currently .onLoad() adds ghql_gh_cli to the package environment directly; it might be better to put ghql_gh_cli into an environment that lives in your package environment.

@maelle
Copy link
Contributor

maelle commented Mar 8, 2018

Thanks, works for me!

Thanks! No need for assignees in your case?

I'm amazed how concise you can express this query in that language.

I know right?!

Currently .onLoad() adds ghql_gh_cli to the package environment directly; it might be better to put ghql_gh_cli into an environment that lives in your package environment.

Yes I need to re-think the way I define the client. Now the check passes but see #10

I could/should change the name of the environment variable because @jeroen told me it works with the usual GITHUB_PAT.

@maelle
Copy link
Contributor

maelle commented Mar 8, 2018

Reg having the clickable URL, I think one would only need to knit a report, in which the data.frame would be formatted like I do at the end of http://www.masalmon.eu/2018/03/04/hrbrpkgs/

@maelle
Copy link
Contributor

maelle commented Dec 11, 2020

Archiving this repo as I do not have the opportunity to work on this package at the moment.

https://devguide.ropensci.org/curationpolicy.html#incubator-packages

@maelle maelle closed this as completed Dec 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants