aws-amplify / aws-amplify/amplify-hosting
Filter automatic Github PR previews based on labels, name, files modified
- 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 removed any sensitive information from my code snippets and submission.
### Amplify Hosting feature
Git providers, Web previews
### Is your feature request related to a problem? Please describe:
Amplify currently allows configuration of automatic PR previews for the GitHub provider. However, all pull requests targeting the configured branch are discovered automatically. We would like the ability to filter which PRs trigger automatic previews based on:
* PR Labels
* PR Names
* Files modified in the PR (similar to this request: https://github.com/aws-amplify/amplify-hosting/issues/2336)
This feature is critical, especially considering the hard limit of 50 open branches per app[^1].
We are using Amplify to generate Pull Request previews for documentation pages stored alongside the code in a large GitHub repository. Only certain Pull Requests modify documentation files. However, every Pull Request is automatically discovered, which brings us close to the limit of open branches and wastes build minutes.
[^1]: https://docs.aws.amazon.com/amplify/latest/userguide/quotas-chapter.html
### Describe how you'd like this feature to work
Currently Amplify has a setting [AutoBranchCreationPatterns](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amplify-app-autobranchcreationconfig.html#cfn-amplify-app-autobranchcreationconfig-autobranchcreationpatterns) that can be used to limit number of automatically discovered branches, however no such setting for Pull Request discovery[^2].
Pull Request discovery should have similar configuration, where they can be filtered based on the PR name or labels. Having ability to discover PRs based on modified files will be immensely useful as well (similar to https://github.com/aws-amplify/amplify-hosting/issues/2336)
[^2]: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-amplify-branch.html#cfn-amplify-branch-enablepullrequestpreview
Contributor guide
Research direction
The issue names no repository files, tests, or implementation entry points. Start by reading the AutoBranchCreationPatterns and EnablePullRequestPreview documentation and compare the related issue #2336; done means automatic PR previews can be filtered by labels, PR names, and modified files without discovering unrelated pull requests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, git, github
- Domain
- ci-cd, cloud
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100