Skip to content

v0.3.0 merge into Main#16

Merged
crzykidd merged 15 commits into
mainfrom
dev
May 13, 2026
Merged

v0.3.0 merge into Main#16
crzykidd merged 15 commits into
mainfrom
dev

Conversation

@crzykidd

Copy link
Copy Markdown
Owner

v0.3.0 merge into main

crzykidd added 15 commits May 10, 2026 13:46
Adds logging_setup.py exposing get_logger(name). main.py and both
notifier modules now consume it instead of declaring their own
RotatingFileHandler / StreamHandler / formatter blocks.

Logger names, log format, destination, and rotation size are unchanged.
backupCount is unified at 4 (matching main.py; notifier modules had 1).

Replaces DNS_LOG_TO_STDOUT and STD_LOG_TO_STDOUT with a single
NOTIFIER_LOG_TO_STDOUT (default "1" — console on, behavior preserved
for operators who never set the old vars).
…ailures

Adds retry.py at the repo root exposing a single `with_retry` decorator
that wraps tenacity with the project-wide policy (3 attempts,
exponential backoff 2s/4s/8s capped at 10s, retries on
requests.RequestException). Both notifier modules now consume it; the
inline @Retry block in service_tracker_dashboard.py is removed.

DNS notifier behavior changes (intentional, called out in CHANGELOG):
  - Calls raise_for_status() so HTTP 4xx/5xx from Technitium triggers
    the retry path instead of being silently logged as success.
  - Except clause narrowed from bare Exception to requests.RequestException.
    Programming errors (e.g. malformed params) now propagate to the
    outer handler in main.py rather than being swallowed.

The early-return on missing DNS_SERVER_URL / DNS_SERVER_API_TOKEN
still fires before any retry logic, so DNS remains inert when the env
vars are absent.

PRD §5.2 issue N1 marked resolved. README updated to describe the
shared policy.

Dev smoke test: brought up docker-compose-dev.yml, restarted, confirmed
clean boot and STD register flow. Spun up a throwaway nginx with
dockernotifier.notifiers=dns to exercise the DNS path; logged the
expected "Missing DNS_SERVER_URL or DNS_SERVER_API_TOKEN" no-op line
with no crash.
main.py builds a single base_kwargs dict in handle_container_event
and passes it to every notifier alongside any notifier-specific
extras. Adds `action` to the contract so notifier modules see why
they were invoked without inventing per-module conventions.

Also removes the brittle stack-name fallback: when
`com.docker.compose.project` is missing, stack_name is now None
rather than the first `_`-split segment of the container name.
Signature is now keyword-only DNS extras (container_fqdn, zone,
value) plus **kwargs for the common notifier base contract.
container_name, docker_host, and stack_name are read out of
kwargs for the log line and record comment, with sane fallbacks
if absent. trigger_reason stays for now and is dropped in a
later session.
Adds a docstring describing the input contract the function
already accepts: common base kwargs from main.py plus stripped
`dockernotifier.std.*` labels, forwarded verbatim as the JSON
payload. No behavior change.
- Promote CHANGELOG [Unreleased] to [0.3.0] dated today.
- Open a new empty [Unreleased] section.
- Update CHANGELOG link references.
- Update PRD voice/tense for shipped v0.3.0 work.
- Update README forward-looking language to shipped voice.
@crzykidd crzykidd merged commit 895d986 into main May 13, 2026
2 checks passed
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