uselagoon / lagoon

Lagoon, the developer-focused application delivery platform
https://docs.lagoon.sh/
Apache License 2.0
555 stars 148 forks source link

Allow deploys to happen on PRs created from forked repository #2752

Closed anthony-malkoun closed 1 year ago

anthony-malkoun commented 3 years ago

Use Case

https://github.com/dpc-sdp/ripple is an open source repository. As an open source repo third parties are contributing changes back our repo that we want to test against a Lagoon environment.

Issue

Normally PRs against the repository create Lagoon environments as expected and are used for testing. We would like this to happen for PRs created from a forked repository as well. Currently a PR created from a forked repo has the following log message.

[2021-07-06 05:22:38] [info]: Handling github:pull_request:opened for project ripple 
[2021-07-06 05:22:38] [info]: lagoon-logs: Send to lagoon-logs: *[ripple]* PR 992 opened. No deploy task created, reason: Head/Base not same repo

Is this something that can be changed or enabled easily?

rocketeerbkw commented 3 years ago

Is this something that can be changed or enabled easily?

This is not a feature that's supported, so it can't be "turned on" easily. Lagoon needs access to the git repo to build the images and there isn't any guarantee that it will have permission to do a checkout from a repo that's not configured in the Lagoon project.

Supporting this would potentially allow any random user to create environments which directly impacts billing. Imagine checking in a 100GB file and opening 10 PRs, exhausting dev environments and disk space.

Maybe we could put this behind a flag, add some docs/warnings and accept that elevated build errors are a possibility?

seanhamlin commented 3 years ago

To add to @rocketeerbkw's point. Just allowing forked repo PRs as is would be a bad idea. We would need to have more guard rails in Lagoon:

There are also cost implications to be aware of.

You always can add the forked git repo as it's own Lagoon project, this has several benefits:

tobybellwood commented 1 year ago

not planning to implement anything for forked repos