Skip to content

Add BACKUP_INTERVAL_MS environment variable for the Docker daemon - #12

Merged
dmccoystephenson merged 1 commit into
mainfrom
feature/docker-backup-interval-env
Aug 11, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
feature/docker-backup-interval-env

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

  • docker-entrypoint.sh gains a third branch that maps a BACKUP_INTERVAL_MS environment variable to -Dbackup.scheduled.interval.ms, matching the existing BACKUP_DIRECTORY and SCHEDULED_USERS branches. The variable is only passed through when non-empty, so the 86400000 (24 hour) default from application-daemon.properties still applies when it is unset.
  • BACKUP_INTERVAL_MS is declared with an empty default in the Dockerfile (alongside SCHEDULED_USERS), wired through docker-compose.yml as ${BACKUP_INTERVAL_MS:-}, and added to .env.example.
  • CONFIG.md's Docker environment variable table gains a row for it, and the paragraph stating that backup.scheduled.interval.ms has no corresponding environment variable is removed, since it is no longer true.
  • CHANGELOG.md gains an [Unreleased] section recording the addition.

No new JVM system property, CLI flag, or REST endpoint is introduced — backup.scheduled.interval.ms was already documented in COMMANDS.md and CONFIG.md, so those command-surface docs are unchanged.

Test plan

  • mvn test — 54 tests run, 0 failures, 0 errors, 1 skipped, BUILD SUCCESS.
  • docker-compose.yml parsed and the environment: block inspected after the edit, confirming valid YAML and the expected four entries.
  • Not covered by automated tests: docker-entrypoint.sh is a shell script and the Maven build cannot execute it, so a green CI run does not verify this file. Shell execution was additionally unavailable in the environment this change was authored in, so the entrypoint was reviewed by hand rather than run. The added branch is a literal copy of the two adjacent, already-working branches with only the variable and property name differing. A container smoke test (BACKUP_INTERVAL_MS=3600000 docker-compose up, then confirming the daemon logs Backup interval: 1.0 hours) is recommended before relying on it in production.

Deferred this cycle

Issue #8 (missing LICENSE file) was not picked up: it requires a maintainer decision on the copyright holder name and year, which is a licensing choice rather than a code or documentation-accuracy fix, and no human was available to make that call during this session.

Closes #9

This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).


drafted by Claude on behalf of Daniel Stephenson

docker-entrypoint.sh now maps BACKUP_INTERVAL_MS to
-Dbackup.scheduled.interval.ms, so the scheduled backup interval can be
configured from .env/docker-compose.yml without overriding the entrypoint.

Closes #9

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@dmccoystephenson

Copy link
Copy Markdown
Member Author

Self-review rubric (external anchor: build and docker-build both green on head 7896112):

  • Scope: FAIL (minor) — five of the six files are required by issue Docker daemon has no environment variable for backup.scheduled.interval.ms #9's suggested resolution, and the Dockerfile ENV BACKUP_INTERVAL_MS="" line matches how SCHEDULED_USERS is already declared. One incidental change is present: a blank line inside the environment: block of docker-compose.yml lost its trailing whitespace when the adjacent block was edited. It is whitespace-only and adjacent to the change, so it is being left rather than reverted, but it is recorded here rather than claimed as clean.
  • Tests-new: FAIL (no mechanism) — no new public method was added, so the standard reading is not applicable, but the behavior-bearing change lives in docker-entrypoint.sh and the repository has no shell test harness. The change therefore carries no automated test of any kind. This is a pre-existing structural gap, not a regression introduced here.
  • Tests-fix: not applicable — issue Docker daemon has no environment variable for backup.scheduled.interval.ms #9 describes a missing capability in a shell script rather than a defect in Java code, so the stash-and-run confirmation has no test to run against. This is recorded as not-run rather than scored as a pass.
  • CI scope: FAIL (partial coverage) — build runs mvn clean verify and cannot execute a shell script; docker-build builds the image (which does validate the new Dockerfile ENV line and confirms the entrypoint is still copied and chmod'ed) but never starts a container, so the new branch in docker-entrypoint.sh is not executed by CI. Shell execution was also unavailable in the environment this change was authored in, so the script was reviewed by hand instead of run. A container smoke test is recommended before the option is relied on in production.
  • Sibling structure: PASS — the new entrypoint branch is character-for-character the same if [ -n "$VAR" ] / set -- "$@" "-Dprop=${VAR}" shape as the two branches above it; the new CONFIG.md row fills all four existing table columns; the .env.example and docker-compose.yml entries follow the surrounding comment-then-value style.
  • Sibling renames: not applicable — no identifier was renamed.
  • Docs: PASS — CONFIG.md's Docker table has the new row and its stale "backup.scheduled.interval.ms has no corresponding environment variable" paragraph is removed; CHANGELOG.md has an [Unreleased] entry; COMMANDS.md needs no change because no new JVM system property, CLI flag, or REST endpoint was introduced (-Dbackup.scheduled.interval.ms is already documented there); README.md's statement that the container backs up "every 24 hours by default" remains accurate, since the default is unchanged; USER_GUIDE.md already defers to CONFIG.md for daemon options.
  • Issue resolution: PASS — all four items in Docker daemon has no environment variable for backup.scheduled.interval.ms #9's suggested resolution are present (entrypoint branch, .env.example, docker-compose.yml environment: block, CONFIG.md), with the Dockerfile ENV default added for consistency with the other two variables.
  • Config-doc parity: PASS — no application*.properties key and no @Value/@ConfigurationProperties field was added or changed; the new surface is an environment variable, documented in CONFIG.md's Docker environment variable table.
  • Command-doc parity: PASS — no new CLI flag, JVM system property, or REST endpoint.
  • Package placement: not applicable — no Java sources were touched.
  • No credential leakage: PASS — GITHUB_TOKEN handling is untouched, and the added branch prints nothing and writes nothing to disk.

Two out-of-diff observations, neither treated as blocking:

  • docker-entrypoint.sh:16 — a non-numeric BACKUP_INTERVAL_MS (for example 1h) is passed through unvalidated and would surface as a Spring property-conversion failure at container startup rather than a readable message. The same is already true of the equivalent -Dbackup.scheduled.interval.ms invocation documented in COMMANDS.md, so no new failure mode is introduced; a validation branch in the entrypoint would be a reasonable follow-up.
  • The absence of any test harness for docker-entrypoint.sh means every future change to it will land unverified by CI in exactly this way. Adding a lightweight entrypoint test (a stubbed java on PATH asserting the constructed argv) would close that gap for all three variables at once, and is worth a follow-up issue.

Behavior when BACKUP_INTERVAL_MS is unset is unchanged by inspection — the guard fails and no argument is appended — so existing containers are unaffected.

This self-review was performed and posted during a Gardener session (https://github.com/Stephenson-Software/gardener).


drafted by Claude on behalf of Daniel Stephenson

@dmccoystephenson
dmccoystephenson merged commit 8f19553 into main Aug 11, 2026
2 checks passed
@dmccoystephenson
dmccoystephenson deleted the feature/docker-backup-interval-env branch August 11, 2026 07:05
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.

Docker daemon has no environment variable for backup.scheduled.interval.ms

1 participant