GitSavvy icon indicating copy to clipboard operation
GitSavvy copied to clipboard

GitLab support

Open divmain opened this issue 9 years ago • 10 comments
trafficstars

Work will occur in gitlab-support branch and can be tracked in #363 until it is merged. The target feature-set for landing GitLab support in GitSavvy is as follows:

  • [x] support private GitLab servers
  • [ ] issue number completion (with summary text in drop-down) in commit view
  • [ ] collaborator completion (with names drop-down) in commit view
  • [x] gitlab: open file on remote with current line(s) highlighted
  • [x] gitlab: open issues
  • [x] gitlab: open project
  • [ ] gitlab: clone existing project
    • query the project API for existing projects
    • once a selection is made, prompt user for location of clone
    • do appropriate git: clone incantation
  • [ ] gitlab: add SSH key
    • search $HOME/.ssh/*.pub for any existing keys
    • if found, prompt user to accept one of the discovered keys (additional option will allow user to paste in key)
    • submit SSH key to GitLab
  • [ ] gitlab: create merge request, which opens the link in browser.
  • [x] gitlab: review merge request, which displays a list of open merge requests. Once a MR is selected, the user can select from:
    • [ ] Checkout as detached HEAD.
    • [ ] Checkout as local branch.
    • [ ] Create local branch, but do not checkout.
    • [ ] View diff.
    • [ ] Set as in-progress. so the MR can't be merged.
    • [ ] Open in browser.
  • [x] gitlab: set remote for integration
  • [ ] gitlab: add fork as remote
  • [ ] gitlab: protect branch on remote (link)
  • [ ] gitlab: unprotect branch on remote
  • [ ] gitlab: builds, which displays a list of project builds (link). Once a build is selected, the user can select from:
    • [ ] Cancel build.
    • [ ] Retry build.
    • [ ] Erase build.
    • [ ] Download artifacts. (opens URL in browser)
  • [ ] Toggle to enable/disable GitLab (and GitHub) command palette options, for those that use only one or the other.

Supersedes GitLab portion of #40.

divmain avatar Mar 03 '16 08:03 divmain

Just wanted to mention that github: open file on remote already works for gitlab! Although jump to line works with hash #L70-70 and NOT with #L70-L70 as in github. I, personally, would love to see these implemented: gitlab: protect branch on remote (link) and gitlab: unprotect branch on remote

asfaltboy avatar Mar 21 '16 15:03 asfaltboy

I would also love to see gitlab: open commit ofc usable while in commit view. For quick code review and link pasting

asfaltboy avatar Jun 10 '16 14:06 asfaltboy

@asfaltboy, can you clarify what gitlab: open commit should do? Once you do so, I'll add it to the list above.

divmain avatar Jun 28 '16 08:06 divmain

What I was thinking is given a commit hash, such as when using context key in git log / graph, open the remote url of the commit on the server. For example, if I have gitlab-ce checked out, and I see in the history commit c9a46263336dd38aef90b71995e2790be72d441d, I would be able to navigate to the commit view in the Gitlab UI. This page is useful for code reviewing and further navigation.

asfaltboy avatar Jun 28 '16 08:06 asfaltboy

Is this dead? Would love to see gitlab integration! If you need help, let me know.

subutux avatar Oct 29 '16 22:10 subutux

Hey @subutux! This issue is definitely not dead, just de-prioritized. I'm not using GitLab in my day-to-day, so there aren't any personal points of friction to motivate work on this :)

Two things you could do to help if you're interested:

  1. Go ahead and add the functionality. You could even open a WIP PR and get some feedback as you go, if that'd be helpful. The idea here would be that you'd mimic the same patterns and abstractions we're using for GitHub integration in a separate module. Ideally, a number of these things will relate directly to existing GH features.
  2. Do research on the specific API calls that'll be needed for all of these features. This would be less of an investment, but would provide a really solid base that I could use to knock these features out when I have a free evening. If this is more up you alley, feel free to document here in the issue.

divmain avatar Oct 31 '16 04:10 divmain

gitlab: review merge request

Traceback (most recent call last):
  File "C:\Users\User\AppData\Roaming\Sublime Text\Installed Packages\GitSavvy.sublime-package\gitlab/commands/merge_request.py", line 44, in run_async
  File "C:\Users\User\AppData\Roaming\Sublime Text\Installed Packages\GitSavvy.sublime-package\core/ui_mixins/quick_panel.py", line 346, in show_paginated_panel
  File "C:\Users\User\AppData\Roaming\Sublime Text\Installed Packages\GitSavvy.sublime-package\core/ui_mixins/quick_panel.py", line 426, in show
  File "C:\Users\User\AppData\Roaming\Sublime Text\Installed Packages\GitSavvy.sublime-package\core/ui_mixins/quick_panel.py", line 406, in load_next_batch
  File "C:\Users\User\AppData\Roaming\Sublime Text\Installed Packages\GitSavvy.sublime-package\core/ui_mixins/quick_panel.py", line 398, in <genexpr>
  File "C:\Users\User\AppData\Roaming\Sublime Text\Installed Packages\GitSavvy.sublime-package\gitlab/gitlab.py", line 220, in iteratively_query_gitlab
  File "C:\Users\User\AppData\Roaming\Sublime Text\Installed Packages\GitSavvy.sublime-package\common/interwebs.py", line 43, in request
  File "./python3.3/http/client.py", line 1065, in request
  File "./python3.3/http/client.py", line 1103, in _send_request
  File "./python3.3/http/client.py", line 1061, in endheaders
  File "./python3.3/http/client.py", line 906, in _send_output
  File "./python3.3/http/client.py", line 844, in send
  File "./python3.3/http/client.py", line 1198, in connect
  File "./python3.3/socket.py", line 417, in create_connection
socket.gaierror: [Errno 11001] getaddrinfo failed

mercurykd avatar Jun 28 '22 07:06 mercurykd

But a socket.gaierror: [Errno 11001] getaddrinfo failed is, your internet is down, you're behind a proxy https://stackoverflow.com/questions/7334199/getaddrinfo-failed-what-does-that-mean

kaste avatar Jun 28 '22 07:06 kaste

I do not use a proxy in the system

>>> socket.getaddrinfo('https://gitlab.com', 8080)
Traceback (most recent call last):
  File "__main__", line 1, in <module>
  File "./python3.8/socket.py", line 918, in getaddrinfo
socket.gaierror: [Errno 11001] getaddrinfo failed
>>> socket.getaddrinfo('gitlab.com', 8080)
[(<AddressFamily.AF_INET: 2>, 0, 0, '', ('172.65.251.78', 8080))]

mercurykd avatar Jun 28 '22 07:06 mercurykd

Ah, I see, not obvious why we would parse the url wrong and leave the "https://" on it here. Happy to see a PR from you.

kaste avatar Jun 28 '22 09:06 kaste