Unsure if its working as intended
Closed this issue · 4 comments
Hi,
All the steps as mentioned worked for me, however in the end it seems like I have just pushed my local code repo onto github. The commit history shows up- overall it works well!
I'm curious though on what exactly your tool has done in my case? My intent was never to push my code onto github, I only wanted my commit activity on my company's gitlab to be reflected on my personal github. I am sure I'm missing something here, could you kindly shed some light on this?
Thanks
Hello @varunkaarthik,
I'm glad to hear that the steps worked for you.
import-gitlab-commits
creates empty commits in the directory repo.gitlab.yourcompany.com.currentusername
. You could open this directory in git
tool and make sure on your own. That's an emulation of your work on the company's GitLab. No real code was pushed.
Hi @alexandear,
I pushed from my actual local code repo instead of the repo that import-gitlab-commits creates- my bad.
I tried it out from a GitLab repo which has GITLAB_BASE_URL = https://gitlab.com/ - this works perfectly, as described. However, my org GitLab has a longer URL with its name appended, for example: https://gitlab.xxx.yyy.zzz.de/. I have followed the same steps as before, it even recognises my repo under my name, but it exits immediately after without fetching the projects or commits.
Not sure what the problem is. Nevertheless, thanks a lot- it worked flawlessly for my other repos!
Hi @alexandear,
I tried a few more times via my org's GitLab. I'm starting to think it might be down to some security barrier. Is there a workaround for this?
Thanks
Hi @varunkaarthik,
Retrieving commits via GitLab's API is a core functionality of import-gitlab-commits
. If for some reason GitLab auth is not working I can't help, unfortunately.
The app uses https://github.com/xanzy/go-gitlab library for retrieving data from a GitLab. You could try to execute the simple Go program to get the current user in org's GitLab:
import (
"fmt"
"github.com/xanzy/go-gitlab"
)
func main() {
git, err := gitlab.NewClient("yourtokengoeshere")
if err != nil {
log.Fatalf("Failed to create client: %v", err)
}
user, _ := gitlab.Users.CurrentUser()
fmt.Printf("%v", user)
}
If the program finishes successfully then the connection to your organization's GitLab is OK. And the problem is in the import-gitlab-commits
app.