fix(schedule): omit launchd log paths when schedule-log is configured#600
fix(schedule): omit launchd log paths when schedule-log is configured#600wyattjoh wants to merge 1 commit intocreativeprojects:masterfrom
Conversation
When schedule-log is set in the profile configuration, resticprofile handles logging internally. Previously, the launchd plist always included StandardOutPath/StandardErrorPath entries pointing to <job-name>.log files, which remained empty when schedule-log was configured. This change omits those plist fields (via their omitempty tags) when schedule-log is set, avoiding the creation of empty log files.
WalkthroughAdds a new exported Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #600 +/- ##
==========================================
+ Coverage 81.00% 81.00% +0.01%
==========================================
Files 137 137
Lines 11083 11086 +3
==========================================
+ Hits 8977 8980 +3
Misses 1680 1680
Partials 426 426
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.github/workflows/homebrew-update.yml:
- Around line 1-22: The workflow "Update Homebrew Formula" (file
.github/workflows/homebrew-update.yml) is unrelated to the change about omitting
launchd log paths; remove this file from the branch or revert its addition so
the PR only contains launchd/schedule-log changes, or alternatively move this
workflow commit onto a separate branch and open a dedicated PR that contains the
uses: wyattjoh/homebrew-bump-revision@v1 step and tap: wyattjoh/homebrew-stable
configuration instead of bundling it here.
🧹 Nitpick comments (1)
.github/workflows/homebrew-update.yml (1)
16-16: Pin third-party action to a full commit SHA instead of a mutable tag.
wyattjoh/homebrew-bump-revision@v1is pinned to a major version tag, which can be force-pushed. Pinning to a specific commit SHA mitigates supply-chain risks.- uses: wyattjoh/homebrew-bump-revision@v1 + uses: wyattjoh/homebrew-bump-revision@<full-commit-sha> # v1
1b44820 to
819f606
Compare
Summary
Log(schedule-log) field from schedule config into theschedule.Configstructschedule-logis configured, omitStandardOutPath/StandardErrorPathfrom the launchd plist by leaving the logfile string empty (leveraging the existingomitemptyXML tags).logfiles when resticprofile is already handling logging internally viaschedule-logMotivation
When
schedule-logis set in a profile's schedule configuration, resticprofile handles logging internally. However, the launchd handler always populatedStandardOutPathandStandardErrorPathin the generated plist, resulting in empty log files being created alongside the internally-managed log. This is confusing and creates unnecessary filesystem clutter.Changes
schedule/config.go: AddLogfield toConfigstructschedule_jobs.go: Passsched.Logthrough to the schedule configschedule/handler_darwin.go: Only set the logfile path whenjob.Logis empty, allowing the plistomitemptytags to omit the fields entirely when schedule-log is configuredTest plan
schedule-logis not set, the launchd plist still containsStandardOutPathandStandardErrorPathas beforeschedule-logis set, the launchd plist omitsStandardOutPathandStandardErrorPath, and no empty.logfiles are created