Skip to content

fix(schedule): omit launchd log paths when schedule-log is configured#600

Open
wyattjoh wants to merge 1 commit intocreativeprojects:masterfrom
wyattjoh:fix/schedule-log-plist
Open

fix(schedule): omit launchd log paths when schedule-log is configured#600
wyattjoh wants to merge 1 commit intocreativeprojects:masterfrom
wyattjoh:fix/schedule-log-plist

Conversation

@wyattjoh
Copy link

@wyattjoh wyattjoh commented Feb 3, 2026

Summary

  • Propagate the Log (schedule-log) field from schedule config into the schedule.Config struct
  • When schedule-log is configured, omit StandardOutPath/StandardErrorPath from the launchd plist by leaving the logfile string empty (leveraging the existing omitempty XML tags)
  • Prevents the creation of empty .log files when resticprofile is already handling logging internally via schedule-log

Motivation

When schedule-log is set in a profile's schedule configuration, resticprofile handles logging internally. However, the launchd handler always populated StandardOutPath and StandardErrorPath in 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: Add Log field to Config struct
  • schedule_jobs.go: Pass sched.Log through to the schedule config
  • schedule/handler_darwin.go: Only set the logfile path when job.Log is empty, allowing the plist omitempty tags to omit the fields entirely when schedule-log is configured

Test plan

  • Verify that when schedule-log is not set, the launchd plist still contains StandardOutPath and StandardErrorPath as before
  • Verify that when schedule-log is set, the launchd plist omits StandardOutPath and StandardErrorPath, and no empty .log files are created

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.
@coderabbitai
Copy link

coderabbitai bot commented Feb 3, 2026

Walkthrough

Adds a new exported Log string field to the schedule Config, maps it during schedule-to-config translation, and updates the Darwin launchd job generation to conditionally set log file plist entries; also adds a GitHub Actions workflow for Homebrew formula updates.

Changes

Cohort / File(s) Summary
Config and mapping
schedule/config.go, schedule_jobs.go
Introduce Log string on Config and map sched.LogConfig.Log in scheduleToConfig.
Darwin handler implementation
schedule/handler_darwin.go
Update getLaunchdJob to only assign default logfile paths when job.Log is empty, relying on omitempty to avoid empty plist entries.
CI / Homebrew workflow
.github/workflows/homebrew-update.yml
Add workflow triggered on tag pushes (v*-fork*) to bump Homebrew formula using wyattjoh/homebrew-bump-revision action with provided repo and token settings.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

feature ci

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: conditionally omitting launchd log paths when schedule-log is configured, which is the primary objective of the changeset.
Description check ✅ Passed The description is directly related to the changeset, providing clear context about the Log field propagation and conditional logfile handling in the launchd handler.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Feb 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.00%. Comparing base (8ea331c) to head (819f606).

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              
Flag Coverage Δ
unittests 81.00% <100.00%> (+0.01%) ⬆️

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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@v1 is 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

@wyattjoh wyattjoh force-pushed the fix/schedule-log-plist branch from 1b44820 to 819f606 Compare February 11, 2026 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant