Skip to content

WIP: feat: implement pre_upload check and pattern#3171

Open
facchinm wants to merge 1 commit intoarduino:masterfrom
facchinm:pre_upload_pattern
Open

WIP: feat: implement pre_upload check and pattern#3171
facchinm wants to merge 1 commit intoarduino:masterfrom
facchinm:pre_upload_pattern

Conversation

@facchinm
Copy link
Copy Markdown
Member

Please check if the PR fulfills these requirements

See how to contribute

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • configuration.schema.json updated if new parameters are added.

What kind of change does this PR introduce?

For multi binary uploads it might be useful to skip flashing a part of the binary (if unchanged, or just compatible). By adding this pair of rules (activated by .upload.use_pre_upload_check=true) we can give maximum flexibility for platform developers who need this kind of behaviour.

pre_upload_check.pattern should return != 0 if we want to execute the second rule before upload.pattern

What is the current behavior?

What is the new behavior?

Does this PR introduce a breaking change, and is titled accordingly?

Other information

For multi binary uploads it might be useful to skip flashing a part of the binary (if unchanged, or just compatible).
By adding this pair of rules (activated by .upload.use_pre_upload_check=true) we can give maximum flexibility for platform developers who need this kind of behaviour.

pre_upload_check.pattern should return != 0 if we want to execute the second rule before upload.pattern
facchinm added a commit to arduino/ArduinoCore-zephyr that referenced this pull request Apr 20, 2026
…needed

Requires arduino/arduino-cli#3171 and arduino/serial-discovery#116 (and, transitively, bugst/go-serial#215)

TODO:
* replace the shell script with a proper version check utility
* check if other uploaders need different methods
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 20, 2026

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 20, 2026

Codecov Report

❌ Patch coverage is 25.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.47%. Comparing base (c0d2d07) to head (50f2e8c).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
commands/service_upload.go 25.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3171      +/-   ##
==========================================
+ Coverage   69.46%   69.47%   +0.01%     
==========================================
  Files         252      252              
  Lines       19557    19561       +4     
==========================================
+ Hits        13585    13590       +5     
  Misses       4712     4712              
+ Partials     1260     1259       -1     
Flag Coverage Δ
unit 69.47% <25.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
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.

Please add documentation for the new properties to the Arduino Library Specification:

https://github.com/arduino/arduino-cli/blob/master/docs/platform-specification.md

}
}

preUpload := uploadProperties.GetBoolean("upload.use_pre_upload_check")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

upload.use_pre_upload_check seems superfluous. Why not just use the existence of the pattern properties as the determining factor?

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Apr 20, 2026
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: enhancement Proposed improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants