Dokploy / dokploy

Open Source Alternative to Vercel, Netlify and Heroku.
https://dokploy.com/
Other
9.31k stars 459 forks source link

Dokploy projects seem to be linked together in special cases #690

Open mezotv opened 1 week ago

mezotv commented 1 week ago

To Reproduce

  1. Create 2 projects which a github repo each (in my case both are)
  2. Enable auto deploy
  3. Push to git repo of project 2

Current vs. Expected behavior

Currently project 1 will get the commit first and then rebuild for no reason even tho nothing was pushed to its repo. After thats done project 2 will get the commit and start rebuilding.

I also had this happen where I triggered a rebuild on project 2 dokploy started rebuilding project 1 first.

Provide environment information

Dokploy: 0.10.10 (might happen on newest too)

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

Application

Additional context

Discord conversation: https://canary.discord.com/channels/1234073262418563112/1234073263584575511/1305245920585187438

Siumauricio commented 1 week ago

Looks like this happen when you have for example the same repository and branch name in different organization, i think we need to filter the webhook by another property maybe

mezotv commented 1 week ago

Looks like this happen when you have for example the same repository and branch name in different organization, i think we need to filter the webhook by another property maybe

Where is the code for the current webhooks located? I can try to take a look.

Siumauricio commented 1 week ago

the issue is here, if you have both repositories names and branch it will deploy both

https://github.com/Dokploy/dokploy/blob/canary/apps/dokploy/pages/api/deploy/github.ts#L67

mezotv commented 1 week ago

the issue is here, if you have both repositories names and branch it will deploy both

https://github.com/Dokploy/dokploy/blob/canary/apps/dokploy/pages/api/deploy/github.ts#L67

Apperently there seems to be a repository id in the meta tags somewhere maybe you can also fetch that using the api and assign to the project. For example this repos id is 788847937. They should be unique!

Siumauricio commented 9 hours ago

Yes, although I think this problem would not happen only in github provider, but in all providers, if you have the same name of the repo/branch will do the same.