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

🐛 Depot bug fix #378

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

🐛 Depot bug fix #378

wants to merge 1 commit into from

Conversation

NaitikRambhia
Copy link

Summary:

Wrapped pickle.pickler in a Try, Except. Prompted user to reset depots using the reset depots function.

Motivation:

Prevents an error message after having a malformed depot.

References (optional):

Closes #342

Test Plan:

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

@meisZWFLZ
Copy link
Contributor

Shouldn't changes to the conductor.pros file be checked to ensure they create valid json, preventing the file from being malformed in the first place?

@BennyBot
Copy link
Member

BennyBot commented Oct 8, 2024

Ideally, yes, they should be. However, this does not prevent a user from going and modifying it themselves. Therefore, this check should be in there anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛Malformed Depot Breaks All CLI Functionality
3 participants