Stream: general

Topic: interacting with github api


Santiago Pastorino (Apr 30 2020 at 16:06, on Zulip):

yesterday I was trying to do a small script to interact with github's api to get our issues and prs and noticed a couple of things that wanted to know how are people doing this sorting out

Santiago Pastorino (Apr 30 2020 at 16:07, on Zulip):
  1. there's no way to filter by things that do not have certain labels https://developer.github.com/v3/issues/#parameters. My solution was to retrieve everything and filter manually
Santiago Pastorino (Apr 30 2020 at 16:08, on Zulip):
  1. there's no way to filter prs by things that contain a certain label https://developer.github.com/v3/pulls/#parameters. My solution will be to bring all the prs and filter manually but that seems crazy
Santiago Pastorino (Apr 30 2020 at 16:09, on Zulip):

Santiago Pastorino said:

  1. there's no way to filter prs by things that contain a certain label https://developer.github.com/v3/pulls/#parameters. My solution will be to bring all the prs and filter manually but that seems crazy

this would also be a bit more complicated because of pagination

Santiago Pastorino (Apr 30 2020 at 16:09, on Zulip):

does someone have any tip or idea?

Santiago Pastorino (Apr 30 2020 at 16:09, on Zulip):

cc @LeSeulArtichaut @simulacrum

simulacrum (Apr 30 2020 at 16:09, on Zulip):

github's api is not really well-suited to this sort of thing, fwiw. it's also pretty slow (they don't want you making more than one request at a time, and generally request latency is pretty high ime).

simulacrum (Apr 30 2020 at 16:09, on Zulip):

I think "just request everything" is the best bet unfortunately

Santiago Pastorino (Apr 30 2020 at 16:09, on Zulip):

another thing would be to request the html and parse it

simulacrum (Apr 30 2020 at 16:09, on Zulip):

that does mean you need auth

Santiago Pastorino (Apr 30 2020 at 16:10, on Zulip):

:cry:

simulacrum (Apr 30 2020 at 16:10, on Zulip):

parsing the html is going to be worse, I think, or at least I would not go down that road

simulacrum (Apr 30 2020 at 16:10, on Zulip):

I... honestly, I would at least consider doing this as part of triagebot

simulacrum (Apr 30 2020 at 16:10, on Zulip):

and a webhook

simulacrum (Apr 30 2020 at 16:10, on Zulip):

that stores into the db

simulacrum (Apr 30 2020 at 16:11, on Zulip):

it's not self-healing, in theory, but that's not horrible for the most part

simulacrum (Apr 30 2020 at 16:15, on Zulip):

or potentially also, consider making triagebot's server issue the github requests and cache results in memory

simulacrum (Apr 30 2020 at 16:15, on Zulip):

(or in the db, whatever)

simulacrum (Apr 30 2020 at 16:16, on Zulip):

e.g. every 15 minutes at most we'd re-fetch all issues and PRs into the db

LeSeulArtichaut (Apr 30 2020 at 16:16, on Zulip):

I don’t know much about the GitHub API either, I dived into it just for this application too

simulacrum (Apr 30 2020 at 16:16, on Zulip):

if we do it right it can be fairly cheap; you can tell github "hey I have this request result locally"

simulacrum (Apr 30 2020 at 16:17, on Zulip):

but even if we have to issue, say, 100 queries every 15 minutes if someone is actively using it that's not bad

simulacrum (Apr 30 2020 at 16:17, on Zulip):

I'm not sure if you're willing to accept 15 minute latency though

simulacrum (Apr 30 2020 at 16:17, on Zulip):

at some point you're just reimplementing github's db on the triagebot db which would be a bit unfortunate though :)

simulacrum (Apr 30 2020 at 16:18, on Zulip):

if we can try to narrow down exactly the info we want that'd be helpful I think

Santiago Pastorino (Apr 30 2020 at 21:08, on Zulip):

@simulacrum @LeSeulArtichaut thanks for your thoughts

Santiago Pastorino (Apr 30 2020 at 21:08, on Zulip):

an approach like what Mark has described seems interesting :)

Santiago Pastorino (Apr 30 2020 at 21:08, on Zulip):

I'm going to try to keep my huge hack going and see what happens

Santiago Pastorino (Apr 30 2020 at 21:08, on Zulip):

