aws-amplify / amplify-hosting

AWS Amplify Hosting provides a Git-based workflow for deploying and hosting fullstack serverless web applications.
https://aws.amazon.com/amplify/hosting/
Apache License 2.0
449 stars 113 forks source link

Builds not being triggered after migration to github app #2747

Open christophersutton opened 2 years ago

christophersutton commented 2 years ago

Before opening, please confirm:

App Id

d3o2mfqbaswdfz

Region

us-west-2

Amplify Hosting feature

Not applicable

Describe the bug

New commits are not triggering builds after going through the "Migrate to our GitHub App" steps. Prior to going through those migration steps new builds would be triggered upon commit. Within Github the app appears to be configured correctly and has access to the appropriate repo etc, and I also receive a success message from within Amplify.

Screen Shot 2022-05-11 at 8 48 20 AM

I do not appear to have any webhooks installed on the repo, so it seems possible that it's failing on the last step to finalize the installation, where it should delete the old webhooks and install new ones, possibly it only deleted the old and no new one was installed.

Expected behavior

When I commit a change to the repo, builds will be automatically kicked off.

Reproduction steps

  1. Migrate to Github App
  2. Commit change to repo
  3. No build is kicked off

Build Settings

No response

Additional information

No response

christophersutton commented 2 years ago

This is blocking our deployments so I'd really love to hear what steps we can take to revert back to oauth or do manual deploys without downtime. From the docs I don't really see how I can switch to manual deploys without tearing down the current production deploy and starting over, which doesn't seem like a great solution, but maybe I'm missing something. Many thanks.

ghost commented 2 years ago

Hi @christophersutton 👋🏽 I'm working on reproducing this behavior and syncing with the team on a workaround. In the mean time, have you tried reconnecting your repository in general settings?

christophersutton commented 2 years ago

Hi @hloriana, thanks for taking a look. I just reconnected in general settings and pushed to a feature branch but it's still not picking up the commit.

ghost commented 2 years ago

@christophersutton I was not able to produce this behavior. Does your repo belong to a GitHub organization?

ghost commented 2 years ago

For a workaround, please use this guide to setup an incoming webhook and use the curl command to trigger builds: https://docs.aws.amazon.com/amplify/latest/userguide/webhooks.html

We are deep diving on this issue. Thank you for your patience!

christophersutton commented 2 years ago

That webhook workaround is easy enough, many thanks. And yes the repo does belong to a Github organization.

shreyas3336 commented 2 years ago

For a workaround, please use this guide to setup an incoming webhook and use the curl command to trigger builds: https://docs.aws.amazon.com/amplify/latest/userguide/webhooks.html

We are deep diving on this issue. Thank you for your patience!

This solution is working, thanks!

aullrich commented 2 years ago

Same for us.

lucas-varela commented 2 years ago

+1 on the issue, the connected repo is private and part of a GitHub organization. Deploys were working normally earlier today until we switched to GH Apps.

Using the webhook workaround for now, but any news on this issue @hloriana?

Thanks!

mdecastro commented 2 years ago

Same here, builds not being triggered after migration.

zainsattar70 commented 2 years ago

Having the same issue, i see the "Migrate to our GitHub App" banner in the console even though i've migrated successfully multiple times. any ETA for the fix? or workaround that doesn't involve webhooks?

ogobilliard commented 2 years ago

Having the same issue here after moving repositories from GitLab to GitHub. Amplify shows the repo as connected sucessfully but does not create the webhook config in GitHub. Clicking the button "Reconnect Repository" actually breaks working project, it will delete the existing webhook but not create new ones.

mkane91301 commented 2 years ago

+1 Exactly the same except my private repo is NOT part of an organization. I'll use the workaround for now. Commenting here mostly just so I'll get alerted when this is fixed.

loafofpiecrust commented 2 years ago

+1 Also having this issue with a public repository owned by an organization. The configuration has always been the same until I wanted to migrate to the GitHub app. I was already using the manual webhook for release builds, but this is blocking me from having automatic preview deployments for PRs! It seems like there have been several reports of this bug and multiple supposed fixes, what's going on here?

mdecastro commented 2 years ago

I have it working now, I just had to re connect the repo. There is a button in the "General" section.

loafofpiecrust commented 2 years ago

I tried that already about five times to no avail, even after manually deleting the github webhook.

thecodehen commented 2 years ago

+1 on the issue, is there a method to add back the old webhooks to Github? Or what parameters should I put in Github's settings?

SukoonAdmin commented 1 month ago

Can someone provide any update on this issue?

gordbond commented 1 month ago

I could use an update as well. With the move away from CodeCommit this seems like a more important issue now. I've switched to github but the lack of triggered deployments will really throw a wrench in our gears.

gordbond commented 1 month ago

@SukoonAdmin Just had some luck debugging my issue. Here's the steps I took to fix it:

  1. Check in your GitHub repo settings under webhooks to see if a webhook for amplify exists
  2. If it doesn't you'll need to manually create one.
  3. If manually creating one the first thing is to go to the Amplify console under the app's build settings. You can add an incoming webhook (at the bottom of the page). Create this for the necessary branch then copy the URL it creates.
  4. Go back to GitHub and follow the process of making a new webhook. Paste the URL and give it a name like amplify webhook. No secret is nessary.
  5. Set the Content type to application/json.
  6. Choose "Let me select individual events" and select the relevant events like push, pull_request, etc.
  7. Click Add webhook.

I hope this helps.

jgangemi commented 1 week ago

i'd also like an update on this. if the workaround is to create a separate webhook, it seems there is something incorrect with the one being established by the app