Contributing¶
For the canonical list of conventions, lint matrices and pre-commit
hooks, see CONTRIBUTING.md
and AGENTS.md
in the repo root. This page is a short orientation for contributors
who want to get a local development loop running quickly.
Get the source¶
Install local hooks¶
The hooks run the same shellcheck / shfmt / hadolint /
yamllint / actionlint checks CI runs, so you can catch findings
before pushing.
Build the image locally¶
./build-testing.sh # builds and pushes the testing tag
./build-testing-local.sh # builds and pushes to a private registry (build-testing-local.env)
Hand-built images must pass
--build-arg RESTIC_BACKUP_HELPER_RELEASE=… (same string as the
versioned image tag, e.g. 2.2.2-0.18.1-dev) so the release field
in last-<job>.json is accurate. The build-testing.sh scripts
handle this automatically.
Lint matrix¶
CI runs all of these via scripts/ci-quality-checks.sh:
| Tool | Targets |
|---|---|
shellcheck |
Every tracked .sh and the app/ workers. |
shfmt |
Same. |
hadolint |
Dockerfile. |
yamllint |
Tracked YAML (.github/workflows, .hadolint.yaml, .pre-commit-config.yaml, examples/kubernetes/*.yaml). |
actionlint |
.github/workflows. |
docker compose config -q |
Compose YAML files in examples/compose/ and scripts/. |
Run locally:
shellcheck -x app/*.sh scripts/build-common.sh build*.sh
shfmt -d app/*.sh
hadolint Dockerfile
yamllint .
actionlint
bash scripts/ci-quality-checks.sh # the whole matrix
The ci-quality-checks.sh script also enforces:
- README size limit for Docker Hub (
README-containers.md≤ 25 000 bytes). - Versioning guard: when any non-metadata file changes,
VERSION,CHANGELOG.md,README.mdandREADME-containers.mdmust all be touched and the release strings must line up.
Building the docs site¶
Edit any file under docs/, save, and the dev server hot-reloads.
To produce a static build:
--strict fails on broken internal links and unknown nav entries —
good to run before opening a PR that touches docs.
Worker-script invariants¶
If you add or modify a worker under app/:
- Source
app/lib.shforlog,errorlog,logLast,copyErrorLog,mask_repository,mask_endpoint,notify_mail,notify_webhook,render_last_run_json,write_last_run_json,write_metrics_for_job. - Write
/var/log/<worker>-last.logfor the per-run log and/var/log/last-<job>.jsonfor the structured summary. - Call
notify_mailandnotify_webhooksoMAILX_RCPT/WEBHOOK_URLplumbing applies consistently. - Emit
restic_<job>.promviawrite_metrics_for_jobwhenMETRICS_DIRis set. - Add
/hooks/pre-<worker>.shand/hooks/post-<worker>.shinvocations at the right places, withHOOK_TIMEOUThonoured. - Update
app/doctor.shto report relevant config for the new worker. - Add tests/smoke coverage where appropriate.
Versioning¶
See Versioning policy for the semver rules. Short version:
- PATCH: bugfix, docs-only, rebuild tweaks.
- MINOR: new feature, env var, hook, materially new behaviour.
- MAJOR: breaking config / path / runtime contract change.
The version guard in ci-quality-checks.sh forces VERSION,
CHANGELOG.md, README.md and README-containers.md to stay in sync.
Pull request checklist¶
- Run
pre-commit run --all-files. - Run
bash scripts/ci-quality-checks.shlocally if you can. - Update
CHANGELOG.mdwith a one-line entry under the next version. - Update
VERSIONand therelease:lines in both READMEs if your change touches non-metadata files. - Open the PR against
develop.
See also¶
- Architecture — for understanding the pieces you might touch.
- Versioning policy — for picking the right bump.