I just don't want to continue doing prioritization meetings manually :)

Santiago Pastorino (Apr 30 2020 at 21:08, on Zulip):

if I can automate 75% of the meeting that's at least better

simulacrum (Apr 30 2020 at 21:09, on Zulip):

fwiw the "resync the last ~30 commits" is the approach I went with for the bors commit list

Santiago Pastorino (Apr 30 2020 at 21:10, on Zulip):

yeah that kind of latency is good enough for this stuff

Santiago Pastorino (Apr 30 2020 at 21:10, on Zulip):

I meant, at least for my use case

simulacrum (Apr 30 2020 at 21:10, on Zulip):

well, to be clear, the bors commit list has 0 latency

Santiago Pastorino (Apr 30 2020 at 21:10, on Zulip):

there's some kind of latency on github per se

simulacrum (Apr 30 2020 at 21:10, on Zulip):

but it is relatively self healing too

simulacrum (Apr 30 2020 at 21:10, on Zulip):

https://triage.rust-lang.org/bors-commit-list

Santiago Pastorino (Apr 30 2020 at 21:11, on Zulip):

I tag things with beta-nominated and go to my search of issues beta-nominated and don't see those newly nominated ones for some minutes

Santiago Pastorino (Apr 30 2020 at 21:11, on Zulip):

unsure how long but it takes time

Santiago Pastorino (Apr 30 2020 at 21:11, on Zulip):

simulacrum said:

https://triage.rust-lang.org/bors-commit-list

cool

simulacrum (Apr 30 2020 at 21:12, on Zulip):

so -- e.g. if you want a list of beta-nominated prs -- triagebot could easily keep track of that for you

simulacrum (Apr 30 2020 at 21:12, on Zulip):

at a http or JSON endpoint, w/e works

Santiago Pastorino (Apr 30 2020 at 21:12, on Zulip):

yeah, seems like that's the best solution

simulacrum (Apr 30 2020 at 21:12, on Zulip):

er, html or JSON

simulacrum (Apr 30 2020 at 21:13, on Zulip):

obviously http

simulacrum (Apr 30 2020 at 21:13, on Zulip):

I mean we can expose raw tcp sockets that just spew json at you if you connect

simulacrum (Apr 30 2020 at 21:13, on Zulip):

but that seems like not what you want :)

Santiago Pastorino (Apr 30 2020 at 21:14, on Zulip):

yeah no no

Santiago Pastorino (Apr 30 2020 at 21:14, on Zulip):

just json over http would be enough

Santiago Pastorino (Apr 30 2020 at 21:14, on Zulip):

Santiago Pastorino said:

yeah, seems like that's the best solution

as I was saying it seems like the best solution but also seems like there's a bit of work to do that :P

Santiago Pastorino (Apr 30 2020 at 21:15, on Zulip):

and some interesting steps too

Santiago Pastorino (Apr 30 2020 at 21:15, on Zulip):

like dealing with github pagination

Santiago Pastorino (Apr 30 2020 at 21:15, on Zulip):

understanding how to store things on triagebot

Santiago Pastorino (Apr 30 2020 at 21:15, on Zulip):

how to setup jobs that run every x minutes there

Santiago Pastorino (Apr 30 2020 at 21:15, on Zulip):

and a bunch of other, etcs :)

Santiago Pastorino (Apr 30 2020 at 21:16, on Zulip):

may be a good idea to create some kind of little project or maybe just add an issue with those steps so we can agree on an approach and maybe split tasks between volunteers/people interested

simulacrum (Apr 30 2020 at 21:16, on Zulip):

well, no, so to be clear

simulacrum (Apr 30 2020 at 21:16, on Zulip):

you don't need a cronjob or whatever

simulacrum (Apr 30 2020 at 21:16, on Zulip):

on each webhook, you look if that added a beta-nominated label, and then stick that issue (along with whatever metadata you want) in the db

simulacrum (Apr 30 2020 at 21:17, on Zulip):

and if it's remove you can drop it presumably

simulacrum (Apr 30 2020 at 21:17, on Zulip):

that's the easy thing

simulacrum (Apr 30 2020 at 21:17, on Zulip):

and most likely works 99% ofthe time

