BB-6295 Change limit for Grove, OpenEdX instances values
Created by: ngdangdat
Support URLs
JIRA task: https://tasks.opencraft.com/browse/BB-6295
Why
-
configuration_version
field is sometimes too short for storing branch names, we want to increase that - Grove's instance name length is limited by DigitalOcean, we also want it to limit from where people create and update Grove instance
What
- Change configuration_version character limit to 256.
- Checked branch names of open-craft/configuration repository. The longest branch name has 66 characters.
- The purpose of this field is similar to
edx_platform_commit
which is used to refer to a commit hash or branch name or tag name. Quote from the help text ofedx_platform_commit
field:
edx-platform commit hash or branch or tag to use. Leave blank to use the default, which is equal to the value of "openedx_release".
- Limit instance name of Grove instance to 49 character. The reson is described in grove repository: https://gitlab.com/opencraft/dev/grove/-/blob/1b5625958858e334f91541f942f7bdda4b42627e/tools-container/grove-cli/grove/instance.py#L185-200
Chores
- Add missing default configuration keys to
.env.test
file to allow running in local
Supporting information
Top 10 of lengths of branches in configuration repository
git remote get-url origin
git@github.com:open-craft/configuration.git
git branch -a | grep origin | cut -d'/' -f3- | awk '{ print length($0); }' | sort -n -r | uniq -c | head
1 66
2 62
1 56
1 55
1 54
1 53
1 52
2 51
3 50
4 49
Testing instruction
Grove instance
Expected:
- Change on limit of configuration_version is applied
- Change on limit of instance name is applied
Steps
- Go to admin UI page and login
- Create a new Grove instance with 0x29a/bb6112/prepare-maple-configuration-shared-branch as value of configuration version field -> Expect the instance to be created successfully
- Edit newly created instance
- Input a name that has more than 49 characters to Instance name field
- Save -> Expect a validation message raised on exceeding length limit
OpenEdx instance (instances with type other than Grove)
Expected
- Change on limit of configuration_version is applied
- Change on limit of instance name is not applied
Steps 1 -> 4 same as Grove instance section 5. Save -> Expect no validation message arise and the instance is saved successfully
PoW
- Create a Grove instance: https://www.loom.com/share/f5e046ae2b8c4001b963b916c2b556d8
- Create a OpenEdx instance: https://www.loom.com/share/80e4a73018194de0a562a62426ccf45a