You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This comment explain the main idea: #30 (comment) (list public repo and let the user active/disactive dwylbot on the repos)
We are only working with public repos of the users at this stage to simplify the process and to stay in MVP mind. But once this step is done we can let the users activate/desactive dwylbot on organisation's repos, see #37
This issue explains also why we need to use Postgres database to store the list of repositories.
We can get the list of public repos of a user with the Github API: https://developer.github.com/v3/repos/#list-your-repositories . However the list of webhooks for each repos doesn't seem to be returned with this API call. To know the status of dwylbot (which can be deduced if the dwylbot webhook exists) for each repo we would need to call the "list webhooks" api (https://developer.github.com/v3/repos/hooks/#list-hooks) which is not a good idea: if the user has 100 public repos we would need to execute 100 API calls.
Instead a solution would be that when a user signup for the first time, the application get the list of public repos and save this list in Postgres. We consider that at this stage dwylbot is not active on any of these repos. We represent this dwybot status for each repos also in Postgres. When a user active or inactive dwylbot we first call the "create webhook" API (or "delete webhook") then if everything is ok we save the new status on Postgres. So to resume we are using Postgres to store the dwybot status instead of getting the information from the Github API. We will only need to update the list of repos (has new repos been created in Github? Has any repos been deleted from Github?) in Postgres each time a user access the page.
So to recap the steps
First time the list of repos is loaded (/repos) save the repos in Postgres with active_dwybot to false Save public repositories #42
each time the list of repos page is loaded (/repos) fetch the repos from Github + update the list in Postgres, delete inexistant repo and add new repo Save public repositories #42
The text was updated successfully, but these errors were encountered:
SimonLab
changed the title
Display dwybot status for public repositories
Display dwybot status for public repositories and save status in Postgres
May 10, 2017
This comment explain the main idea: #30 (comment) (list public repo and let the user active/disactive dwylbot on the repos)
We are only working with public repos of the users at this stage to simplify the process and to stay in MVP mind. But once this step is done we can let the users activate/desactive dwylbot on organisation's repos, see #37
This issue explains also why we need to use Postgres database to store the list of repositories.
We can get the list of public repos of a user with the Github API: https://developer.github.com/v3/repos/#list-your-repositories . However the list of webhooks for each repos doesn't seem to be returned with this API call. To know the status of dwylbot (which can be deduced if the dwylbot webhook exists) for each repo we would need to call the "list webhooks" api (https://developer.github.com/v3/repos/hooks/#list-hooks) which is not a good idea: if the user has 100 public repos we would need to execute 100 API calls.
Instead a solution would be that when a user signup for the first time, the application get the list of public repos and save this list in Postgres. We consider that at this stage dwylbot is not active on any of these repos. We represent this dwybot status for each repos also in Postgres. When a user active or inactive dwylbot we first call the "create webhook" API (or "delete webhook") then if everything is ok we save the new status on Postgres. So to resume we are using Postgres to store the dwybot status instead of getting the information from the Github API. We will only need to update the list of repos (has new repos been created in Github? Has any repos been deleted from Github?) in Postgres each time a user access the page.
So to recap the steps
The text was updated successfully, but these errors were encountered: