ezbz / gitlabber

Gitlabber - clones or pulls entire groups tree from gitlab
MIT License
472 stars 78 forks source link

Shouldn't retrieve moved projects #69

Closed Crocmagnon closed 3 years ago

Crocmagnon commented 3 years ago
$ gitlabber -p -i "/mygroup/**" -a exclude
root [https://git.example.com]
└── mygroup [/mygroup]
    ├── valid1 [/mygroup/valid1]
    ├── non-existant [/mygroup/non-existant]
    ├── valid2 [/mygroup/valid2]
    └── valid3 [/mygroup/valid3]

I'm pretty sure that this project was here before but has since been moved elsewhere. When cloning, the project is cloned with a remote matching its new location.

Expected behavior: The non-existant project shouldn't be retrieved.

ezbz commented 3 years ago

Gitlabber doesn't maintain local state and doesn't support project movements on the server, is this the situation you are referring to? If you move a project it's your responsibility to remove it from the local tree in the old location and it will be cloned in the new location, this is documented in the limitations section

Crocmagnon commented 3 years ago

is this the situation you are referring to?

Not quite. Here's basically what I did:

  1. Create a project in a gitlab group
  2. Move the project to another, unrelated group
  3. Run gitlabber for the first time

Gitlabber retrieves the phantom project.

ezbz commented 3 years ago

So the project is in fact being returned by the projects API, perhaps the old path is now archived and you need to exclude it from the results?

Crocmagnon commented 3 years ago

I don’t have access to my computer now but yeah it’s probably being returned by the api since that’s what you’re based on. I’ll check if the raw api returns it.

The project hasn’t been archived, it has however been moved to another group (to which I have access).

I’ll report it on the relevant project (python-gitlab or gitlab directly), thanks !

Crocmagnon commented 3 years ago

I can confirm it's being returned by Gitlab's API. Strangely I can't reproduce it on a new project 😕