wemakecustom / gitlab-composer

Gitlab Composer repository
163 stars 44 forks source link

Repository/project name must match vendor/package name #30

Closed jorygeerts closed 6 years ago

jorygeerts commented 6 years ago

First of all, I really like this project. :)

I'm having one issue though: with the current code, the group/project must match vendor/package, otherwise libraries are not added to the generated package list.

Since I have to deal with a bunch of packages who's vendor name is not a 1:1 match with the group name in GitLab, that means I cannot use this project as-is. I've got a rough implementation ready that does work, by using the name from composer.json in the default_branch as package name, My current implementation is not optimal ($fetch_ref is executed twice for the default_branch of every project) yet, but I wanted to ensure it worked first.

If you guys are interested, I can whip up a PR with my changes (after getting rid of that double $fetch_ref call, obviously) - while most people probably won't have this problem, composer doesn't require that group/project is alwasy the same as vendor/package, so supporting such a setup doesn't sound like a terrible idea.

lemoinem commented 6 years ago

Hi,

Thanks for your idea and offer. This sounds like a nice feature, especially if there is a need for it.

As mentioned in the README, requiring the match is to avoid copy-paste errors. Because of this, I would prefer to have this feature as a configuration rather than a behavior change.

The default value would be the current behavior, but a configuration would allow the mismatch between group/project and vendor/package.

If you feel like this is reasonable, I'll be waiting for your PR.

jorygeerts commented 6 years ago

Sure that sounds reasonable enough. Do you have a preference about how and where you want this configuration? Naming is allow_package_name_mismatch in confs/gitlab.ini seems to make sense.

lemoinem commented 6 years ago

Sounds good to me! 👍