Skip to content

Support for attachments? #103

Open
Open

Description

@nedbat

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

Activity

  1. jeffwidman commented on May 30, 2018

    @jeffwidman
    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...

  2. nedbat commented on May 31, 2018

    @nedbat
    ContributorAuthor

    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? :(

  3. nedbat commented on May 31, 2018

    @nedbat
    ContributorAuthor

    square_dance

    Is this an attachment?

  4. jeffwidman commented on Jun 1, 2018

    @jeffwidman
    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.

  5. jeffwidman commented on Jun 1, 2018

    @jeffwidman
    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.

  6. nedbat commented on Jun 16, 2018

    @nedbat
    ContributorAuthor

    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.

  7. jeffwidman commented on Jun 25, 2018

    @jeffwidman
    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.

  8. thomthom commented on Jul 9, 2018

    @thomthom

    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.

  9. jeffwidman commented on Jul 10, 2018

    @jeffwidman
    Owner

    paging @nedbat:

    Any ideas why some work and some don't?

  10. nedbat commented on Jul 10, 2018

    @nedbat
    ContributorAuthor

    @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.

  11. thomthom commented on Jul 10, 2018

    @thomthom

    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.

  12. thomthom commented on Jul 10, 2018

    @thomthom

    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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions