dokploy icon indicating copy to clipboard operation
dokploy copied to clipboard

Preview Deployment not deployed correctly in Pull Request from forked repository

Open ihsanhere opened this issue 8 months ago • 3 comments

To Reproduce

  1. Create application
  2. Enable Preview Deployment
  3. Create a Pull Request from one of the forked repository
  4. Visit /etc/dokploy/applications/{{aplication_name_preview}}/code in host machine
  5. Execute git ls-remote --get-url origin

When you follow the steps, in the preview code folder, the remote origin url is not the pull request source repository, but it is the application's repository

Current vs. Expected behavior

Following the steps

Expected Behaviour: When accessing the preview deployment folder (/dokploy/applications/{{application_name_preview}}/code) on the host machine, the repository should reflect the source repository with the pull request (PR).

Current Behavior: Instead of being on the pull request source repository, the repository remains on the application's repository. This prevents the preview deployment from accurately reflecting the PR changes.

Provide environment information

Operating System:
  OS: Debian GNU/Linux 12 (bookworm)
  Arch: x86_64
Dokploy version: v0.21.5
VPS Provider: Hostinger

In Nextjs static export with nixpacks

Which area(s) are affected? (Select all that apply)

Application

Are you deploying the applications where Dokploy is installed or on a remote server?

Remote server

Additional context

No response

Will you send a PR to fix it?

Maybe, need help

ihsanhere avatar Apr 09 '25 17:04 ihsanhere

This is the expected behaviour, currently only repositories that are sourced from the original source will be deployed, this can be an ehancement

Siumauricio avatar Apr 12 '25 08:04 Siumauricio

I think this will be a good improvement.

Do i need to implement this? I could send a pr if needed.

I am new to open source contributions. Could you point me in the right direction

ihsanhere avatar Apr 12 '25 08:04 ihsanhere

Yeah it would be really cool to have this, I am open to receive a PR on this,

an idea would be to check this code which is basically the one that triggers all the previews deployments https://github.com/Dokploy/dokploy/blob/canary/apps/dokploy/pages/api/deploy/github.ts#L205-L308

based on the events there we extract the metadata like the branch repository details, etc.

Siumauricio avatar Apr 12 '25 08:04 Siumauricio