Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display dwybot status for public repositories and save status in Postgres #38

Closed
4 tasks
SimonLab opened this issue May 9, 2017 · 1 comment
Closed
4 tasks
Assignees
Milestone

Comments

@SimonLab
Copy link
Member

SimonLab commented May 9, 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

@SimonLab SimonLab added this to the Sprint 1 milestone May 9, 2017
@SimonLab SimonLab self-assigned this May 9, 2017
@SimonLab SimonLab changed the title Display dwybot status for public repositories Display dwybot status for public repositories and save status in Postgres May 10, 2017
@SimonLab SimonLab added epic and removed T1d labels May 10, 2017
@SimonLab
Copy link
Member Author

SimonLab commented Jun 8, 2017

This issue is resolved by using Github App see #51 #53

@SimonLab SimonLab closed this as completed Jun 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant