arduino / arduino-cli

Arduino command line tool
https://arduino.github.io/arduino-cli/latest/
GNU General Public License v3.0
4.24k stars 371 forks source link

gRPC `Compile` will now fail if a platform core has been modified. #2551

Closed cmaglie closed 4 months ago

cmaglie commented 4 months ago

Please check if the PR fulfills these requirements

See how to contribute

What kind of change does this PR introduce?

Before starting a compilation the platforms are checked for changes on the main files boards.txt, platform.txt, and programmers.txt. If a change is detected, the compile fails with an InstanceNeedsReinitializationError. A gRPC client would need to perform a new Init call to update the in-memory structures, and retry the compile.

What is the current behavior?

If a core platform file (boards.txt, platform.txt, or programmers.txt) is modified, the compile is performed with the old files already loaded in memory, leading to #2523.

What is the new behavior?

The compile fails with an InstanceNeedsReinitializationError.

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

No

Other information

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 69.45%. Comparing base (870a48f) to head (185627b). Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2551 +/- ## ========================================== + Coverage 69.38% 69.45% +0.06% ========================================== Files 205 205 Lines 20162 20207 +45 ========================================== + Hits 13989 14034 +45 Misses 5050 5050 Partials 1123 1123 ``` | [Flag](https://app.codecov.io/gh/arduino/arduino-cli/pull/2551/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=arduino) | Coverage Δ | | |---|---|---| | [unit](https://app.codecov.io/gh/arduino/arduino-cli/pull/2551/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=arduino) | `69.45% <100.00%> (+0.06%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=arduino#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.