arduino-create-agent
arduino-create-agent copied to clipboard
Updater requests elevation if needed (issue 981)
- [x] The PR has no duplicates
- [ ] Tests for the changes have been added (for bug fixes / features)
What kind of change does this PR introduce?
- The Arduino Cloud Agent now attempts to rerun itself as administrator if it crashes while trying to write the
-temp.exefile at boot. - The ACA previously copied itself to
filename.exe-tempdue to a bug in the code, I fixed this so now it copies itself tofilename-temp.exe. According to my understanding of the code, this shouldn't cause any issues, but if someone more familiar with the code base could verify that, that would be good.
What is the current behavior?
See issue 981.
What is the new behavior?
The Agent will automatically attempt to rerun itself.
Does this PR introduce a breaking change?
Nothing should be a breaking change, according to my knowledge.
Other information:
I do not own a mac, so this has not been tested on mac. However, I think my code is good, and my code only triggers when the agent was about to crash anyways, so it's not like I would have made anything worse if it didn't work on mac =P
I'm relatively new to OSS work with others, so I'm not sure if I was supposed to add tests, or what tests I would add. If tests should be added to this, those tests probably should be added by someone more experienced with unit tests and Go.
I tried to follow the contribution guidelines, I just ran the go fmt command on the folder I modified because it added modified icons to a lot of other files when I ran it directly. I'm not sure if the commit signoff worked or not, nor how to check if it did.
I see that apparently importing the windows low level library fails on anything that's not windows... I'm not sure the proper way to fix this, I assumed the file would just not be included if it wasn't windows automatically.
That push should fix the signoff thing...
I've confirmed it builds now on windows and linux.
Codecov Report
Attention: Patch coverage is 0% with 25 lines in your changes missing coverage. Please review.
Project coverage is 19.99%. Comparing base (
5fcb7c4) to head (fbab5eb). Report is 6 commits behind head on main.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| updater/updater.go | 0.00% | 12 Missing :warning: |
| updater/elevate_unix.go | 0.00% | 7 Missing :warning: |
| updater/updater_default.go | 0.00% | 6 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #1026 +/- ##
==========================================
- Coverage 20.14% 19.99% -0.15%
==========================================
Files 42 43 +1
Lines 3222 3246 +24
==========================================
Hits 649 649
- Misses 2488 2512 +24
Partials 85 85
| Flag | Coverage Δ | |
|---|---|---|
| unit | 19.99% <0.00%> (-0.15%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
Imma be honest I have no clue what coverage and all means.