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

Support for attachments? #103

Open
nedbat opened this issue May 28, 2018 · 12 comments
Open

Support for attachments? #103

nedbat opened this issue May 28, 2018 · 12 comments

Comments

@nedbat
Copy link
Contributor

nedbat commented May 28, 2018

I haven't looked into this at all, but would it be possible to migrate attachments also?

@jeffwidman
Copy link
Owner

I don't think GitHub supports attachments.

IIRC, that was why iTerm uses GitLab for issue tracking, even though the project uses GitHub for code management.

Happy to re-open and explore this if I'm wrong...

@nedbat
Copy link
Contributor Author

nedbat commented May 31, 2018

Hmmm, you can attach files in the UI (https://help.github.com/articles/file-attachments-on-issues-and-pull-requests/), but not in the API? Can that really be? :(

@nedbat
Copy link
Contributor Author

nedbat commented May 31, 2018

square_dance

Is this an attachment?

@jeffwidman jeffwidman reopened this Jun 1, 2018
@jeffwidman
Copy link
Owner

Indeed attachments are supported now. My bad, I should have googled. And that specific attachment is a visual trip. 😄

On the API side, I'm betting GitHub hasn't added it to their kinda-secret Bulk Import API which is what we use to avoid rate-limiting. But I'm not sure, so I've emailed their support and cc'd @nedbat.

@jeffwidman
Copy link
Owner

Answer from GitHub support (copy/pasted with their permission):

Hi there Jeff,

Thanks for getting in touch! It isn't currently possible to upload images through the GitHub API the same way you could drag-and-drop an image from your desktop to an Issue Comment box.

If you're interested in a workaround, you could use either the Repo Contents API (high-level API) or the Git Data API (low-level API) to commit images (or other content) to a Git repository:

https://developer.github.com/v3/repos/contents/#create-a-file

https://developer.github.com/v3/git/

Once the image is created, you can create an Issue using the Issues API and link to the images (or other content) you've committed to the repository or add a Markdown inline image link to the contents:

![image](URL_TO_IMAGE)
Hope that helps! Feel free to let us know if you have any other questions.

@nedbat
Copy link
Contributor Author

nedbat commented Jun 16, 2018

Hmmm, I played around with getting attachments. I figured I could at least add a link to the GitHub issue, that refers to the attachment on Bitbucket. But the Bitbucket api doesn't provide the URL to the attachment on the issue, and the URL doesn't seem easily constructable. I can get the content of the attachments, but I'm not sure where I would put them.

@jeffwidman
Copy link
Owner

Partially addressed by @nedbat in b2dfda9

Closing, as I think this is probably as good as we'll get with the current GitHub/Bitbucket APIs... very open to future improvements. And thanks again @nedbat for figuring out at least something here.

@thomthom
Copy link

thomthom commented Jul 9, 2018

I just tested this on a repo I have: https://bitbucket.org/thomthom/solid-inspector/src

For some issues the attachments appear to have transferred:

image

image

But for others it did not:

image

image

Any ideas why some work and some don't?
Only thing I see is that the ones that work appear to have images embedded into the text. But the ones that doesn't the attachments are missing.

From the commit referenced above, it appear that "This issue had attachments:" should appear while processing attachments. No such message was seen in my console.

@jeffwidman
Copy link
Owner

paging @nedbat:

Any ideas why some work and some don't?

@jeffwidman jeffwidman reopened this Jul 10, 2018
@nedbat
Copy link
Contributor Author

nedbat commented Jul 10, 2018

@thomthom I think you see the difference ("images embedded into the text"). Markdown can have an image reference. In that case, the text is simply copied over to GitHub, which also renders the image. In this case, there is no attachment, just markup indicating an image.

Images which are attached are true attachments. How did you run the converter? Did you use --mention-attachments? If not, the attachments are ignored.

@thomthom
Copy link

Ah, I didn't use that flag. Didn't realize it was there. I was only referring to the list in the README in master.

I will give it another whirl.

@thomthom
Copy link

I ran it again, but it still didn't pick up my attachments.

λ python migrate.py thomthom/solid-inspector thomthom/solid-inspector thomthom --mention-attachments
Please enter your GitHub password.
Note: If your GitHub account has authentication enabled, you must use a personal access token from https://github.com/settings/tokens in place of a password for this script.

getting issues from bitbucket
done, loaded 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/1
Completed 1 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/2
Completed 2 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/3
Completed 3 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/4
Completed 4 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/5
Completed 5 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/6
Completed 6 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/7
Completed 7 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/8
Completed 8 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/9
Completed 9 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/10
Completed 10 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/11
Completed 11 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/12
Completed 12 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/13
Completed 13 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/14
Completed 14 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/15
Completed 15 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/16
Completed 16 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/17
Completed 17 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/18
Completed 18 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/19
Completed 19 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/20
Completed 20 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/21
Completed 21 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/22
Completed 22 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/23
Completed 23 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/24
Completed 24 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/25
Completed 25 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/26
Completed 26 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/27
Completed 27 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/28
Completed 28 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/29
Completed 29 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/30
Completed 30 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/31
Completed 31 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/32
Completed 32 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/33
Completed 33 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/34
Completed 34 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/35
Completed 35 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/36
Completed 36 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/37
Completed 37 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/38
Completed 38 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/39
Completed 39 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/40
Completed 40 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/41
Completed 41 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/42
Completed 42 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/43
Completed 43 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/44
Completed 44 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/45
Completed 45 of 46 issues
Imported Issue: https://api.github.com/repos/thomthom/solid-inspector/issues/46
Completed 46 of 46 issues

Example:
https://bitbucket.org/thomthom/solid-inspector/issues/40
thomthom/solid-inspector#40

Any ideas?

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

3 participants