Skip to content

Add job presets - #125

Open
floriandejonckheere wants to merge 4 commits into
mainfrom
job-presets
Open

floriandejonckheere wants to merge 4 commits into
mainfrom
job-presets

Conversation

@floriandejonckheere

Copy link
Copy Markdown
Owner

Summary

Adds presets: sets of recommended rsync options for common use cases, defined in JobPreset (app/objects/job_preset.rb).

  • Job form: a new "Preset" card with a dropdown. Selecting a preset asks for confirmation (the basic, advanced and custom rsync options will be overwritten) and then updates the toggles, linked options (archive/delete) and command preview. Cancelling restores the previous selection.
  • Job wizard: a new "Preset" step before "Schedule & options". The selected preset pre-fills the options, which can still be changed in the next step.
  • Presets: Borg repository, Restic repository, exact mirror, archive (never delete), VM images and large files, keep previous versions, slow or unreliable network, and trial run.
    • Applying a preset resets all toggles to their defaults, enables the preset's options and replaces the custom rsync arguments. Rsync paths, SSH arguments and include/exclude patterns are left untouched.
    • The trial run preset is additive: it only enables --dry-run --itemize-changes and keeps the other options.
  • Development: init: true in compose.yml. Foreman ran as PID 1 and shut the container down whenever an orphaned process (e.g. Chrome spawned by system specs run via docker compose exec) exited.

Not included (tracked in docs/PROJECT.md): the Borg lock-check pre-hook (needs a {source_path} hook variable and only works for local sources), and dated --backup-dir directories for the previous versions preset.

Testing

  • bundle exec rspec and bundle exec rspec spec/system (new: spec/objects/job_preset_spec.rb, spec/system/jobs/presets_spec.rb, preset step in spec/requests/job_wizards_request_spec.rb)
  • Recreate the dev containers (docker compose up -d app worker) to pick up init: true
  • Manually: edit a job, pick a preset, confirm/cancel the dialog; create a job through the wizard with and without a preset

Foreman runs as PID 1 and shuts down all processes when an orphaned
process (e.g. Chrome spawned by system specs) is reparented to it and
exits. An init process reaps these orphans instead.

This branch has not been deployed

No deployments
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