Amplify-console: Branch autodetection and environment creation fails

Created on 3 Sep 2019  路  4Comments  路  Source: aws-amplify/amplify-console

Describe the bug
If you set up branch auto detection and ask the console to create a new environment for each branch, then some branch names cause the build to fail when creating the new environment. For example, branch names like "feature/JIRA-123-new-thing" will result in invalid environment names. Branch names like this are useful for linking issues in systems like JIRA to git commits.

To Reproduce
Steps to reproduce the behavior:

  1. Go to the amplify console, enable branch autodetection.
  2. Select "create new backend environment for each connected branch"
  3. Push a new branch with a name that contains capitals.
  4. See error in build phase for backend: "Environment name should be between 2 and 10 characters (only lowercase alphabets)."

Expected behavior
New environment for branch should be created. Perhaps instead of using the branch name for the environment, a unique id could be created (the short commit id at the time the branch is first pushed might work). Just lowercasing the branch name will not be enough either - note that branch names following this pattern will not be unique: "feature/SED-123" will be converted to "featureSED" by the current algorithm.

backend bug pending-prioritization work-in-progress

All 4 comments

Also attemping to integrate gitlab merge request with autogenerated branch by issue name corrispond to branch named like "1-issue-title-too-long".

Anything new here? This is also blocking my team from moving forward with Amplify.

We hit this issue, too. Seems like Amplify is doing some sanitization (limiting to 10 characters, etc.), but isn't doing enough because branch names with non-alphabetical characters are converted to dashes, which aren't allowed in environment names.

Here's an example of a build that failed because of this:

image

@nomiddlename @colinking @alexkates a fix has been deployed.

Was this page helpful?
0 / 5 - 0 ratings