capfredf
2020-10-30 17:28:51

I guess 4k on Linux might cause some problems when you do fractional scaling


spdegabrielle
2020-10-30 17:45:10

Sam and Paulo seem to have had good experience so I’ll take the plunge next payday.


samdphillips
2020-10-30 19:12:38

I’d be interested in what make/model/os distribution when you get it all up and running.


jbclements
2020-10-30 20:21:01

This is one of several reasons why I don’t like Slack…


jbclements
2020-10-30 20:25:24

Good people of Slack: anyone here use the github API much? The v7.9 release is currently blocked on a really silly issue.


jbclements
2020-10-30 20:25:59

Specifically, the script that gathers our list of contributors is failing on repositories with more than 250 commits between two releases.


jbclements
2020-10-30 20:26:16

Specifically, it looks like the “compare” endpoint that we use, as in


jbclements
2020-10-30 20:26:44

<https://api.github.com/repos/racket/slideshow/compare/v7.8...cd03c785d740ce69991df7465f3caf861e712fd5?per_page=250;page=1>


jbclements
2020-10-30 20:27:00

… doesn’t actually support pagination. In fact, the docs more or less specify this:



jbclements
2020-10-30 20:27:50

… which contains this text: “The response will include a comparison of up to 250 commits. If you are working with a larger commit range, you can use the <https://developer.github.com/v3/repos/commits/#list-commits|List commits> to enumerate all commits in the range.”


jbclements
2020-10-30 20:28:33

I should specify that if you just change “page=1” to “page=2” in the query above… you appear to get the same 250 commits. Ah well.


jbclements
2020-10-30 20:30:44

Unfortunately, the “commits” endpoint that the documentation refers to … doesn’t seem to actually include the parameters necessary. It has a “sha” tag which is apparently used to specify the start of the … oh, that’s interesting. It says


jbclements
2020-10-30 20:30:46

“SHA or branch to start listing commits from. Default: the repository’s default branch (usually master).”


jbclements
2020-10-30 20:31:46

The question is whether it lists forwards or backward from this point… Hmm… may have answered my own question, but not necessarily in a helpful way.


jbclements
2020-10-30 20:32:09

Anyhow, if anyone is in the “oh yeah, I use the GitHub API to fetch commit ranges all the time”, please let me know.


alexharsanyi
2020-10-30 21:42:52

I have not used the GitHUB API to fetch commit ranges, but I do used to fetch multi-page pull requests. You cannot just append "?page=2" to the request for the second page, instead you need to look for the “Links” response header which will contain the links for the previous and next pages. For example, to fetch open pull requests on a repository, the endpoint is:

<http://github/api/v3/repos/USER/REPO/pulls>

but the pages endpoints are:

<http://github/api/v3/repositories/111/pulls?state=open&amp;page=1>


alexharsanyi
2020-10-30 21:44:13

I suspect pagination is done at a lower level, where the repository ID, 111 in my case, is used


alexharsanyi
2020-10-30 21:46:27

Also note that the example above is from an internal Github installation, I don’t know what the endpoints look like for http://github.com\|github.com


kokou.afidegnon
2020-10-31 00:05:46

hi, i need a package for parsing html, is there any available ?


sorawee
2020-10-31 00:09:27

@jbclements I think you can do this by making multiple queries

The first query is to obtain the sha for the starting commit (newer). In your example, you have the sha already, so you don’t need this query

sha = cd03c785d740ce69991df7465f3caf861e712fd5

The second query is to obtain the sha for the ending commit (older). E.g.,

https://api.github.com/repos/racket/slideshow/commits/v7.8

sha = f8eca38a2241f9895845ab4a2254aa5ba4d60343

The last query is to list commits starting from the starting sha:

https://api.github.com/repos/racket/slideshow/commits?sha=cd03c785d740ce69991df7465f3caf861e712fd5

And while you have not found the ending sha, keep looking for the link field in the response header as @alexharsanyi said to obtain a new link to query for more.



kokou.afidegnon
2020-10-31 00:19:07

ok, thanks, let me look into it


kokou.afidegnon
2020-10-31 00:20:34

i’m trying to work on an html template where i can obtain some node elements, apply some placeholders,


kokou.afidegnon
2020-10-31 00:24:44

sorawee
2020-10-31 00:26:44

I don’t know but as far as I know it’s severely outdated, so I would guess no.


kokou.afidegnon
2020-10-31 00:27:24

i’m looking for an ability to interact with the Js engine as well,


samth
2020-10-31 00:30:13

No, it doesn’t do js


samth
2020-10-31 00:30:37

Basically, I know of no useful things you can do with that library


sorawee
2020-10-31 00:30:43

Couldn’t you just use selenium or something similar?


sorawee
2020-10-31 00:33:38

If you have Firefox, https://docs.racket-lang.org/marionette/ is another possibility. See https://github.com/Bogdanp/marionette for examples.


kokou.afidegnon
2020-10-31 03:35:05

ok thanks


jbclements
2020-10-31 06:54:03

Thanks @alexharsanyi… I’m now down the rabbit hole and I have a reasonable solution, but I’m probably doing much more than I should be; the bad moment was when I realized that of course commits could have more than one parent, and I should be following all paths back to the tagged commit. I think I have a fairly complete implementation of this tracing code, now, including 250-at-a-time buffering, but it’s really more code than this problem deserves.


jbclements
2020-10-31 06:55:05

Yep, that’s pretty much what I wound up doing, with the additional complication that commits may not be strictly linear. And also, github may not present them in an order that’s useful. Oog.