danger / danger

🚫 Stop saying "you forgot to …" in code review (in Ruby)
https://danger.systems
MIT License
5.44k stars 480 forks source link

Use PROJECT_ID instead of PROJECT_PATH in Gitlab urls #1478

Open simonfelding opened 8 months ago

simonfelding commented 8 months ago

This PR fixes a bug where danger would not work with (some?) self-hosted instances.

Before this patch, I got a 404 from our self-hosted Gitlab CE API. Now it works as expected.

It also fixes issues like https://github.com/danger/danger/issues/968 because the problem is deriving a valid URL for the project. Since PROJECT_ID is unique on a gitlab instance, you can always just use that instead of the PROJECT_PATH.

I tested this and it works. I'm not sure how to run tests in ruby locally, so CI will probably fail.

simonfelding commented 8 months ago

I have the same patch ready for danger-js, if this one is acceptable.

lexispike commented 3 months ago

Any updates on this change? I'm experiencing this same issue right now while trying to setup DangerJS on a self-hosted Gitlab Instance!