-
-
Notifications
You must be signed in to change notification settings - Fork 624
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
feat(remote): support include git remote #1652
Conversation
I've tested it and a friend also tested it. I am open to gather feedback on it :) |
@vmaerten Thanks for working on this! This is a very popular request. I will definitely give this a go in the next couple of days. Finally some nice weather in the UK, so I'll be out enjoying the sun as much as possible this weekend! 🌞 It might be worth putting a message on the remote experiment issue so that people who are subscribed over there can try it too. I have updated the OP there to link back here. |
I really enjoy working on Task. Let me know if you have questions regarding my implementation Good idea! I've just done it 🙂 |
@blackjid 's comment :
First of all, thanks for the feedback. Following your propostions, I like the one with the query param representing the filename. In the other hand, if the community already knows the "terraform" format, it could be good to adopt it. Let's discuss with @pd93 and @andreynering |
Hi, I find this work awesome ! Just wanted to mention that I've been able to run this on my side using http over public repo, private repo using token auth and ssh. All behaved as expected. This, added to the remote file feature will definitely help saving a tremendous amount of time sharing and managing taskfiles. I'm really excited to have this available in a few. Thanks for this work. |
Thanks for checking this! |
Any update ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally pretty happy with this. Just one minor comment.
w.r.t @blackjid's comment:
There have been a lot of comments in the past about reusing the go-getter syntax as it seems pretty popular in the Go community. We're not using go-getter right now, but using a compatible syntax would make it easier to transition to it in the future if we wanted to for any reason.
I need to rebase due to recent merged PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @vmaerten !
taskfile/node_git_test.go
Outdated
} | ||
|
||
func TestGitNode_sshWithDir(t *testing.T) { | ||
node, err := NewGitNode("git@github.com:foo/bar.git?ref=main//directory/Taskfile.yml", "", false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but using a compatible syntax would make it easier to transition to it in the future if we wanted to for any reason.
I did't thought about it, that would be a compelling reason to use that syntax.
I don't think this new change syntax is compatible...
git@github.com:foo/bar.git?ref=main//directory/Taskfile.yml
should be
git@github.com:foo/bar.git//directory/Taskfile.yml?ref=main
so ref
is directly mapped to a git refeference, could be a branch or a tag for example.
id's say you'd need to split the url in //
to get the git url at 0
and the filename at 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @vmaerten thanks for all the work on this!
just want to add that with this syntax, the ref query string should be optional, because, it will only reference to a branch or tag, and without it it would be the default branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey!
You're right! I'll work on this :)
What am I doing wrong? $ export TASK_X_REMOTE_TASKFILES=1
$ task --list --taskfile git@github.com/$ORGANIZATION/$REPO?ref=main//taskfile.yml
stat git@github.com/$ORGANIZATION/$REPO?ref=main//taskfile.yml: no such file or directory The following code shows that the org, repo, and file exists ... $ git clone git@github.com:$ORGANIZATION/$REPO.git --branch main && cp $REPO/taskfile.yml . |
EDIT: like you use the URL for git clone : |
@blackjid & @pd93 Following this comment : #1652 (comment) |
ce35f85
to
51a756c
Compare
51a756c
to
cea84c2
Compare
what do you think about this? #1774 |
@blackjid I've merged this one to move forward on this feature Let's talk about go-getter or not, in the remote issue or the PR |
I've work on add the support of Git in the remote experimentation.
I've used the go-git package, which is Git implementation in pure go.
I've also used git-urls to help me to parse all URLs.
Some informations :
I'll work next on perf optimisation. I've in mind to mutualise git clone to avoid cloning multiple times the same repo.
I've added tests. I'll add test of node_http in another PR.
EDIT : The link with to the preview