Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

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

Merged
davegarthsimpson merged 2 commits into main from 374-verbose-output-pref-not-applied-correctly
Jul 26, 2022

Conversation

Copy link
Contributor

@davegarthsimpson davegarthsimpson commented Jul 21, 2022

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 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!

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.

Copy link
Contributor Author

davegarthsimpson commented Jul 22, 2022
edited
Loading

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?

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 });

Copy link
Contributor Author

davegarthsimpson commented Jul 22, 2022
edited
Loading

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>
Copy link
Contributor Author

davegarthsimpson commented Jul 22, 2022
edited
Loading

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?

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 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
Reviewers

@per1234 per1234 per1234 approved these changes

+1 more reviewer

@fstasi fstasi fstasi approved these changes

Reviewers whose approvals may not affect merge requirements
Assignees
No one assigned
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Verbose output preferences are not applied correctly

AltStyle によって変換されたページ (->オリジナル) /