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

✨Expansion on project.pros upload_options fields #349

Open
BennyBot opened this issue May 15, 2024 · 1 comment
Open

✨Expansion on project.pros upload_options fields #349

BennyBot opened this issue May 15, 2024 · 1 comment
Labels
enhancement This builds on top of an existing feature feature A brand new feature optimization Something could be done better p: normal Normal priority

Comments

@BennyBot
Copy link
Member

Requested Feature

Currently in project.pros, there is a field called upload_options that allows users to specify default options for the upload command that will be applied by default, unless that option is provided in the command call.

This section is also used in conjunction pros-vsc and the project.pros view to allow the sidebar upload button to have options applied to it.

I would like to expand on this section of project.pros. Essentially, we will replace

"upload_options":
 {
 "icon": "alien"
}

with

"default_options": {
    "upload": {
        "icon": "alien",
        "slot": 1,
        "extra": "--verbose --no-analytics"
    },

    "build": {
        "extra": "--verbose --no-analytics -- -j8"
    },
}

The vscode project.pros view will have a default options view for all sidebar buttons. Users who wish to add default options for non sidebar commands can open project.pros with something other than the PROS view and edit the json.

While it is possible to just go into each CLI command and add code to get the correct options from project.pros and apply them to the command call without overriding any options specified in the call (similar to how the upload options work as of now, at second glance it is kinda messy sorry ☹️),
this is very inefficient if we have to do it for every command. We should find a way to do this at the beginning.
example flow:
pros upload --slot 5 is called -> click gets the command and kwargs -> we open project.pros and match the command to the correct default options, adding those options as needed -> click then calls the command function, passing this edited kwargs instead of the original

Is this Feature Related to a Problem?

https://www.vexforum.com/t/pros-make-using-multicore-builds/124910/

Benefits of Feature

Fixes my bad code and makes it expandable for the future

@BennyBot BennyBot added enhancement This builds on top of an existing feature optimization Something could be done better feature A brand new feature p: normal Normal priority labels May 15, 2024
@BennyBot
Copy link
Member Author

Extra note now that I’ve had a few days to think about this. We want all of these fields to exist in both cli.pros and project.pros. There will need to be a vscode ui for this, similar to project.pros upload_options. Priority for the options will be specified in command > specified in project.pros > specified in cli.pros > specified in cli source as default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This builds on top of an existing feature feature A brand new feature optimization Something could be done better p: normal Normal priority
Projects
None yet
Development

No branches or pull requests

1 participant