Open randarnold opened 6 years ago
Can you please do a keybase log send
and we can take a look at exactly what refspec is being passed in. I'm not familiar with gitpoller.
Done, log id 8d1d77bc8d927929f207e11c
The problem seems to be that the git remote name you've assigned to the keybase git URL is the actual URL itself, i.e., "keybase://team/spotlightlabs.git/spotlight-ios". Remote names are usually just letters/numbers, like "origin" or "keybase". Again, I'm not sure about GitPoller, but if you're on the command line, usually you would set a remote name like this:
git remote add keybase keybase://team/spotlightlabs.git/spotlight-ios
And then you can just refer to "keybase" as the remote name.
Thank you, I'll give that a shot
OK, I've learned a lot, but not enough... buildbot is a CI built in Python, gitpoller.py looks for changes on the repository. https://github.com/buildbot/buildbot/blob/master/master/buildbot/changes/gitpoller.py
GitPoller takes as arguments a reprourl and branches http://docs.buildbot.net/current/manual/cfg-changesources.html#gitpoller
It does nothing with remotes, rather builds a git fetch command with the url and refspecs
This works with a github url, but not with a keybase url (keybase url does work from the cmd line, although not with the generated refspec)
github: '+develop:refs/buildbot/git%40github.com%3ASpotlightMediaLabs%2FSpotlight.git/develop' keybase: '+develop:refs/buildbot/keybase%3A%2F%2Fteam%2Fspotlightlabs.git%2Fspotlight-ios/develop'
github is happy as a clam, keybase returns code 128 git-remote-keybase error: (1) malformed refspec, separators are wrong
obviously my previous guess about the escapes is not the problem (with no escapes everything fails)
I tried keybase::keybase://… that did not work either
I couldn't find the generated error in the source of git-remote-keybase, so I don't who actually generates that error.
Any other thoughts, I'm game :-)
The error is coming from here, in the go-git
library we use: https://github.com/keybase/kbfs/blob/eecab64a434e2f6a017e69659ef11e3545b4fbe8/vendor/gopkg.in/src-d/go-git.v4/config/refspec.go#L35
I guess it doesn't like there being more than one ":" character in the refspec (i.e., the one after "develop", and the %3A
after "keybase" in your refspec above). It seems this is a correct restriction to me. On the command line, this gives an error:
$ git remote add git@github:keybase/test.git keybase://private/strib/test
fatal: 'git@github:keybase/test.git' is not a valid remote name
$ git checkout -b keybase://private/strib/test
fatal: 'keybase://private/strib/test' is not a valid branch name.
I would guess that whatever git server your build bot is running incorrectly allows colons in branch names, but our strict checks in git-remote-keybase
correctly prevent this on the client side. I'm not 100% sure though.
Ok, I think I see the error here…
From git-scm.com
The format of a
parameter is an optional plus +, followed by the source , followed by a colon :, followed by the destination ref . The colon can be omitted when is empty. is typically a ref, but it can also be a fully spelled hex object name.
Not sure what the point of the option plus + is, but after the
breaking down my example '+develop:refs/buildbot/keybase://team/spotlightlabs.git/spotlight-ios/develop' +
Is there any progress on this? This issue also prevents Jenkins pipelines from being able to build projects hosted in a keybase repo, which is a real bummer.
Here's the error I get in Jenkins:
> git fetch --no-tags --force --progress keybase://team/bbmsoft_net.jam/jam +refs/heads/*:refs/remotes/origin/*
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from keybase://team/bbmsoft_net.jam/jam
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:894)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1161)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1192)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:124)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:93)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:80)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: hudson.plugins.git.GitException: Command "git fetch --no-tags --force --progress keybase://team/bbmsoft_net.jam/jam +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr: Initializing Keybase... done.
Syncing with Keybase... done.
git-remote-keybase error: (1) malformed refspec, separators are wrong
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2099)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1791)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$400(CliGitAPIImpl.java:79)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:472)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:892)
... 11 more
As far as I can tell, the fetch command is perfectly valid ('git fetch --help' explicitly states that fetch is supposed to work on both named repos and raw URLs).
I'm trying to see if I can get keybase git working with buildbot
When the GitPoller is invoked I get the following error
2018-03-21 18:39:00-0700 [-] command fetch ['keybase://team/spotlightlabs.git/spotlight-ios', '+bb-test:refs/buildbot/keybase%3A%2F%2Fteam%2Fspotlightlabs.git%2Fspotlight-ios/bb-test', '+develop:refs/buildbot/keybase%3A%2F%2Fteam%2Fspotlightlabs.git%2Fspotlight-ios/develop', '+master:refs/buildbot/keybase%3A%2F%2Fteam%2Fspotlightlabs.git%2Fspotlight-ios/master'] in /Volumes/buildbot/buildmaster/gitpoller-work on repourl keybase://team/spotlightlabs.git/spotlight-ios failed with exit code 128: Initializing Keybase... done. Syncing with Keybase... done. git-remote-keybase error: (1) malformed refspec, separators are wrong
My guess is that the escapes are a problem?
macOS 10.13.3, buildbot 1.1, keybase 1.0.45