pulumi / pulumi-cloud-requests

Welcome to the public issue tracker for Pulumi Cloud (app.pulumi.com)! Feature requests and bug reports welcome!
10 stars 4 forks source link

[Deployments] Re-running failed PR check results in `pulumi up` instead of just `pulumi preview` #384

Closed MitchellGerdisch closed 3 months ago

MitchellGerdisch commented 5 months ago

Expected behavior

When using Pulumi Deployments with github integration, when I create a PR to a branch that is associated with a given stack deployment, then it is expected that a "pulumi update" only runs onces that PR is merged.

Current behavior

By running re-run check in Github for a failed PR-pulumi-preview, Pulumi Deployments runs it as if a "Github Push" occurred and thus runs a pulumi update.

Steps to reproduce

  1. Set up a github deployment configuration for a stack. I had a dev stack connected to the main branch of it's repo.
  2. I tested this by pushing a change directly to main to confirm Pulumi Deployments ran an update on the dev stack.
  3. Create a new branch.
  4. Make a change on that branch that will fail a preview. I added a non-existent environment to my Pulumi.dev.yaml.
  5. Create a PR to merge that branch to the main branch.
  6. This will correctly trigger a Deployment to run a pulumi preview
  7. The preview will fail.
  8. In Github, go to the PR and click on "Details" link for the failed check.
  9. Click on the "re-run" link under "Pulumi"
  10. Go to Pulumi Cloud and see that a Deployment is triggered but it sees the trigger as a Github Push and thus wants to run a pulumi update instead of a pulumi preview

Context (Environment)

Although, the assumption is that all re-runs of Deployments would be via github updates and not by clicking "re-run" in Github itself, it is not a guarantee and we should react to this case correctly.

Affected feature

komalali commented 4 months ago

We addressed handling of the re-run check recently, https://github.com/pulumi/pulumi-cloud-requests/issues/340 - might be we introduced a bug there.