Closed gregoryfoster closed 11 months ago
I think this might be a documentation issue. I can't really think of a workaround. We generally want to keep the random_ascii_string(8).lower()
as that provides us a decent amount of randomness to not overlap with existing GCP projects. Meanwhile, the user provided content is the long bit.
Would just adding a bit of documentation saying "the name should be at most 23 characters in length" work?
That certainly works. I looked around to see if cookiecutter
offered a means of declaring a character limit, and one option is to declare a pre_gen_project
hook to validate template variables:
https://cookiecutter.readthedocs.io/en/stable/advanced/hooks.html#examples
Already merged! Thanks! Closing
Describe the Bug
cookiecutter
prompts for theinfrastructure_slug
and provides a default (cdp-{{ cookiecutter.municipality_slug }}-{{ random_ascii_string(8).lower() }}
). That default value can be > 30 characters, which causes problems downstream.Expected Behavior
Let's ensure we aren't recommending an invalid project name.
Reproduction
Add a project name > 30 characters. Can be fixed with a search and replace in the generated codebase.
Environment
Any additional information about your environment.