Santiago Pastorino (Apr 30 2020 at 21:18, on Zulip):

unsure if I got the whole solution then

Santiago Pastorino (Apr 30 2020 at 21:18, on Zulip):

but how do you prepopulate the issues db?

simulacrum (Apr 30 2020 at 21:18, on Zulip):

well, you either a) don't, and just toggle the beta-nominated labels

Santiago Pastorino (Apr 30 2020 at 21:18, on Zulip):

also that's not the only thing I want (beta noms), also need other labels included, issues that do not have certain labels, etc

simulacrum (Apr 30 2020 at 21:19, on Zulip):

if you can prepare a list, that'd be helpful

Santiago Pastorino (Apr 30 2020 at 21:19, on Zulip):

list of things needed?

simulacrum (Apr 30 2020 at 21:19, on Zulip):

I personally think that this is easily solveable with triagebot

simulacrum (Apr 30 2020 at 21:19, on Zulip):

list of the "queries" you want to run against github, yeah

Santiago Pastorino (Apr 30 2020 at 21:19, on Zulip):

let me show that quickly

Santiago Pastorino (Apr 30 2020 at 21:20, on Zulip):

all the searches starting here https://hackmd.io/pHb6eTZ2Sjy6XZmwXZHIBA?view#Remove-I-nominated-leftovers

Santiago Pastorino (Apr 30 2020 at 21:20, on Zulip):

mainly filters about labels

Santiago Pastorino (Apr 30 2020 at 21:20, on Zulip):

issues that include certain labels and exclude certain other labels

Santiago Pastorino (Apr 30 2020 at 21:20, on Zulip):

issues and prs

Santiago Pastorino (Apr 30 2020 at 21:20, on Zulip):

only issues

Santiago Pastorino (Apr 30 2020 at 21:20, on Zulip):

things closed and open

Santiago Pastorino (Apr 30 2020 at 21:20, on Zulip):

combinations of those things in general

simulacrum (Apr 30 2020 at 21:21, on Zulip):

how do you use this information, though? i.e. why aren't the links good enough?

Santiago Pastorino (Apr 30 2020 at 21:22, on Zulip):

so the use case is ...

Santiago Pastorino (Apr 30 2020 at 21:22, on Zulip):

https://rust-lang.zulipchat.com/#narrow/stream/227806-t-compiler.2Fwg-prioritization/topic/pre-meeting.20triage.202020-04-30.20.2354818/near/195756076

Santiago Pastorino (Apr 30 2020 at 21:23, on Zulip):

I use this hackmd https://hackmd.io/pHb6eTZ2Sjy6XZmwXZHIBA?view#Remove-I-nominated-leftovers to run the meeting

Santiago Pastorino (Apr 30 2020 at 21:23, on Zulip):

go over each section and paste those links

Santiago Pastorino (Apr 30 2020 at 21:23, on Zulip):

so we need to open them

Santiago Pastorino (Apr 30 2020 at 21:23, on Zulip):

check if the list is empty or not

simulacrum (Apr 30 2020 at 21:23, on Zulip):

so, let me try to phrase my understanding:

you go to the link, and look over the issues -- your goal is to take some action

Santiago Pastorino (Apr 30 2020 at 21:23, on Zulip):

then list them

simulacrum (Apr 30 2020 at 21:23, on Zulip):

but you want to do so publicly, so ideally you'd not be manually copy pasting links and whatnot

Santiago Pastorino (Apr 30 2020 at 21:23, on Zulip):

with markdown format, in some cases we need to add those to the agenda

Santiago Pastorino (Apr 30 2020 at 21:24, on Zulip):

we spend literally 30 minutos on this each meeting

Santiago Pastorino (Apr 30 2020 at 21:24, on Zulip):

is not only copy pasting the links but also parsing them

Santiago Pastorino (Apr 30 2020 at 21:24, on Zulip):

let me show you

Santiago Pastorino (Apr 30 2020 at 21:24, on Zulip):

because I have a running thing

Santiago Pastorino (Apr 30 2020 at 21:25, on Zulip):
     Running `target/debug/prioritization`

### Remove I-nominated leftovers

