diff --git a/CHANGELOG.md b/CHANGELOG.md index 222bf8b5118..d6d57a10e93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ The types of changes are: * Escape the Redis user and password to make them URL friendly [#1104](https://github.com/ethyca/fidesops/pull/1104) * Reduced number of connections opened against app db during health checks [#1107](https://github.com/ethyca/fidesops/pull/1107) * Fix FIDESOPS__ROOT_USER__ANALYTICS_ID generation when env var is set [#1113](https://github.com/ethyca/fidesops/pull/1113) +* Set localhost to None for non-endpoint events [#1130](https://github.com/ethyca/fidesops/pull/1130) ### Changed diff --git a/src/fidesops/ops/graph/analytics_events.py b/src/fidesops/ops/graph/analytics_events.py index 8ad6387d5c0..9fb743ba4ce 100644 --- a/src/fidesops/ops/graph/analytics_events.py +++ b/src/fidesops/ops/graph/analytics_events.py @@ -79,7 +79,7 @@ def prepare_rerun_graph_analytics_event( if step == ActionType.access else "rerun_erasure_graph", event_created_at=datetime.now(tz=timezone.utc), - local_host=False, # Temporarily defaulting to False, but we are going to change this to None + local_host=None, endpoint=None, status_code=None, error=None, @@ -98,7 +98,7 @@ def failed_graph_analytics_event( docker=in_docker_container(), event="privacy_request_execution_failure", event_created_at=datetime.now(tz=timezone.utc), - local_host=False, # Temporarily defaulting to False, but we are going to change this to None + local_host=None, endpoint=None, status_code=500, error=exc.__class__.__name__ if exc else None, diff --git a/tests/ops/graph/test_graph_analytics_events.py b/tests/ops/graph/test_graph_analytics_events.py index d5451cc2bf3..20b90fd1b8a 100644 --- a/tests/ops/graph/test_graph_analytics_events.py +++ b/tests/ops/graph/test_graph_analytics_events.py @@ -17,4 +17,4 @@ def test_create_failed_privacy_request_event(self, privacy_request): assert analytics_event.error == "FidesopsException" assert analytics_event.status_code == 500 assert analytics_event.endpoint is None - assert analytics_event.local_host is False + assert analytics_event.local_host is None diff --git a/tests/ops/graph/test_graph_differences.py b/tests/ops/graph/test_graph_differences.py index 78ef722c15c..347263e6ac7 100644 --- a/tests/ops/graph/test_graph_differences.py +++ b/tests/ops/graph/test_graph_differences.py @@ -881,7 +881,7 @@ def test_rerun_access_graph_analytics_event( assert analytics_event.error is None assert analytics_event.status_code is None assert analytics_event.endpoint is None - assert analytics_event.local_host is False + assert analytics_event.local_host is None def test_rerun_erasure_graph_analytics_event( self, privacy_request, env_a_b, env_a_b_c, resources @@ -914,4 +914,4 @@ def test_rerun_erasure_graph_analytics_event( assert analytics_event.error is None assert analytics_event.status_code is None assert analytics_event.endpoint is None - assert analytics_event.local_host is False + assert analytics_event.local_host is None diff --git a/tests/ops/integration_tests/test_execution.py b/tests/ops/integration_tests/test_execution.py index d2c723de180..3cdce2d83b7 100644 --- a/tests/ops/integration_tests/test_execution.py +++ b/tests/ops/integration_tests/test_execution.py @@ -675,7 +675,7 @@ def test_restart_graph_from_failure( assert analytics_event.error is None assert analytics_event.status_code is None assert analytics_event.endpoint is None - assert analytics_event.local_host is False + assert analytics_event.local_host is None assert ( db.query(ExecutionLog) @@ -806,7 +806,7 @@ def test_restart_graph_from_failure_during_erasure( assert analytics_event.error is None assert analytics_event.status_code is None assert analytics_event.endpoint is None - assert analytics_event.local_host is False + assert analytics_event.local_host is None assert ( db.query(ExecutionLog) diff --git a/tests/ops/service/privacy_request/request_runner_service_test.py b/tests/ops/service/privacy_request/request_runner_service_test.py index b0ff85ccbc7..0d7e15f73b8 100644 --- a/tests/ops/service/privacy_request/request_runner_service_test.py +++ b/tests/ops/service/privacy_request/request_runner_service_test.py @@ -1545,7 +1545,7 @@ def test_privacy_request_log_failure( assert sent_event.event == "privacy_request_execution_failure" assert sent_event.event_created_at is not None - assert sent_event.local_host is False + assert sent_event.local_host is None assert sent_event.endpoint is None assert sent_event.status_code == 500 assert sent_event.error == "KeyError"