Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement Request for Conditional Backend Builds and Build Dependencies in Amplify Gen 2 #3945

Open
3 tasks done
chelorope opened this issue Jul 1, 2024 · 1 comment
Open
3 tasks done
Labels
feature-request New feature or request

Comments

@chelorope
Copy link

Before opening, please confirm:

Amplify Hosting feature

Backend builds

Is your feature request related to a problem? Please describe:

Yes, my feature request is related to a problem I'm currently experiencing with Amplify Gen 2. I have configured my project as a monorepo, where an independent app is used to deploy backend resources, and two other apps are used to deploy different frontends. As decrived in the following article: https://docs.amplify.aws/react/deploy-and-host/fullstack-branching/monorepos/
The issue arises when I push any changes to the repository. Even if these changes are unrelated to the backend code, the backend app always triggers a build.

In Amplify Gen 1, there was an environment variable called AMPLIFY_DIFF_BACKEND that allowed the system to check for changes in the backend code and only trigger the backend build if changes were detected. This feature is not available in Amplify Gen 2, leading to unnecessary backend builds for every push to the repository, regardless of whether the changes are relevant to the backend.

This problem causes another issue when sharing backend resources with the frontend apps. To share these resources, I need to run npx ampx generate outputs --branch dev app-id AWS_APP_ID. This command works well unless the backend app is building simultaneously, in which case I receive the error: "Error: This branch deployment is in progress. Re-run this command once the deployment completes." Since the backend app deployment currently runs for every change pushed to the frontend code, this error occurs frequently, disrupting the development workflow.

Describe how you'd like this feature to work

I would like Amplify Gen 2 to introduce a feature similar to the AMPLIFY_DIFF_BACKEND environment variable that was available in Amplify Gen 1. This feature should check for changes in the backend code and trigger the backend build only if changes are detected. This would prevent unnecessary builds and improve the efficiency of the build process.

Additionally, I would like a feature that allows one app to wait for another app to finish building before it starts its build process. This feature would work similarly to dependencies used in GitHub Actions, ensuring that dependent builds do not interfere with each other. For example, if the backend app is building, the frontend apps should wait for the backend build to complete before starting their build processes. This would prevent the error "Error: This branch deployment is in progress. Re-run this command once the deployment completes" and streamline the development workflow.

@chelorope chelorope added the feature-request New feature or request label Jul 1, 2024
Copy link

github-actions bot commented Jul 1, 2024

This has been identified as a feature request. If this feature is important to you, we strongly encourage you to give a 👍 reaction on the request. This helps us prioritize new features most important to you. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant