Githawk: GQL only has 6 file changes while PR has 12

Created on 7 Nov 2017  路  12Comments  路  Source: GitHawkApp/GitHawk

879

https://github.com/rnystrom/GitHawk/pull/879/files

GitHawk Upload by rnystrom


Bug Report Dump (Auto-generated)

Version 1.12.0 (1157)
Device: iPhone 7 Plus (iOS 11.1)
TestFlight: false

馃悰 bug

Most helpful comment

Endpoint: https://api.github.com/repos/rnystrom/GitHawk/pulls/879/files?access_token=redacted

PSD:

"sha": "08728f8b5398feebcf1dca18f65e235298840f21",
"filename": "Design/nav-items-66.psd",
"status": "added",
"additions": 0,
"deletions": 0,
"changes": 0,
"blob_url": "...",
"raw_url": "...",
"contents_url": "..."

File:

"sha": "7946d9aba5839b9586924dd607415c1672139eda",
"filename": "Classes/Repository/RepositoryViewController.swift",
"status": "modified",
"additions": 49,
"deletions": 21,
"changes": 70,
"blob_url": "...",
"raw_url": "...",
"contents_url": "...",
"patch": "..."

https://github.com/rnystrom/GitHawk/blob/master/Classes/Models/File.swift#L34

File model expects a "patch" value, and if it doesn't have it will simply fail to add it. As you can see above, binaries will not have a patch and therefore won't be added.

Must admit I noticed this ages ago, but I assumed it was intentional because we have no way to render binary files yet?

All 12 comments

*.png and *.psd files are missing

Sent with GitHawk

Oh wow, GQL just ignores them? Holy crap. 馃挬

Sent with GitHawk

Lol ya very confused. Maybe I鈥檓 doing something wrong in the request?

Here鈥檚 the request:
https://github.com/rnystrom/GitHawk/blob/master/Classes/Issues/Files/GithubClient%2BPullRequestFiles.swift

Maybe there鈥檚 something different in parsing the response into a File...

Sent with GitHawk

Endpoint: https://api.github.com/repos/rnystrom/GitHawk/pulls/879/files?access_token=redacted

PSD:

"sha": "08728f8b5398feebcf1dca18f65e235298840f21",
"filename": "Design/nav-items-66.psd",
"status": "added",
"additions": 0,
"deletions": 0,
"changes": 0,
"blob_url": "...",
"raw_url": "...",
"contents_url": "..."

File:

"sha": "7946d9aba5839b9586924dd607415c1672139eda",
"filename": "Classes/Repository/RepositoryViewController.swift",
"status": "modified",
"additions": 49,
"deletions": 21,
"changes": 70,
"blob_url": "...",
"raw_url": "...",
"contents_url": "...",
"patch": "..."

https://github.com/rnystrom/GitHawk/blob/master/Classes/Models/File.swift#L34

File model expects a "patch" value, and if it doesn't have it will simply fail to add it. As you can see above, binaries will not have a patch and therefore won't be added.

Must admit I noticed this ages ago, but I assumed it was intentional because we have no way to render binary files yet?

Well dang. The whole way I did this is wrong 馃槤

Some thoughts:

  • This is built w/ IGListKit but repo code browsing is a table view

    • Maybe we can unify and pass in a requester object to the file-list VC (b/c the endpoints are so different)

    • Or we leave them separate and just convert code to use IGListKit

  • Looks like even if we include binary data, there's no way to open it

    • Probably ok for now, but would also love to unify this so that we can open images

Where we currently have the additions/deletions, maybe if that is just replaced in gray to say "BINARY"?

Also if the file is deleted, rather than -100 should it just say "DELETED" in red?

When you tap on a binary we could just take them to another page which will try to load it. Obviously in 99% of the files it'll just display an error saying "We don't support this file type" but for images it'd be nice to just render the new version? (Obviously we can get super advanced down the line with diffing, and supporting other formats)

I'd vote to keep inline and use IGLK where we can!

Well, I am happy to see that it's not actually the API at least 馃槀

I think we should at least display them in the overview, then just not render them in the detail. Basically just like github.com works. Then if we want to support rendering in the future (as said, images would make sense), we can just add this functionality gradually.

@Sherlouk great idea when "deleted", much easier to parse visually. Maybe even for binaries we just load a webview and let GitHub try to handle it? Haha.

I would opt for not showing anything, then creating issues to add support to do so. GitHub doesn't render most of those either, so I think it would only complicate things/confuse users.

I actually quite like the idea of just opening the file in Safari if it's binary, feels like an easy temporary solution that gives the user _something_ if they really want it.

If we have a resource URL, I'd rather add it to the more options (or maybe as a button in the "could not load" message).

Or at least make it / keep it consistent with code browsing in repos.

"Raise a feature request" button 馃馃槀

Sent with GitHawk

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BasThomas picture BasThomas  路  3Comments

rnystrom picture rnystrom  路  3Comments

BasThomas picture BasThomas  路  3Comments

BasThomas picture BasThomas  路  3Comments

rizwankce picture rizwankce  路  3Comments