- [Unnominate leftover I-nominated](https://github.com/rust-lang/rust/issues?q=is%3Aopen+label%3AI-nominated+label%3AT-compiler)
    - Remove `I-nominated` tag from issues discussed on the last meeting.


Unsoundness due to variance of trait objects WRT associated types [#71550](https://github.com/rust-lang/rust/issues/71550)
Warn on useless bindings like `let v2 = v1.sort();` [#71432](https://github.com/rust-lang/rust/issues/71432)
Accept tuple.0.0 as tuple indexing (take 2) [#71322](https://github.com/rust-lang/rust/pull/71322)
repr(packed) allows invalid unaligned loads [#27060](https://github.com/rust-lang/rust/issues/27060)

### Unprioritized I-prioritize

Go over unprioritized I-prioritize issues. We should also go over I-nominated meanwhile we migrate, we were using I-nominated sometimes as an implicit request for prioritization.

1. [No team assigned](https://github.com/rust-lang/rust/issues?q=is%3Aopen+is%3Aissue+-label%3AP-critical+-label%3AP-high+-label%3AP-medium+-label%3AP-low+label%3AI-prioritize+-label%3AT-compiler+-label%3AT-libs+-label%3AT-infra+-label%3A
T-rustdoc+-label%3AT-lang)
    - Add T-compiler tag when it corresponds.

Empty

2. [T-compiler](https://github.com/rust-lang/rust/issues?q=is%3Aopen+is%3Aissue+label%3AT-compiler+-label%3AP-critical+-label%3AP-high+-label%3AP-medium+-label%3AP-low+label%3AI-prioritize)
    - Prioritize issues and remove nomination of the ones not worth discussing.
    - Tag regressions accordingly.
    - Ping appropriate people and/or [ICE-breakers](https://rustc-dev-guide.rust-lang.org/ice-breaker/about.html#tagging-an-issue-for-an-ice-breaker-group).

Empty

3. [All teams](https://github.com/rust-lang/rust/issues?q=is%3Aopen+is%3Aissue+-label%3AP-critical+-label%3AP-high+-label%3AP-medium+-label%3AP-low+label%3AI-prioritize)
    - No action required. It's nice to look at this for comparison.

Empty
Santiago Pastorino (Apr 30 2020 at 21:25, on Zulip):

this is more or less what the tool I'm building does

simulacrum (Apr 30 2020 at 21:25, on Zulip):

and the idea would be to paste that into zulip?

simulacrum (Apr 30 2020 at 21:25, on Zulip):

Remove I-nominated leftovers

Unsoundness due to variance of trait objects WRT associated types #71550
Warn on useless bindings like let v2 = v1.sort(); #71432
Accept tuple.0.0 as tuple indexing (take 2) #71322
repr(packed) allows invalid unaligned loads #27060

Unprioritized I-prioritize

Go over unprioritized I-prioritize issues. We should also go over I-nominated meanwhile we migrate, we were using I-nominated sometimes as an implicit request for prioritization.

  1. No team assigned
    - Add T-compiler tag when it corresponds.

Empty

  1. T-compiler
    - Prioritize issues and remove nomination of the ones not worth discussing.
    - Tag regressions accordingly.
    - Ping appropriate people and/or ICE-breakers.

Empty

  1. All teams
    - No action required. It's nice to look at this for comparison.

Empty

Santiago Pastorino (Apr 30 2020 at 21:25, on Zulip):

yes and or to the agenda

simulacrum (Apr 30 2020 at 21:25, on Zulip):

aha, okay

Santiago Pastorino (Apr 30 2020 at 21:26, on Zulip):

ideally that could be run using commands here

Santiago Pastorino (Apr 30 2020 at 21:26, on Zulip):

like @rustbot start-prioritization-meeting

Santiago Pastorino (Apr 30 2020 at 21:26, on Zulip):

@rustbot next

simulacrum (Apr 30 2020 at 21:26, on Zulip):

yeah, yeah, I see...

Santiago Pastorino (Apr 30 2020 at 21:26, on Zulip):

and then we see the next set of things and so on

Santiago Pastorino (Apr 30 2020 at 21:26, on Zulip):

maybe if we have 4 empty lists in a row the thing just skips everything

Santiago Pastorino (Apr 30 2020 at 21:26, on Zulip):

it may seem silly but we spend a lot of time on this :)

simulacrum (Apr 30 2020 at 21:27, on Zulip):

I think doing it in triagebot is the way to go honestly, you're going to end up copy/pasting a bunch if it's from the command line

simulacrum (Apr 30 2020 at 21:27, on Zulip):

and then just ping triagebot here

Santiago Pastorino (Apr 30 2020 at 21:27, on Zulip):

this is why I'm saying I'm building something very bad, ugly but that would do some of the work needed

simulacrum (Apr 30 2020 at 21:27, on Zulip):

so how does this sound: you probably are good with a partial solution to start, too

simulacrum (Apr 30 2020 at 21:28, on Zulip):

I can try to get https://hackmd.io/pHb6eTZ2Sjy6XZmwXZHIBA?view#Remove-I-nominated-leftovers specifically working

Santiago Pastorino (Apr 30 2020 at 21:28, on Zulip):

I'm doing it in triagebot, just added a src/bin/prioritization

simulacrum (Apr 30 2020 at 21:28, on Zulip):

well I meant as a zulip command, but sure

simulacrum (Apr 30 2020 at 21:28, on Zulip):

and then you can use that as a template for how to do the rest?

simulacrum (Apr 30 2020 at 21:28, on Zulip):

e.g. you'd do @triagebot leftover-noms

Santiago Pastorino (Apr 30 2020 at 21:28, on Zulip):

sure, everything helps

simulacrum (Apr 30 2020 at 21:29, on Zulip):

and it'd paste:

Remove I-nominated leftovers

Unsoundness due to variance of trait objects WRT associated types #71550
Warn on useless bindings like let v2 = v1.sort(); #71432
Accept tuple.0.0 as tuple indexing (take 2) #71322
repr(packed) allows invalid unaligned loads #27060

Santiago Pastorino (Apr 30 2020 at 21:29, on Zulip):

but I don't have an issue with that specifically

Santiago Pastorino (Apr 30 2020 at 21:29, on Zulip):

I think we started to talk now about something different :)

Santiago Pastorino (Apr 30 2020 at 21:29, on Zulip):

so the main problem is that I don't have a way to get prs

simulacrum (Apr 30 2020 at 21:29, on Zulip):

I'm a bit confused :)

I thought you were saying that you weren't sure how to do this

simulacrum (Apr 30 2020 at 21:29, on Zulip):

how are prs different from this?

Santiago Pastorino (Apr 30 2020 at 21:29, on Zulip):

so the main problem I was talking about is that I'd need to get all prs

Santiago Pastorino (Apr 30 2020 at 21:30, on Zulip):

Santiago Pastorino said:

  1. there's no way to filter prs by things that contain a certain label https://developer.github.com/v3/pulls/#parameters. My solution will be to bring all the prs and filter manually but that seems crazy

jump to the first two sentences of the topic

Santiago Pastorino (Apr 30 2020 at 21:30, on Zulip):

that's in particular one of the problems

Santiago Pastorino (Apr 30 2020 at 21:30, on Zulip):

I thought you were saying that we could solve this by storing issues and prs on a database and syncronizing them frequently

simulacrum (Apr 30 2020 at 21:31, on Zulip):

yes you can do that

simulacrum (Apr 30 2020 at 21:31, on Zulip):

but actually, I think you can just use the issues endpoint

simulacrum (Apr 30 2020 at 21:31, on Zulip):

github will return both prs and issues from it iirc

Santiago Pastorino (Apr 30 2020 at 21:31, on Zulip):

nope :)

simulacrum (Apr 30 2020 at 21:31, on Zulip):

Note: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the pull_request key.

Santiago Pastorino (Apr 30 2020 at 21:32, on Zulip):

really? if that's true all my problems are solved

simulacrum (Apr 30 2020 at 21:32, on Zulip):

oh okay

simulacrum (Apr 30 2020 at 21:32, on Zulip):

well :)

simulacrum (Apr 30 2020 at 21:32, on Zulip):

to my knowledge it is true

Santiago Pastorino (Apr 30 2020 at 21:33, on Zulip):

the may part confuses me but ... :+1:

Santiago Pastorino (Apr 30 2020 at 21:33, on Zulip):

the other problem is filtering out some labels but that can be done programmatically

simulacrum (Apr 30 2020 at 21:33, on Zulip):

well obviously it can return just one or just the other depending on your query

Santiago Pastorino (Apr 30 2020 at 21:33, on Zulip):

still we can talk about how to do the rest

Santiago Pastorino (Apr 30 2020 at 21:34, on Zulip):

simulacrum said:

I can try to get https://hackmd.io/pHb6eTZ2Sjy6XZmwXZHIBA?view#Remove-I-nominated-leftovers specifically working

if it's easy to do this for you, may help :+1:

Santiago Pastorino (Apr 30 2020 at 21:34, on Zulip):

mainly to reduce the amount of work needed :slight_smile:

Santiago Pastorino (Apr 30 2020 at 21:34, on Zulip):

but only if it's easy for you

Santiago Pastorino (Apr 30 2020 at 21:35, on Zulip):

I'm more focused on something text based because I want to have something for the next meeting and I don't have a lot of time to play with this

Santiago Pastorino (Apr 30 2020 at 21:35, on Zulip):

so if it's easy and you can would be great

Santiago Pastorino (Apr 30 2020 at 21:35, on Zulip):

the problem I guess is setting up something with state

simulacrum (Apr 30 2020 at 21:35, on Zulip):

I can probably get the state thing going

Santiago Pastorino (Apr 30 2020 at 21:36, on Zulip):

where we can do @rustbot start-meeting and then continue doing calling @rustbot next

simulacrum (Apr 30 2020 at 21:36, on Zulip):

e.g. something like a wrapper that takes in a impl Iterator<Item=String> and on rustbot next it'll paste the next string

Santiago Pastorino (Apr 30 2020 at 21:36, on Zulip):

and at the end with a @rustbot end-meeting it prints the agenda or something like that

simulacrum (Apr 30 2020 at 21:36, on Zulip):

would that be helpful?

Santiago Pastorino (Apr 30 2020 at 21:37, on Zulip):

yeah that's exactly what I was thinking about doing

simulacrum (Apr 30 2020 at 21:37, on Zulip):

okay, yeah, I can do that no problem I think

Santiago Pastorino (Apr 30 2020 at 21:37, on Zulip):

cool, thanks a lot

Santiago Pastorino (Apr 30 2020 at 21:37, on Zulip):

I'm going to do the rest and hopefully we can mix up the pieces and have something soon

simulacrum (Apr 30 2020 at 21:38, on Zulip):

@Santiago Pastorino do you need a iterator, specifically? or do you think just a Vec<String> would work too?

simulacrum (Apr 30 2020 at 21:38, on Zulip):

basically, can the meeting run based on a pre-generated agenda

simulacrum (Apr 30 2020 at 21:38, on Zulip):

instead of one that (in theory) could dynamically update as we go

Santiago Pastorino (Apr 30 2020 at 21:40, on Zulip):

simulacrum said:

basically, can the meeting run based on a pre-generated agenda

the agenda is fixed and pre-generated

Santiago Pastorino (Apr 30 2020 at 21:40, on Zulip):

so the confusing thing is that we have 2 agendas, let me explain

Santiago Pastorino (Apr 30 2020 at 21:40, on Zulip):

there's pre-triage meeting which has a fixed amount of steps (we could call that pre-triage agenda)

Santiago Pastorino (Apr 30 2020 at 21:41, on Zulip):

and that's documented here https://hackmd.io/pHb6eTZ2Sjy6XZmwXZHIBA?view#Pre-triage

Santiago Pastorino (Apr 30 2020 at 21:41, on Zulip):

that pre-triage meeting ends building a triage agenda

Santiago Pastorino (Apr 30 2020 at 21:41, on Zulip):

and that triage agenda also have a fixed amount of things too

Santiago Pastorino (Apr 30 2020 at 21:41, on Zulip):

so there's no dynamic updates as we go on any agenda

simulacrum (Apr 30 2020 at 21:42, on Zulip):

okay, so on my end I'll just have some command that can run a Rust function (or functions, depending, for each agenda etc) returning Vec<String> and then can make progress through that

Santiago Pastorino (Apr 30 2020 at 21:47, on Zulip):

:+1:

Santiago Pastorino (Apr 30 2020 at 21:47, on Zulip):

I have most of the rest of the setup done

Santiago Pastorino (Apr 30 2020 at 21:47, on Zulip):

but it needs love and some more work

Santiago Pastorino (Apr 30 2020 at 21:47, on Zulip):

:D

Santiago Pastorino (Apr 30 2020 at 21:49, on Zulip):

@simulacrum I have things like this

Santiago Pastorino (Apr 30 2020 at 21:49, on Zulip):
    pub async fn i_nominated_leftovers(&self, client: &GithubClient) -> anyhow::Result<Vec<Issue>> {
        self.get_issues(
            client,
            &["state=open"],
            &[
                &Label {
                    name: "I-nominated".to_string(),
                },
                &Label {
                    name: "T-compiler".to_string(),
                },
            ],
            &[],
        )
        .await
    }
Santiago Pastorino (Apr 30 2020 at 21:49, on Zulip):

one thing though, that I think it's already set up is ...

Santiago Pastorino (Apr 30 2020 at 21:49, on Zulip):

it would be better to move all this repetitions to a toml file

simulacrum (Apr 30 2020 at 21:49, on Zulip):

I'll likely have something by late friday or mid-weekend or so

simulacrum (Apr 30 2020 at 21:49, on Zulip):

I would start by duplicating the code

Santiago Pastorino (Apr 30 2020 at 21:50, on Zulip):

yeah this is what I've done

simulacrum (Apr 30 2020 at 21:50, on Zulip):

we can clean it up and toml it later

Santiago Pastorino (Apr 30 2020 at 21:50, on Zulip):

everything is kind of duplicated

simulacrum (Apr 30 2020 at 21:50, on Zulip):

don't worry about that for now

Santiago Pastorino (Apr 30 2020 at 21:50, on Zulip):

but I'd end up with more lines of code that rustc itself I fear :joy:

Santiago Pastorino (Apr 30 2020 at 21:50, on Zulip):
    /// https://github.com/rust-lang/rust/issues?q=is%3Aopen+is%3Aissue+-label%3AP-critical+-label%3AP-high+-label%3AP-medium+-label%3AP-low+label%3AI-prioritize+-label%3AT-compiler+-label%3AT-libs+-label%3AT-infra+-label%3AT-rustdoc+-label%3AT-lang
    pub async fn unpri_i_prioritize_no_team(
        &self,
        client: &GithubClient,
    ) -> anyhow::Result<Vec<Issue>> {
        // FIXME filter labels
        self.get_issues(
            client,
            &["state=open"],
            &[&Label {
                name: "I-prioritize".to_string(),
            }],
            &[
                &Label {
                    name: "P-critical".to_string(),
                },
                &Label {
                    name: "P-high".to_string(),
                },
                &Label {
                    name: "P-medium".to_string(),
                },
                &Label {
                    name: "P-low".to_string(),
                },
                &Label {
                    name: "T-compiler".to_string(),
                },
                &Label {
                    name: "T-libs".to_string(),
                },
                &Label {
                    name: "T-infra".to_string(),
                },
                &Label {
                    name: "T-rustdoc".to_string(),
                },
                &Label {
                    name: "T-lang".to_string(),
                },
            ],
        )
        .await
    }
Santiago Pastorino (Apr 30 2020 at 21:51, on Zulip):

and so on

Santiago Pastorino (Apr 30 2020 at 21:51, on Zulip):

then there are the messages we print

Santiago Pastorino (Apr 30 2020 at 21:51, on Zulip):

all that is pure repetition

simulacrum (Apr 30 2020 at 21:51, on Zulip):

:shrug: lines of code don't bother me

Santiago Pastorino (Apr 30 2020 at 21:51, on Zulip):

hehehe

simulacrum (Apr 30 2020 at 21:51, on Zulip):

I would get a MVP out the door

Santiago Pastorino (Apr 30 2020 at 21:51, on Zulip):

that makes me get stuck

Santiago Pastorino (Apr 30 2020 at 21:51, on Zulip):

really

Santiago Pastorino (Apr 30 2020 at 21:51, on Zulip):

I see that amount of repetition and get paralyzed

Santiago Pastorino (Apr 30 2020 at 21:52, on Zulip):

anyway, will get this going but there's a toml file where we place this kind of things in triagebot, right?

simulacrum (Apr 30 2020 at 21:52, on Zulip):

ah, no, not really

simulacrum (Apr 30 2020 at 21:52, on Zulip):

we don't have global config anywhere

simulacrum (Apr 30 2020 at 21:52, on Zulip):

but I'd not use toml for now anyway

Santiago Pastorino (Apr 30 2020 at 21:53, on Zulip):

couldn't this be used https://github.com/rust-lang/triagebot/blob/master/triagebot.toml ?

simulacrum (Apr 30 2020 at 21:53, on Zulip):

make a helper function that goes from &[&'static str] to Vec<Label> and that'll already massively help

simulacrum (Apr 30 2020 at 21:53, on Zulip):

well, no, not really, that's the config for the triagebot repo itself

Santiago Pastorino (Apr 30 2020 at 21:54, on Zulip):

:+1:

Santiago Pastorino (Apr 30 2020 at 21:54, on Zulip):

will see :)

Santiago Pastorino (Apr 30 2020 at 21:54, on Zulip):

but may end adding a file somewhere

simulacrum (Apr 30 2020 at 21:55, on Zulip):

okay

XAMPPRocky (May 01 2020 at 17:54, on Zulip):

@Santiago Pastorino Semi-related; I actually have been working on a new GitHub API client library for Rust, that should hopefully nice to use, and I was wondering if you'd mind sharing which of GitHub's APIs you end using the most? It would help me with knowing what to prioritize in terms of what to implement. Example of the API for getting pull requests.

let prs = octocrab.pulls("owner", "repo").list()
    // Optional Parameters
    .state(params::State::Open)
    .sort(params::pulls::Sort::Popularity)
    .per_page(100)
    // Send the request
    .send()
    .await?;
Santiago Pastorino (May 01 2020 at 20:35, on Zulip):

@XAMPPRocky that's cool, at some point I thought about extracting some stuff into a small library too

Santiago Pastorino (May 01 2020 at 20:35, on Zulip):

but what I ended using is very reduced

Santiago Pastorino (May 01 2020 at 20:39, on Zulip):

mainly https://developer.github.com/v3/issues/

Santiago Pastorino (May 01 2020 at 20:40, on Zulip):

it's actually that + filtering with labels

Santiago Pastorino (May 01 2020 at 20:40, on Zulip):

nothing else really

DPC (May 01 2020 at 20:53, on Zulip):

octocrab xD

Santiago Pastorino (May 05 2020 at 22:49, on Zulip):

coming back to this thing, as @simulacrum mentioned prs are grabbed when you use https://developer.github.com/v3/issues/ but it completely ignores the state part

simulacrum (May 05 2020 at 22:49, on Zulip):

that seems wrong, can you paste your url?

simulacrum (May 05 2020 at 22:49, on Zulip):

I remember state working for me

Santiago Pastorino (May 05 2020 at 22:49, on Zulip):

so regardless if you use state=open,all,closed it seems like is always giving me back the open ones

Santiago Pastorino (May 05 2020 at 22:50, on Zulip):

hold on ...

Santiago Pastorino (May 05 2020 at 22:50, on Zulip):

yeah have done zero debugging ...

Santiago Pastorino (May 05 2020 at 22:52, on Zulip):

"https://api.github.com/repos/rust-lang/rust/issues?labels=beta-nominated&\"state=closed\""

Santiago Pastorino (May 05 2020 at 22:52, on Zulip):

or state=all

Santiago Pastorino (May 05 2020 at 22:52, on Zulip):

both queries give back ...

simulacrum (May 05 2020 at 22:52, on Zulip):

what's with the quotes there?

Santiago Pastorino (May 05 2020 at 22:52, on Zulip):
Santiago Pastorino (May 05 2020 at 22:53, on Zulip):

facepalm :)

Santiago Pastorino (May 05 2020 at 22:54, on Zulip):

I thought this was working

Santiago Pastorino (May 05 2020 at 22:54, on Zulip):

ohh I see, by default is state=open

Santiago Pastorino (May 05 2020 at 22:55, on Zulip):

that's why I've assumed it was working was entirely ignoring that and giving me back state=open

Santiago Pastorino (May 05 2020 at 22:55, on Zulip):

I thought the default was state=all

Santiago Pastorino (May 05 2020 at 22:55, on Zulip):

anyway, it works, thanks

Last update: May 29 2020 at 18:00UTC