endorama / devid

Securely manage your developer personas
Apache License 2.0
2 stars 0 forks source link

backup: fix working directory change #20

Closed endorama closed 1 week ago

endorama commented 1 week ago

backup.Perform was using os.Chdir, which changes working directory for the entire process. This in practice did not have any effect, but is the potential source of future bugs as it's an unexpected occurrence.

Solve this by restoring working directory after executing the backup. A dedicated test case is provided.

codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 74.07407% with 7 lines in your changes missing coverage. Please review.

Project coverage is 58.23%. Comparing base (b3a9eaf) to head (e961763). Report is 51 commits behind head on main.

:exclamation: Current head e961763 differs from pull request most recent head 82301b7

Please upload reports for the commit 82301b7 to get more accurate results.

Files Patch % Lines
internal/backup/perform.go 74.07% 7 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #20 +/- ## ========================================== + Coverage 51.70% 58.23% +6.53% ========================================== Files 30 38 +8 Lines 441 510 +69 ========================================== + Hits 228 297 +69 + Misses 187 178 -9 - Partials 26 35 +9 ```

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