tea pr checkout: fetch via ssh if available #192

Merged
6543 merged 10 commits from noerw/tea:issue-190 into master 2020-11-07 07:00:03 +00:00
Member
fixes #190 ~~blocked by https://github.com/go-git/go-git/issues/173~~
noerw added 1 commit 2020-09-19 08:39:10 +00:00
use SSH if user has key in gitea
All checks were successful
continuous-integration/drone/pr Build is passing
9896133a0e
6543 added the
kind
feature
status/wip
labels 2020-09-19 11:38:05 +00:00
6543 added this to the v0.6.0 milestone 2020-09-19 11:38:17 +00:00
noerw added
status/blocked
kind
enhancement
and removed
kind
feature
labels 2020-09-30 06:58:26 +00:00
noerw added 3 commits 2020-10-05 11:09:22 +00:00
work around go-git limitation
As we cant manage multiple remote URLs properly, we just set the correct
URL protocol ahead of time.

This logic won't apply for already existing HTTPS remotes, these
should be deleted before using `tea pr checkout`.
13bad2223c
refactor pulls checkout
isolated "gitea API to local git cfg" aspect
All checks were successful
continuous-integration/drone/pr Build is passing
f0f34da41b
noerw added
status/needs-reviews
and removed
status/wip
status/blocked
labels 2020-10-05 11:11:06 +00:00
noerw changed title from WIP: `tea pr checkout`: fetch via ssh if available to `tea pr checkout`: fetch via ssh if available 2020-10-05 11:11:15 +00:00
Author
Member

This one is ready now.

The upstream blocker didn't look like it will be adressed anytime soon, so I implemented a workaround:

When user has configured SSH keys in their gitea account, we will configure the remote in the local repo with the SSH URI.This only applies to new remotes, so already configured HTTPS remotes need to be deleted before running tea pr checkout

This one is ready now. The upstream blocker didn't look like it will be adressed anytime soon, so I implemented a workaround: When user has configured SSH keys in their gitea account, we will configure the remote in the local repo with the SSH URI.This only applies to new remotes, so already configured HTTPS remotes need to be deleted before running `tea pr checkout`
6543 reviewed 2020-10-05 12:24:40 +00:00
Dismissed
@ -8,6 +8,7 @@ import (
"fmt"
"log"
"code.gitea.io/sdk/gitea"
Owner

import format :)

import format :)
noerw marked this conversation as resolved
noerw added 1 commit 2020-10-05 13:50:30 +00:00
reorder imports
All checks were successful
continuous-integration/drone/pr Build is passing
47fbecec40
noerw added 1 commit 2020-10-05 14:02:35 +00:00
Merge branch 'master' into issue-190
All checks were successful
continuous-integration/drone/pr Build is passing
2f4fff6648
noerw added 1 commit 2020-10-05 14:50:41 +00:00
try to use local branch before creating pulls/<PR>
useful for checking out your own PRs
All checks were successful
continuous-integration/drone/pr Build is passing
0bef0385f6
noerw added 1 commit 2020-10-06 10:49:38 +00:00
improved logging
All checks were successful
continuous-integration/drone/pr Build is passing
6d850c5ae0
Owner

Showld we add aa config option witch decide what to use?

Showld we add aa config option witch decide what to use?
Author
Member

@6543 you mean instead of checking for SSH keys via API? I think using this check is a very good indicator of how the user wants to fetch, and is much lower friction than making them set a config option.

Now that I think about it, user may use tea on a device that has no privkey locally, while having a pubkey in gitea. In that case it would make sense to have an option to override the automatic behaviour.

@6543 you mean instead of checking for SSH keys via API? I think using this check is a very good indicator of how the user wants to fetch, and is much lower friction than making them set a config option. Now that I think about it, user may use tea on a device that has no privkey locally, while having a pubkey in gitea. In that case it would make sense to have an option to override the automatic behaviour.
Owner

@noerw I think we should add a optional conf ... and user your func by default :)

@noerw I think we should add a optional conf ... and user your func by default :)
Owner

@noerw pleace update this branch :=)

@noerw pleace update this branch :=)
noerw added 1 commit 2020-10-24 12:22:25 +00:00
Merge branch 'master' into issue-190
Some checks are pending
continuous-integration/drone/pr Build is pending
d8eefb3c2a
lunny added 1 commit 2020-11-04 05:17:33 +00:00
Merge branch 'master' into issue-190
All checks were successful
continuous-integration/drone/pr Build is passing
2ba82a1634
6543 approved these changes 2020-11-04 12:43:14 +00:00
Dismissed
lunny approved these changes 2020-11-07 05:13:53 +00:00
Dismissed
6543 removed the
status/needs-reviews
label 2020-11-07 06:59:37 +00:00
6543 merged commit 355fd7aa53 into master 2020-11-07 07:00:03 +00:00
Sign in to join this conversation.
No description provided.