Conversation
|
PR title is not informative. PR title should be short description of issue you are working on and maybe issue number |
|
Remember when we have root directories of a repo, we can recursively get files in the entire project |
src/lib/github/utils.ts
Outdated
| return Promise.all(modifiedFiles); | ||
| } | ||
|
|
||
| export async function getfileNames(octokit, owner, repo, sha) { |
| @@ -0,0 +1,15 @@ | |||
| /** | |||
| * Gets files that have changed in the last commits | |||
There was a problem hiding this comment.
Maybe comment should change. I think it should be something like Get all repo files.
epicallan
left a comment
There was a problem hiding this comment.
The approach looks good, could you test this out on a repo and get back to me on how it works out .
|
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
left a comment
There was a problem hiding this comment.
Left a comment please address and ping me after.
src/lib/github/getFilesOnInstall.ts
Outdated
| const octokit = context.github; | ||
| const treeObject = await octokit.gitdata.getTree({owner, repo, sha, recursive: 5}); | ||
| return treeObject.tree.map( async (obj) => { | ||
| const arrFile: File[] = treeObject.tree.map( async (obj) => { |
There was a problem hiding this comment.
arrFile type is wrong. It returns an array of Promises, so its type is rightly
const arrFile: Array<Promise<File[]>>
To make it File[] you will have to use Promise.all and await on the returned values of treeObject.tree.map function
|
@aleku399 I tried running the app in this branch and discovered a number of issues to work on; 1 - we should listen to 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 3 - Since the installation doesn't have a 4 - I think you should eventually break up the function in |
No description provided.