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

#374: ensure compile verbose pref is included on upload #1237

Merged
merged 2 commits into from
Jul 26, 2022

Conversation

davegarthsimpson
Copy link
Contributor

Motivation

Verbose output preferences reported as incorrect during upload actions.

Change description

Ensure compile "verbose" preference is considered when performing compile step prior to upload.

Other information

Upload "verbose" preference was being used for both compile and upload steps of the "upload operation".

Reviewer checklist

  • PR addresses a single concern.
  • The PR has no duplicates (please search among the Pull Requests before creating one)
  • PR title and description are properly filled.
  • Docs have been added / updated (for bug fixes / features)

@davegarthsimpson davegarthsimpson changed the title ensure compile verbose pref is included on upload #374: Ensure compile verbose pref is included on upload Jul 21, 2022
@davegarthsimpson davegarthsimpson linked an issue Jul 21, 2022 that may be closed by this pull request
@davegarthsimpson davegarthsimpson linked an issue Jul 21, 2022 that may be closed by this pull request
@davegarthsimpson davegarthsimpson changed the title #374: Ensure compile verbose pref is included on upload #374: ensure compile verbose pref is included on upload Jul 21, 2022
@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Jul 21, 2022
Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes #374 for me.

Thanks Dave!

@kittaakos
Copy link
Contributor

Can we clean up the typings and the extra options argument for better APIs?

Here is the TypeScript way of redefining the verbose boolean type to { compile: boolean; upload: boolean } when uploading (using a programmer).

See the docs about Omit here.

@davegarthsimpson
Copy link
Contributor Author

davegarthsimpson commented Jul 22, 2022

Can we clean up the typings and the extra options argument for better APIs?

Here is the TypeScript way of redefining the verbose boolean type to { compile: boolean; upload: boolean } when uploading (using a programmer).

See the docs about Omit here.

I don't mind changing it to this, I favoured the separation of compile and upload options to be more explicit, and maybe make things easier in case we need to pass additional compile specific options into the upload op in the future. What do you think @kittaakos?

@kittaakos
Copy link
Contributor

I favoured the separation of compile and upload options to be more explicit

I do not want to introduce additional args in the service calls for a bug fix. First, the JS way is to provide one option, not multiple ones. Second, if the second arg is partial, a dev can specify additional options that are not used, only the verbose. What would be the expected behavior of this call with your API proposal:

coreService.upload({ board: { fqbn: 'a' }, verbose: true }, { board: { fqbn: 'b' }, verbose: false });

@davegarthsimpson
Copy link
Contributor Author

davegarthsimpson commented Jul 22, 2022

I favoured the separation of compile and upload options to be more explicit

I do not want to introduce additional args in the service calls for a bug fix. First, the JS way is to provide one option, not multiple ones. Second, if the second arg is partial, a dev can specify additional options that are not used, only the verbose. What would be the expected behavior of this call with your API proposal:

coreService.upload({ board: { fqbn: 'a' }, verbose: true }, { board: { fqbn: 'b' }, verbose: false });

I appreciate that making a service call, usually you'd only expect one options object, but my thinking was: the doUpload call doesn't do just one thing, it also calls another service compile, so maybe there is value in being explicit about what options are used for each step.

No problem though, if the priority is to maintain the APIs' style + if you see no value in separating it out let's go for your suggested approach.

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
@davegarthsimpson
Copy link
Contributor Author

davegarthsimpson commented Jul 22, 2022

when uploading (using a programmer).

@kittaakos what do you mean here by "using a programmer"? better verbose typings also works when usingProgrammer is false no?

@kittaakos
Copy link
Contributor

I verified the build, and it worked as expected. 👍

@fstasi, could you please help with the review? Thank you!

Copy link
Contributor

@fstasi fstasi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@davegarthsimpson davegarthsimpson merged commit 9373a0b into main Jul 26, 2022
@davegarthsimpson davegarthsimpson deleted the 374-verbose-output-pref-not-applied-correctly branch July 26, 2022 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Verbose output preferences are not applied correctly
4 participants