Contributees / First-Ruby-Quest

Web app referencing ruby related open source issues suitable for a first contribution and/or junior developers (or any developpers!)
MIT License
1 stars 2 forks source link

Add job to update and/or close issues #15

Closed Oli0li closed 10 months ago

Oli0li commented 10 months ago

This PR adds a job to update and/or close existing Issues.

We are now using the GitHub API for 2 things:

- Finding new issues to create (CreateIssuesJob) This only looks for open issues. It update attributes other than the "open/closed" status if the API call returns Issues we have already created, or create new Issues if they are not already in the database.

- Updating existing issues (UpdateIssuesJob) This looks for "open" and "closed" issues, so that we can stop showing Issues that are no longer available. It also updates other attributes.

From what I could see there is no way to make 1 API call to get updated information just concerning the Issues that are already in the database. So the solution here would be to check for all recent issues "open" or "closed". We could run the job to create 40 issues, and the day after, the job to update 100 issues to be sure we get data from issues that we've created a while ago. From what I could see there is generally not a lot of issues created/updated/closed everyday on GitHub, so that should hopefully ensure we keep track of closed issues. We can give it a try like this and see if it needs tweaking/how regularly we should run the jobs.