aws-amplify / aws-amplify/amplify-hosting

"Deploy to Amplify" button not working with monorepo

Open
#2,971 1 comment 0 reactions 0 assignees View on GitHub
bug one-click-deploy
Dominant language
Dockerfile
Stars
481
Forks
123
PR merge metrics
No merged PRs in 30d

Description

### Before opening, please confirm:

- [X] I have checked to see if my question is addressed in the [FAQ](https://github.com/aws-amplify/amplify-hosting/blob/master/FAQ.md).
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-hosting/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-hosting/blob/master/CONTRIBUTING.md).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

### App Id

_No response_

### Region

ap-southeast-1

### Amplify Hosting feature

_No response_

### Describe the bug

This seems related to #618 .

I've added the One-Click deployment button to a subfolder of a private GitHub Repo (to which my GitHub user has access). After correctly configuring the button URL to include the subfolder (this is a monorepo), I get a blank error screen in the amplify console after clicking the button. See the attached screen recording.

https://user-images.githubusercontent.com/1751645/188840238-0843b6ad-ade1-43b3-93c9-493201e20c71.mov

The browser developer tools console has an error message: `[Error] Failed to load resource: the server responded with a status of 404 ()`; the URL it was attempting to connect to was :`https://api.github.com/repos/username/repository/branches/branchname/folder` (with actual values for the appropriate placeholders).

### Expected behavior

deployment proceeds

### Reproduction steps

Configure a ["Deploy to Amplify" button](https://docs.aws.amazon.com/amplify/latest/userguide/one-click.html) in a GitHub `Readme.md` file, with the URL referring to a subfolder of a monorepo.

### Build Settings

_No response_

### Additional information

My guess is that it's trying to use the GitHub API to checkout a branch named `branchname/folder`, which is invalid. The branch `branchname` should be checked out first, then the build should proceed in the `folder` subfolder.

Contributor guide

Open the contributing guide

Research direction

Start with the one-click deployment documentation and reproduce the button flow using a GitHub README subfolder URL. Inspect the browser request to the GitHub branches endpoint and compare the branch and folder handling; done means the deployment proceeds for a subfolder in a monorepo.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, github
Domain
cloud, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.