Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: fix Bitbucket preview deployments by switching to PR update events #5028

Closed
wants to merge 4 commits into from

Conversation

IARayan
Copy link
Contributor

@IARayan IARayan commented Feb 1, 2025

Changes

  • Replace repo:push webhook handling with pullrequest:updated event
  • Add validation to only process PR updates that contain new commits
  • Update handled_events collection to remove repo:push and add pullrequest:updated
  • Add early return with 'failed' status for PR updates not related to commits
  • Maintain backwards compatibility by keeping all other PR-related webhook handling

Issues

andrasbacsai and others added 3 commits January 28, 2025 13:48
…y replacing repo:push with pullrequest:updated in bitbucket webhook hander

Bitbucket's repo:push webhook doesn't provide the destination branch name in new commits, 
which prevents Coolify from finding the correct application to update preview deployments. 
By switching to pullrequest:updated and only processing updates due to new commits, 
we can reliably get the correct branch name that matches the Coolify application, 
ensuring preview deployments are properly updated.

- Remove repo:push event handling in favor of pullrequest:updated
- Add check to ignore PR updates not related to new commits
- Update handled_events collection to reflect new webhook strategy

Closes coollabsio#2793
@IARayan IARayan changed the title Patch 1 refactor: fix Bitbucket preview deployments by switching to PR update events Feb 1, 2025
…re the updated is not due to a pullrequest

By introducing the pullrequest:update we are able to handle preview deployments updates for a new commit, however if the commit was done to the branch that matches the application branch directly and not via a pull request it would have failed since repo:push is no longer handled, this change ensures that both cases are handled correctly and Coolify's current state is satisfactory and backward compatible
@IARayan IARayan closed this Feb 1, 2025
@IARayan IARayan deleted the patch-1 branch February 1, 2025 09:56
@IARayan
Copy link
Contributor Author

IARayan commented Feb 1, 2025

Implementation currently lacks a way of determining if the event is fired due to a PR update that was fired due to new commits as we are not story commit hashes at least to compare, looking for a workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants