Hacktoberfest / hacktoberfest-2020

Hacktoberfest - App to manage the annual open-source challenge, used for the 2019 & 2020 seasons.
https://hacktoberfest.digitalocean.com
Other
496 stars 145 forks source link

Limit queries on project importer rake #549

Closed katjuell closed 3 years ago

katjuell commented 3 years ago

Description

Let's make the project importer rake a bit less of a lift, while also ensuring that it can run.

Test process

Run bin/rails github:fetch_popular_languages_projects from your app pod, and you should end up with 733 Repositories and 2482 Issues locally.

Requirements to merge

katjuell commented 3 years ago

@MattIPv4 okay, I think I've found a way to turn the knob a bit by restricting the created timestamp on the query. The rake now runs quickly and gets us a nice assortment of languages. If you run it now, you should get something like 39 repos, 63 issues, and the 8 languages. Good assortment to kick things off.

I've scheduled the job to run every 3 days to refresh the issues. I think that cadence will keep the selection fresh without creating too much overhead.

MattIPv4 commented 3 years ago

Oh, and, do we want to the job to wipe the old issues when it inserts new ones? So if we accidentally pulled in issues from a banned repo, we could ban it and rerun the job to fetch new ones?

katjuell commented 3 years ago

Okay, added a removal checker to clear things out before bringing new issues in, and then a check on the importer to check if the repo is banned before creating an issue.

katjuell commented 3 years ago

Awesome! Test worked.