scaleoutsystems/stackn

STACKn CLI fails with projects with trailing whitespace in project name

Closed this issue · 3 comments

Severity

  • Critical/Blocker (select if the issue makes the application unusable or causes serious data loss)
  • High (select if the issue affects a major feature and there is no workaround or the available workaround is very complex)
  • Medium (select if the issue affects a minor feature or affects a major feature but has an easy enough workaround to not cause any major inconvenience)
  • Low (select if the issue doesn't significantly affect the user experience, like minor visual bugs)

Describe the bug
If you create a project with a trailing whitespace in the Project name, the CLI does not work as expected.

Expected behavior
Form/project validation on project creation, alternatively trailing whitespace should be allowed.

Screenshots
If applicable, add screenshots to help explain your problem.

Contact Details
An e-mail address in case we need to contact you for further details regarding this issue.

Here comes an investigation update:

  • Project with trailing spaces at end of its name:

stackn get:
S3 - Fail
app - Fail
current - Success
environment - Fail
flavor - Fail
mlflow - Fail
object - Partially Fail --> "Project Carmat Ten Spaces not found."
objecttypes - Fail
project - Success (note: output may hint about rendering differences due to trailing spaces)
releasenames - Fail
remote - Success
templates - Fail --> "TypeError: 'NoneType' object is not iterable"

All other failures reports: "TypeError: 'bool' object is not iterable"

stackn delete:
delete app project-registry - Fail -> TypeError: cannot unpack non-iterable bool object
delete app project-minio - Fail -> TypeError: cannot unpack non-iterable bool object

  • Project without trailing spaces at end of its name:

stackn get:
S3 - Success
app - Success
current - Success
environment - Success
flavor - Success
mlflow - Success (-->but Bug! Because I have deleted the mlflow-serve app, yet it's returning its ingress address)
object - Success
objecttypes - Success
project - Success
releasenames - Success
remote - Success
templates - Success

stackn delete:
delete app project-registry - Success
delete app project-minio - Success

These tests seem to point to the conclusion that a project name created with trailing spaces at the end can lead to issues for stackn cli but not for studio in itself. Studio django code seems actually to "slugify" the project name here:

Yet model, form and field validation could surely be improved since at:

validation is completely missing, unfortunately.

New Update

Before:
image

After patch(local):
image

By performing some data validation and data clean under components/studio/projects/model.py. Soon will come a PR for it!

Fixed by PR #258