Release/v0.0.5#4
Conversation
Added notifier mutmut paths, selective test invocation settings, and updated the notifier changelog with an unreleased entry for mutation-testing support.
…regression tests Added license header blocks to notifier regression/middleware test files, removed a nondeterministic comment in the rate limit edge test, and made notification payload assertion handling more robust.
…is SQLite, so CI no longer tries to reconnect to an unavailable PostgreSQL instance during cleanup
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Pull request overview
Release v0.0.5 updates the notifier codebase to use more typed “context/request” objects across alerting, storage, Jira, and notification flows, while adding mutation-testing configuration and standardizing Apache headers across tests.
Changes:
- Add
mutmutconfiguration and adjust lint/type-check settings for mutation artifacts. - Refactor multiple APIs to accept typed request/context models (e.g.,
AlertQuery,NotificationDispatchContext,PublicEndpointSecurityConfig, Jira request types, access-context types). - Add/normalize Apache 2.0 license headers across many test and source files; bump version to
0.0.5and update OpenAPI/changelog.
Reviewed changes
Copilot reviewed 167 out of 168 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_vault_client_edges.py | Add Apache header. |
| tests/test_url_utils.py | Header format tweak; add CGNAT IP safety test. |
| tests/test_storage_tenant_isolation_matrix.py | Update incident access calls to use IncidentAccessContext. |
| tests/test_storage_incidents_helpers_and_service.py | Update incident access checks/mocks to new typed inputs and renamed fields. |
| tests/test_storage_channels.py | Update channel service construction and access arg name (access=). |
| tests/test_storage_and_alertmanager_edges.py | Update alertmanager notify + incident access to new context objects. |
| tests/test_silences_ops.py | Relax context manager __exit__ signature. |
| tests/test_silence_metadata.py | Header format tweak. |
| tests/test_service_branch_closure_batch.py | Update Jira API tests to request/target dataclasses; loosen __exit__. |
| tests/test_security_dependencies.py | Update public endpoint security to PublicEndpointSecurityConfig. |
| tests/test_rules_router_registration.py | Header format tweak. |
| tests/test_rules_ops.py | Header format tweak. |
| tests/test_ruler_yaml.py | Header format tweak. |
| tests/test_rule_import_service.py | Header format tweak. |
| tests/test_regression_refactor_coverage_fillers.py | New regression/coverage filler tests for refactored call surfaces. |
| tests/test_regression_notification_service_email_provider_matrix.py | Update SMTP helpers to accept smtp= config object. |
| tests/test_regression_notification_service_dispatch_matrix.py | Add Apache header. |
| tests/test_regression_notification_senders_contracts.py | Update HTTP transport mock to accept request object. |
| tests/test_regression_incident_status_and_jira_sync.py | Add Apache header; loosen mocked args. |
| tests/test_regression_incident_resolution_guardrails.py | Update alertmanager get_alerts mocking to positional args; adjust assertions. |
| tests/test_regression_incident_recipient_email_parsing.py | Add Apache header. |
| tests/test_regression_incident_assignment_background_tasks.py | Update background task assertions to payload positional arg. |
| tests/test_regression_channels_test_endpoint_matrix.py | Add Apache header. |
| tests/test_regression_channel_validators_no_gap_matrix.py | Add Apache header. |
| tests/test_regression_alert_delivery_notify_for_alerts_workflow.py | Update notify flow to use NotificationDispatchContext. |
| tests/test_refactor_compat_coverage_edges.py | Update compatibility tests to new route error + SMTP + Jira request models. |
| tests/test_openapi_middleware.py | Add Apache header; monkeypatch Path.read_text signature loosened. |
| tests/test_notification_validators.py | Header format tweak. |
| tests/test_notification_transport.py | Update SMTP transport call to pass SmtpDeliveryConfig. |
| tests/test_notification_service_email_edges.py | Update incident assignment email API to accept payload object; update SMTP config usage. |
| tests/test_notification_service_and_encryption.py | Update assignment email + SMTP assertions to new payload/config objects. |
| tests/test_notification_service.py | Update email provider mocks to accept payload/smtp config objects. |
| tests/test_notification_senders_error_handling.py | Update HTTP transport mock signature. |
| tests/test_notification_senders.py | Update HTTP transport mock signature and captured request fields. |
| tests/test_notification_payloads.py | Make subject assertion tolerant of changed template output; loosen monkeypatch signature. |
| tests/test_notification_email_providers.py | Update email provider APIs to use EmailDeliveryPayload and SMTP config object. |
| tests/test_notification_and_helper_edges_more.py | Update email provider + SMTP + transport usage to new payload/config/request objects. |
| tests/test_middleware_rate_limit_database_resilience_edges.py | Rework DB module test to be more deterministic; update public endpoint security config calls. |
| tests/test_middleware_rate_limit_and_database_edges.py | Update public endpoint security config call; loosen __exit__. |
| tests/test_middleware_core.py | Update handle_route_errors usage to RouteErrorResponse. |
| tests/test_main_startup_edges.py | New tests for async startup DB bootstrap/retry behavior. |
| tests/test_main_entrypoint.py | Header format tweak. |
| tests/test_jira_helpers_edges.py | Header format tweak. |
| tests/test_integration_security_service.py | Loosen __exit__. |
| tests/test_integration_security_and_jira_service.py | Update Jira request + tenant config update dataclasses; loosen lambda signatures. |
| tests/test_incidents_router.py | Update background task payload assertions and incident access/update call expectations. |
| tests/test_incidents_recipient_email.py | Add Apache header. |
| tests/test_incident_helpers_and_serializers.py | Align serializer tests to updated channel/incident serialization behavior. |
| tests/test_incident_aggregation.py | Header format tweak. |
| tests/test_helper_surfaces.py | Header format tweak. |
| tests/test_group_share_revocation.py | Header format tweak. |
| tests/test_config_validation_edges.py | Adjust legacy JWT secret key test value. |
| tests/test_common_access_edges.py | Update access helpers to new request/assignment/check dataclasses. |
| tests/test_channels_ops_edges.py | Update channel ops notify flow to NotificationDispatchContext. |
| tests/test_channels_ops.py | Update notify call to NotificationDispatchContext. |
| tests/test_channel_delivery_visibility.py | Header tweak (contains a license URL typo). |
| tests/test_alerts_ops_metrics_edges.py | Update alerts ops API to pass AlertQuery. |
| tests/test_alertmanager_stateful_workflows.py | Update fake storage service signatures + notify hook to new context object. |
| tests/test_alerting_ops_and_transport.py | Update alerts ops + HTTP post + SMTP transport APIs to request/config objects. |
| tests/test_alert_ops.py | Header format tweak. |
| tests/conftest.py | Header format tweak. |
| tests/_regression_helpers.py | Header format tweak. |
| tests/_env.py | Add optional temp SQLite test DB bootstrap and one-time initialization. |
| tests/init.py | Header format tweak. |
| services/storage_db_service.py | Header punctuation/format normalization. |
| services/storage/serializers.py | Refactor channel serialization to be more defensive; add shared group id helper. |
| services/storage/incidents_sync.py | Introduce typed contexts for incident lookup and alert sync. |
| services/storage/incidents_jira.py | Header punctuation/format normalization. |
| services/storage/incidents_core.py | Update access checks to use shared AccessCheck dataclass. |
| services/storage/hidden_entity_storage.py | Add module header and make methods @staticmethod. |
| services/storage/init.py | Header format tweak. |
| services/secrets/vault_client.py | Header punctuation/format normalization. |
| services/secrets/provider.py | Header punctuation/format normalization. |
| services/notification/validators.py | Factor channel validation by type into helper functions. |
| services/notification/transport.py | Introduce HttpPostRequest; make SMTP send require SmtpDeliveryConfig explicitly. |
| services/notification/senders.py | Switch to HttpPostRequest when posting webhooks. |
| services/notification/payloads.py | Header punctuation/format normalization. |
| services/notification/email_providers.py | Move email delivery to EmailDeliveryPayload; use HttpPostRequest + explicit SMTP config. |
| services/jira/helpers.py | Tighten Jira credential resolution flow; avoid early returns and normalize behavior. |
| services/jira/init.py | Header punctuation/format normalization. |
| services/incidents/helpers.py | Header punctuation/format normalization. |
| services/incidents/init.py | Header punctuation/format normalization. |
| services/common/visibility.py | Header punctuation/format normalization. |
| services/common/url_utils.py | Refactor URL safety checks to a single “is_valid” flow using ip.is_global. |
| services/common/tenants.py | Header punctuation/format normalization. |
| services/common/pagination.py | Header punctuation/format normalization. |
| services/common/meta.py | Refactor parse_meta to reduce early returns and simplify parsing logic. |
| services/common/http_client.py | Header punctuation/format normalization. |
| services/common/encryption.py | Header punctuation/format normalization. |
| services/common/access.py | Introduce typed request/assignment/check dataclasses for access operations. |
| services/common/init.py | Header format tweak. |
| services/alertmanager_service.py | Update webhook security config usage; refactor get_alerts signature to accept AlertQuery. |
| services/alerting/suppression.py | Expand module docstring; add Apache header. |
| services/alerting/silences_ops.py | Header punctuation/format normalization. |
| services/alerting/silence_metadata.py | Header punctuation/format normalization. |
| services/alerting/rules_ops.py | Header punctuation/format normalization. |
| services/alerting/ruler_yaml.py | Header punctuation/format normalization. |
| services/alerting/rule_import_service.py | Header punctuation/format normalization. |
| services/alerting/integration_security_service.py | Add JiraTenantConfigUpdate dataclass; update save API; adjust warning message. |
| services/alerting/channels_ops.py | Introduce NotificationDispatchContext and helper functions to simplify notify pipeline. |
| services/alerting/alerts_ops.py | Introduce AlertQuery dataclass and update query construction. |
| services/alerting/init.py | Header format tweak. |
| services/init.py | Header format tweak. |
| routers/observability/jira/shared.py | Add expanded module docstring + Apache header. |
| routers/observability/jira/integrations.py | Add module docstring + Apache header (contains a typo). |
| routers/observability/jira/incident_links.py | Add module docstring + header; update Jira create issue + incident access contexts. |
| routers/observability/jira/discovery.py | Add module docstring + Apache header. |
| routers/observability/jira/config.py | Add module docstring + header; update to JiraTenantConfigUpdate. |
| routers/observability/jira/init.py | Add Apache header. |
| routers/observability/alerts/webhooks.py | Use NotificationDispatchContext wrapper for notification dispatch. |
| routers/observability/alerts/status.py | Header punctuation/format normalization. |
| routers/observability/alerts/silences.py | Introduce typed query model for list endpoint; update error handler API usage. |
| routers/observability/alerts/shared.py | Header punctuation/format normalization. |
| routers/observability/alerts/integrations.py | Header punctuation/format normalization. |
| routers/observability/alerts/channels.py | Introduce typed query model; update storage access contexts and error handler API usage. |
| routers/observability/alerts/alerts_routes.py | Introduce typed query model; update alert listing to use AlertQuery. |
| routers/observability/alerts/access.py | Add Apache header. |
| routers/observability/alerts/init.py | Add Apache header. |
| routers/observability/init.py | Header punctuation/format normalization. |
| routers/init.py | Header punctuation/format normalization. |
| pyproject.toml | Bump to v0.0.5; add mutmut config; adjust mypy/pylint settings. |
| openapi.yaml | Update version to 0.0.5. |
| models/alerting/silences.py | Header punctuation/format normalization. |
| models/alerting/rules.py | Header punctuation/format normalization. |
| models/alerting/requests.py | Header punctuation/format normalization. |
| models/alerting/receivers.py | Header punctuation/format normalization. |
| models/alerting/incidents.py | Header punctuation/format normalization. |
| models/alerting/channels.py | Header punctuation/format normalization. |
| models/alerting/alerts.py | Header punctuation/format normalization. |
| models/alerting/init.py | Header format tweak. |
| models/access/auth_models.py | Header punctuation/format normalization. |
| models/access/init.py | Header format tweak. |
| models/init.py | Header format tweak. |
| middleware/runtime_ssl.py | New helper for runtime SSL and dynamic uvicorn invocation. |
| middleware/resilience.py | Header punctuation/format normalization. |
| middleware/request_size_limit.py | Header punctuation/format normalization. |
| middleware/rate_limit/redis_fixed_window.py | Header punctuation/format normalization. |
| middleware/rate_limit/observability.py | Header punctuation/format normalization. |
| middleware/rate_limit/models.py | Header punctuation/format normalization. |
| middleware/rate_limit/ip.py | Simplify trusted proxy check flow. |
| middleware/rate_limit/in_memory.py | Header punctuation/format normalization. |
| middleware/rate_limit/hybrid.py | Header punctuation/format normalization. |
| middleware/rate_limit/init.py | Header punctuation/format normalization. |
| middleware/openapi.py | Header punctuation/format normalization. |
| middleware/headers.py | Header punctuation/format normalization. |
| middleware/error_handlers.py | Remove legacy override kwargs; standardize error response inputs via RouteErrorResponse. |
| middleware/dependencies.py | Introduce PublicEndpointSecurityConfig and update enforcement signature. |
| middleware/concurrency_limit.py | Header punctuation/format normalization. |
| middleware/init.py | Header punctuation/format normalization. |
| main.py | Add async startup DB bootstrap with retry/timeout; switch to runtime_ssl.run_uvicorn. |
| db_models.py | Header punctuation/format normalization. |
| database.py | Make ensure_database_exists a no-op for non-Postgres URLs. |
| custom_types/json.py | Header punctuation/format normalization. |
| custom_types/init.py | Header punctuation/format normalization. |
| config.py | Header punctuation/format normalization. |
| init.py | Header punctuation/format normalization. |
| CHANGELOG.md | Add v0.0.5 entry. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Intergrations management endpoints for Jira integration in the observability notifier router. | ||
| These endpoints allow users to create, update, delete, and list Jira integrations that are used |
There was a problem hiding this comment.
Docstring typo: "Intergrations" should be "Integrations".
| Copyright (c) 2026 Stefan Kumarasinghe | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the | ||
| License. You may obtain a copy of the License at | ||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
| """ |
There was a problem hiding this comment.
New test file’s Apache header formatting is inconsistent with the rest of the repo (missing period after the copyright line, and the license URL is split across lines). Standardizing the header helps automated license scanning and keeps headers uniform.
| def _bootstrap_database() -> None: | ||
| timeout_seconds = float(os.getenv("DATABASE_STARTUP_TIMEOUT", "180")) | ||
| retry_delay_seconds = float(os.getenv("DATABASE_STARTUP_RETRY_DELAY", "2")) |
There was a problem hiding this comment.
DATABASE_STARTUP_TIMEOUT / DATABASE_STARTUP_RETRY_DELAY are parsed with float(...) without validation; a non-numeric env var value will raise ValueError and fail startup with a confusing stack trace. Consider catching ValueError and either falling back to defaults or raising a clearer RuntimeError mentioning the invalid env var name/value.
| def _bootstrap_database() -> None: | |
| timeout_seconds = float(os.getenv("DATABASE_STARTUP_TIMEOUT", "180")) | |
| retry_delay_seconds = float(os.getenv("DATABASE_STARTUP_RETRY_DELAY", "2")) | |
| def _get_float_env(var_name: str, default: str) -> float: | |
| raw_value = os.getenv(var_name, default) | |
| try: | |
| return float(raw_value) | |
| except ValueError as exc: | |
| raise RuntimeError( | |
| f"Invalid value for {var_name}: {raw_value!r}. Expected a numeric value." | |
| ) from exc | |
| def _bootstrap_database() -> None: | |
| timeout_seconds = _get_float_env("DATABASE_STARTUP_TIMEOUT", "180") | |
| retry_delay_seconds = _get_float_env("DATABASE_STARTUP_RETRY_DELAY", "2") |
| Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the | ||
| License. You may obtain a copy of the License at | ||
| http://www.apache.org/licenses/LICENSE-2.0l | ||
| License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0l |
There was a problem hiding this comment.
Apache license URL in the header appears to have a typo (.../LICENSE-2.0l with a trailing l). This should be .../LICENSE-2.0 to match the standard Apache 2.0 link.
[v0.0.5] - 2026-04-21
Added
mutmutand selective notifier test execution.Changed