gaia-pipeline/gaia

Python pipeline creation fails when pipeline name has non-ascii character

Shivakishore14 opened this issue · 3 comments

Steps to reproduce

  1. Create new pipeline
  2. For Repo, use the example repo https://github.com/gaia-pipeline/python-example
  3. For Pipeline name give test文

Output:
Pipeline creation fails

Expected Output:
Pipeline should be created successfully

The source of the issue can be traced to creation of the virtual environment. This is a known issue with virtualenv
pypa/virtualenv#457

The pipeline also fails with the name that contains $ followed by one or more characters
example : test$python.

I see that we are using the pipeline name when creating the virtual environment.

example:
for pipeline: test$python
the virtual environment cmd is

$/usr/local/bin/virtualenv /Users/coda/github/gaia/tmp/tmp/python/test$python

One of the quick fix that I can think of to bypass the ASCII issue is to base64 encode the pipeline name and use that in the virtual environment cmd.
the above cmd after the fix would be

$/usr/local/bin/virtualenv /Users/coda/github/gaia/tmp/tmp/python/dGVzdCRweXRob24=

This should fix the ASCII issue. I will test this out and raise a PR.
Do let me know if there is a better way to approach the problem.

Hi @Shivakishore14,

thanks for pointing that out!
I think the better approach would be to prevent the creation of pipelines with random characters in their names since this could also break for other pipeline types (e.g. Java, ruby, nodejs etc.).
We already have a pipeline name validation handler which we could use to force that behavior.

@Skarlso What do you think? e.g. restrict pipeline names to [A-z][0-9][-][_]?

Cheers,
Michel

Wth github. I absolutely did not get notified about this ping. 😭

Yes, I agree with the restriction. Allowing all kinds of characters is just asking for trouble. 😊