Skip to content
New issue

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

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

Already on GitHub? # to your account

🐛Malformed Depot Breaks All CLI Functionality #342

Open
meisZWFLZ opened this issue Apr 5, 2024 · 2 comments · May be fixed by #378 or #380
Open

🐛Malformed Depot Breaks All CLI Functionality #342

meisZWFLZ opened this issue Apr 5, 2024 · 2 comments · May be fixed by #378 or #380
Assignees
Labels
bug Something isn't working good first issue A good issue to start with when looking to make contributions p: normal Normal priority

Comments

@meisZWFLZ
Copy link
Contributor

meisZWFLZ commented Apr 5, 2024

Expected Behavior:

If I attempt to add a malformed depot, it shouldn't break other commands.

Actual Behavior:

The malformed template gets added to conductor.pros. This means that when you attempt to run any command, pros-cli will first attempt to parse conductor.pros, but since the template was malformed, so is conductor.pros, and thus jsonpickle throws an error.

error

Steps to reproduce:

With npm installed:
powershell:

mkdir depot;
'[{"py/object":"pros.conductor.templates.base_template.BaseTemplate","metadata":{},"name":""}]' | Out-File -FilePath ./depot/depot.json ascii;
Start-Process npx -ArgumentList "-y http-server depot -p 8080";
sleep 6;
pros c add-depot malformed http://127.0.0.1:8080/depot.json;
pros c query-templates --force-refresh some-text;
pros --version

not windows:

mkdir depot 
echo '[{"py/object":"pros.conductor.templates.base_template.BaseTemplate","metadata":{},"name":""}]' >./depot/depot.json 
npx -y http-server depot -p 8080 & 
sleep 6
pros c add-depot malformed http://127.0.0.1:8080/depot.json
pros c query-templates --force-refresh some-text
pros --version

This also happens attempting to apply any template.

If you want to fix your cli after running the above commands, remove the malformed depot from conductor.pros.

System information:

Operating System: Windows 11
pros-cli: 3.5.1

@ayushuk
Copy link
Member

ayushuk commented Apr 5, 2024

Sorry for this being an issue. We'll take a look. In the meantime, if your CLI breaks due to a malformed conductor.pros use pros c reset to reset the malformed file.

@meisZWFLZ
Copy link
Contributor Author

pros c reset throws the same error as pros --version with a broken conductor.pros. But its fine, since I already manually fixed the conductor.pros file.

@mayankpatibandla mayankpatibandla added p: normal Normal priority bug Something isn't working good first issue A good issue to start with when looking to make contributions labels Aug 23, 2024
@NaitikRambhia NaitikRambhia linked a pull request Sep 26, 2024 that will close this issue
@BennyBot BennyBot linked a pull request Oct 24, 2024 that will close this issue
1 task
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working good first issue A good issue to start with when looking to make contributions p: normal Normal priority
Projects
None yet
4 participants