Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
v0.3.0 merge into main