creativeprojects / resticprofile

Configuration profiles manager and scheduler for restic backup
https://creativeprojects.github.io/resticprofile/
GNU General Public License v3.0
604 stars 29 forks source link

drop-ins: transparent timer drop-in support #340

Closed jkellerer closed 4 months ago

jkellerer commented 4 months ago

PR for #217 (and other systemd specific configs for timers), tested in unit and manual tests.

E.g.

randomize-start.conf:

[Timer]
RandomizedDelaySec="10m"

max-time.conf:

[Service]
RuntimeMaxSec="12h"
profile:
  systemd-drop-in-files:
    - randomize-start.conf    # is put in timer.d/ (as it contains "[Timer]")
    - max-time.conf           # is put in service.d/

Note: This also contains a fix for run-schedule not transferring AfterNetworkOnline & SystemdDropInFiles and a weakness of the drop-in support not detecting the own files when the sources use an extension other than .conf.

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 60.00000% with 14 lines in your changes are missing coverage. Please review.

Project coverage is 70.79%. Comparing base (fde661b) to head (13ecbaf).

Files Patch % Lines
schedule/handler_systemd.go 0.00% 9 Missing :warning:
systemd/generate.go 76.92% 1 Missing and 2 partials :warning:
systemd/drop_ins.go 81.82% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #340 +/- ## ========================================== - Coverage 71.85% 70.79% -1.06% ========================================== Files 102 120 +18 Lines 11380 12311 +931 ========================================== + Hits 8177 8715 +538 - Misses 2855 3199 +344 - Partials 348 397 +49 ``` | [Flag](https://app.codecov.io/gh/creativeprojects/resticprofile/pull/340/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Fred) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/creativeprojects/resticprofile/pull/340/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Fred) | `70.79% <60.00%> (-1.06%)` | :arrow_down: | 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=Fred#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.