freelyformd / github-todos

MVP: Analyse a repo's code for TODOs and FixMe comments & make github issues out of them
ISC License
3 stars 0 forks source link

Get entire repo comments on app install #66

Open aleku399 opened 6 years ago

epicallan commented 6 years ago

PR title is not informative. PR title should be short description of issue you are working on and maybe issue number

epicallan commented 6 years ago

Remember when we have root directories of a repo, we can recursively get files in the entire project

aleku399 commented 5 years ago

this method octokit.gitdata.getTree({owner, repo, sha, recursive: 5}); we are only able to recursively get the fileName and fileContent but if we wanted to use our app to be able to push there are some necessary adjustments needed like getting author and htmlUrl

epicallan commented 5 years ago

@aleku399 I tried running the app in this branch and discovered a number of issues to work on;

1 - we should listen to installation_repositories event instead of installation https://developer.github.com/webhooks/#events

2 - The data returned from the installation repository events is of a different type from the one we have worked with before. see https://developer.github.com/v3/activity/events/types/#installationrepositoriesevent. This means you may need to write a new function for getting repository properties something like getInstallationProps and drop usage of getBasicProps

3 - Since the installation doesn't have a commit sha you will need to get the latest commit for a repository by querying all commits and picking out the latest for use with the git tree data API.

4 - I think you should eventually break up the function in getFileOnInstall module into smaller functions. For instance, we can have a separate function for getting the latest commit sha and tree data