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

Updater requests elevation if needed (issue 981) #1026

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Reginald-Gillespie
Copy link

  • The PR has no duplicates
  • Tests for the changes have been added (for bug fixes / features)

What kind of change does this PR introduce?

  1. The Arduino Cloud Agent now attempts to rerun itself as administrator if it crashes while trying to write the -temp.exe file at boot.
  2. The ACA previously copied itself to filename.exe-temp due to a bug in the code, I fixed this so now it copies itself to filename-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.

@CLAassistant
Copy link

CLAassistant commented Mar 26, 2025

CLA assistant check
All committers have signed the CLA.

@Reginald-Gillespie

This comment was marked as resolved.

@Reginald-Gillespie

This comment was marked as resolved.

Signed-off-by: Reginald Gillespie <[email protected]>
@Reginald-Gillespie

This comment was marked as resolved.

@codecov-commenter
Copy link

codecov-commenter commented Mar 26, 2025

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 1 commits behind head on main.

Files with missing lines Patch % Lines
updater/updater.go 0.00% 12 Missing ⚠️
updater/elevate_unix.go 0.00% 7 Missing ⚠️
updater/updater_default.go 0.00% 6 Missing ⚠️
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%) ⬇️

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.

Signed-off-by: Reginald Gillespie <[email protected]>
@Reginald-Gillespie
Copy link
Author

Reginald-Gillespie commented Mar 26, 2025

Imma be honest I have no clue what coverage and all means.

@per1234 per1234 linked an issue Mar 26, 2025 that may be closed by this pull request
@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Mar 26, 2025
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.

Crash on failed write when updating.
4 participants