rust-repos icon indicating copy to clipboard operation
rust-repos copied to clipboard

Add GitLab scraping

Open pietroalbini opened this issue 7 years ago • 6 comments

Scraping GitLab repositories is required if we want to test them on Crater (and we do). This issue tracks the implementation of the scraper.

The API calls we would need to make to scrape are:

This is currently blocked on:

  • [x] Extend the GitLab /projects API to support filtering only Rust repos (GitLab issue)

pietroalbini avatar Sep 21 '18 08:09 pietroalbini

Gitlab CE now supports filtering /projects by programming language. I'm not sure when this will be deployed to gitlab.com.

However, Gitlab uses OFFSET and LIMIT to paginate the results of API calls, which means fetching the last page requires scanning the entire database. On my machine, fetching a page near the end of the database with https://gitlab.com/api/v4/projects?per_page=100&page=9000 takes about 14.5 seconds. If we assume that 10 seconds of that was spent in the database, fetching every project would take ~12.5 hours of database time.

Crater's use-case won't be quite that bad. If 5% of projects on Gitlab contain Rust, we'll need only 37.5 minutes of database time to scrape. If the result is cached, perhaps it's feasible to start running crater on Gitlab projects, but it's probably better to wait until keyset-based pagination is re-enabled.

ecstatic-morse avatar Feb 05 '19 11:02 ecstatic-morse

Gitlab CE now supports filtering /projects by programming language. I'm not sure when this will be deployed to gitlab.com.

That's great! Thanks for your work on this :heart:

Crater's use-case won't be quite that bad. If 5% of projects on Gitlab contain Rust, we'll need only 37.5 minutes of database time to scrape. If the result is cached, perhaps it's feasible to start running crater on Gitlab projects, but it's probably better to wait until keyset-based pagination is re-enabled.

Yeah, our results are cached, so it wouldn't that bad. If you ping me after the API is deployed on GitLab.com I can look into it, and if the performance is still bad I'll contact GitLab support to make sure we're not hurting them with the scrape.

pietroalbini avatar Feb 05 '19 11:02 pietroalbini

Will do!

ecstatic-morse avatar Feb 05 '19 11:02 ecstatic-morse

Looks like this will be deployed as part of the 11.8 release on February 22.

ecstatic-morse avatar Feb 09 '19 16:02 ecstatic-morse

If needed, we can add API calls to the gitlab crate to support this. We already support depagination too.

mathstuf avatar Mar 23 '19 16:03 mathstuf

There's also the question of which instances to scrape. gitlab.com is obvious, but the GNOME and freedesktop.org instances should probably also be on the list (at least).

mathstuf avatar Mar 23 '19 16:03 mathstuf