serverless-plugin-git-variables icon indicating copy to clipboard operation
serverless-plugin-git-variables copied to clipboard

Add client-side validation of git variables

Open f00f opened this issue 2 years ago • 0 comments

I regularly use characters in my commit messages which are invalid for AWS tags. The result is a cloud-side error like this:

1 validation error detected: Value '' failed to satisfy constraint: Member must satisfy regular expression pattern: [\p{L}\p{Z}\p{N}_.:/=+-@]*

The problem is that the time to error is quite long, so I would prefer a client-side error. I can see how this could be problematic as people might use git variables in places other than AWS tags and don't care about this validation - or might need other validations.

Maybe this is not even the right place to add the validation, and a generic validation plugin might be more suitable. E.g.

plugins:
  validation:
    awsTags:
      - ${git:messageSubject}
    awsApiStageName:
      - ${git:repository}
      - ${git:branch}

f00f avatar Apr 03 '23 13:04 f00f