BE - Handle duplicate username in service account creation for group level flows

In !211216 (merged) we add the ability to create service accounts for new flows at the group level.

There is a rare case where the service account name may already exist.

We should add a method of handling this. We have 3 options:

  • Use a unique separator between the group and flow name (This may still cause duplicates if someone manually created the service account with the same name (prefixed with ai-) so it's not reliable
  • Append a random string after the service account name (more reliable but may still cause duplicates in extremely rare situations
  • Allow the user to specify a different service account name and retry (The most reliable, and gives the user more choice, but requires FE work as well).

This likely does not need to be done for the release as the chances of this happening are pretty low, but it should be dealt with eventually.

Edited by 🤖 GitLab Bot 🤖