Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Magic CLI] Magic does not sanitize disallowed environment names #235

Open
DWSimmons opened this issue Oct 8, 2024 · 3 comments
Open

[Magic CLI] Magic does not sanitize disallowed environment names #235

DWSimmons opened this issue Oct 8, 2024 · 3 comments
Labels

Comments

@DWSimmons
Copy link

DWSimmons commented Oct 8, 2024

Not sure if this is a Pixi or Magic thing, but environment names request "only lower case letters, numbers and dashes". Oddly/interestingly, one can add them and then they can't use magic to remove them...

Steps to reproduce:
create a project
add an environment with invalid characters and be allowed to do it
be unable to either enter shell or remove the environment because of the magic (necessary) mechanics
[edit toml file manually to undo the issue]

darin@home:/media/darin/M2/magic$ magic init underscores_ --mojoproject
✔ Created /media/darin/M2/magic/underscores_/mojoproject.toml
✔ Added max >=24.5.0,<25
darin@home:/media/darin/M2/magic$ cd underscores_/
darin@home:/media/darin/M2/magic/underscores_$ magic project environment add foo_
✔ Added environment foo_
darin@home:/media/darin/M2/magic/underscores_$ magic s
  × failed to parse project manifest
    ╭─[pixi.toml:14:1]
 13 │ [environments]
 14 │ foo_ = []
    · ──┬─
    ·   ╰── Failed to parse environment name 'foo_', please use only lowercase letters, numbers and dashes
    ╰────

darin@home:/media/darin/M2/magic/underscores_$ magic project environment remove foo_
  × failed to parse project manifest
    ╭─[pixi.toml:14:1]
 13 │ [environments]
 14 │ foo_ = []
    · ──┬─
    ·   ╰── Failed to parse environment name 'foo_', please use only lowercase letters, numbers and dashes
    ╰────
darin@home:/media/darin/M2/magic/underscores_$ magic --version
magic 0.3.1 - (based on pixi 0.29.0)

Steps to fix: add sanitation check to magic project environment add or loosen requirements

@DWSimmons
Copy link
Author

Apparently, magic tickets go on the mojo repo now... Do you want me to close this and open a new one? Or, can it be moved?

@DWSimmons
Copy link
Author

Turns out this is from pixi prefix-dev/pixi#2245

@DWSimmons
Copy link
Author

reported on pixi 0.32.1 and has been fixed upstream

waiting on magic now.

@goldiegadde goldiegadde added the max-repo label Dec 18, 2024 — with Linear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants