This is probably somewhere between a bug report and a feature request.
I did run into the issue of not being able to add a comment while being in a valid diff getting the error (init.lua:309: bad argument #1 to 'ipairs' (table expected, got nil). Looked into it further and found out it's because there is no patch, looked at what is returned from gh and manually ran the gh command gh api --paginate repos/org/some-api/pulls/804/files --jq . -H "Accept: application/vnd.github.v3+json;application/vnd.github.squirrel-girl-preview+json;application/vnd.github.comfort-fade-preview+json;application/vnd.github.bane-preview+json".
What was returned by the API is "status": modified but it did contain no "patch". I stopped here but assume that some limit might have been hit on githubs API as it's a huge PR with lots of changes in testfiles etc.
The question is how to handle it and one idea maybe would be to check if status modified got returned and if so specifically query the diff for that file again if it didn't contain a patch?
Maybe this is a known issue and there's a solution/workaround for this?
Describe what you expected to happen
Comment should work even for large PRs.
If there's no path returned from API, try fetching it explicitly again for the file where it's missing. Or have an option to trust the local diff and add the comment based on the local diff?
How to reproduce it (as minimally and precisely as possible)
Open a huge PR (mine got 60 changed files with ~4000 new lines and ~3000 lines deleted, gh API request having 1083737 bytes.
Issue Description
Type: bug report
Describe what happened (or what feature you want)
This is probably somewhere between a bug report and a feature request.
I did run into the issue of not being able to add a comment while being in a valid diff getting the error
(init.lua:309: bad argument #1 to 'ipairs' (table expected, got nil)
. Looked into it further and found out it's because there is no patch, looked at what is returned from gh and manually ran the gh commandgh api --paginate repos/org/some-api/pulls/804/files --jq . -H "Accept: application/vnd.github.v3+json;application/vnd.github.squirrel-girl-preview+json;application/vnd.github.comfort-fade-preview+json;application/vnd.github.bane-preview+json"
.What was returned by the API is "status": modified but it did contain no "patch". I stopped here but assume that some limit might have been hit on githubs API as it's a huge PR with lots of changes in testfiles etc.
The question is how to handle it and one idea maybe would be to check if status modified got returned and if so specifically query the diff for that file again if it didn't contain a patch?
Maybe this is a known issue and there's a solution/workaround for this?
Describe what you expected to happen
Comment should work even for large PRs.
If there's no path returned from API, try fetching it explicitly again for the file where it's missing. Or have an option to trust the local diff and add the comment based on the local diff?
How to reproduce it (as minimally and precisely as possible)
Tell us your environment
Ubuntu, latest stable nvim, latest octo