bakerkretzmar / laravel-deploy-preview

A GitHub Action to deploy PR preview sites for Laravel apps.
MIT License
19 stars 6 forks source link

Ensure Site is deleted #36

Closed naciriii closed 3 months ago

naciriii commented 4 months ago

closes #35

Summary

Currently when deleting preview on pr close, sometimes the site is not fully deleted and on forge level it's no longer showing up under server sites, but on top nav it's still showing up and not fully deleted, which if pr is closed and reopened again will throws site already error and it won't be possible to preview deployments again.

I haven't properly tested same behavior with database, It may be possible that is reproduced

In order to ensure site is fully deleted I Added a condition that refetch the site until it throws 404 where the error is caught and the status is set to null, otherwise the site status is on removing so it'll just wait until it's fully removed.

Steps to reproduce the issue

naciriii commented 4 months ago

@bakerkretzmar ping

bakerkretzmar commented 4 months ago

Going to reach out to Forge support, if deleting the site via their API works correctly this shouldn't be necessary.

naciriii commented 4 months ago

Going to reach out to Forge support, if deleting the site via their API works correctly this shouldn't be necessary.

Indeed it works when i tested with direct api call, i assume that the delete process runs during the request and it happens that as soon as the request times out/closes (maybe due to github actions or axios default config) the delete process in forge is not fully done

bakerkretzmar commented 3 months ago

This should be fixed by 392dba4ff4e1dc8019011b5724b8f55368ef120f (available in v2.5.0). The underlying issue with Forge is still present and the Forge team is still investigating. It's not the request timing out, it's making the deletion request before the scheduler has been fully uninstalled.