bakerkretzmar / laravel-deploy-preview

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

Site not deleted after PR close #35

Closed naciriii closed 3 months ago

naciriii commented 4 months ago

Problem

After closing pr the site is not fully deleted, When you look on forge under servers you will not find the site there , but when you click on site from the top nav menu sites you are still able to see the site under your server and it's still accessible The problem is when you close the pull request and reopen again the creation of the site will fail with error message that it already exists. I found out that if you rerun the job for the closed pr the site will be deleted completely , I'm not sure if the problem is within forge api or the current action

bakerkretzmar commented 4 months ago

Damn, thanks a lot for pointing this out. This mus be related to #34 as well. I think it's a Forge issue, I'll reach out to them.

bakerkretzmar commented 4 months ago

@naciriii what server provider were you using here?

naciriii commented 4 months ago

@naciriii what server provider were you using here?

Aws, jfyi when i use the api with curl or postman the site is deleted with no issues that's why i pointed to timeout or request shuting down fast with axios in the action code

bakerkretzmar commented 4 months ago

Thanks. Yeah that makes sense, I'm not seeing this issue using other API clients either but I want to see if I can figure out what's actually happening first. I know the request is making it through because the site gets partially deleted, and as far as I know once that happens any later errors or timeouts shouldn't matter because the site should still be deleted.

naciriii commented 4 months ago

Thanks. Yeah that makes sense, I'm not seeing this issue using other API clients either but I want to see if I can figure out what's actually happening first. I know the request is making it through because the site gets partially deleted, and as far as I know once that happens any later errors or timeouts shouldn't matter because the site should still be deleted.

I can tell that the site was not deleted from ec2 also , My guess is that deleting would take a couple of minutes and I assume on forge side there's a job doing the process and notifies when finish(deleting event on delete), I thought It'd be similar code to what you did with repo install:

async installRepository(repository: string, branch: string) {
    await Forge.createGitProject(this.server_id, this.id, repository, branch);
    // TODO error handling here could throw if this goes back to `null` after 'installing',
    // because that probably means it failed
    await until(
      () => this.repository_status !== 'installing',
      async () => this.refetch(),
      3,
    );
  }
naciriii commented 3 months ago

@bakerkretzmar anything new regarding this issue?

bakerkretzmar commented 3 months ago

Nope, as of this morning Forge support is still looking into it. They've fixed the issue where sites in the removing state are still visible in parts of the UI, but not the underlying issue where they get stuck in removing.

bakerkretzmar commented 3 months ago

Fix with a workaround in 392dba4ff4e1dc8019011b5724b8f55368ef120f. The underlying issue in Forge is not fixed, I'll update again when I hear back.