[PR #199] [MERGED] Use timezone-aware Scan start defaults #4122

Closed
opened 2026-08-30 17:52:26 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/reconurge/flowsint/pull/199
Author: @Ghraven
Created: 7/24/2026
Status: ✅ Merged
Merged: 7/28/2026
Merged by: @dextmorgn

Base: main ← Head: fix/scan-started-at-aware-utc


📝 Commits (1)

  • 0a47d8b Use timezone-aware Scan start defaults

📊 Changes

2 files changed (+2 additions, -2 deletions)

View changed files

📝 flowsint-core/src/flowsint_core/core/models.py (+1 -1)
📝 flowsint-core/tests/factories.py (+1 -1)

📄 Description

Summary

  • replace the Scan.started_at datetime.utcnow default with a timezone-aware UTC timestamp
  • update the matching factory default so tests/builders create the same style of value

Problem

datetime.utcnow() returns a naive datetime object. The rest of this package already uses datetime.now(timezone.utc) in several timestamp paths, so Scan.started_at could be inconsistent with timezone-aware values.

Before / After

Before: newly-created Scan rows and ScanFactory instances received naive UTC datetimes.

After: both defaults produce timezone-aware UTC datetimes.

Verification

  • python -m py_compile flowsint-core/src/flowsint_core/core/models.py flowsint-core/tests/factories.py
  • $env:AUTH_SECRET='test-secret-for-local-pytest'; $env:REDIS_URL='redis://localhost:6379/0'; $env:MASTER_VAULT_KEY_V1='base64:qnHTmwYb+uoygIw9MsRMY22vS5YPchY+QOi/E79GAvM='; $env:NEO4J_URI_BOLT='bolt://127.0.0.1:7687'; $env:NEO4J_USERNAME='neo4j'; $env:NEO4J_PASSWORD='test-password'; uv run --package flowsint-core pytest flowsint-core/tests/services/test_timezone_timestamps.py flowsint-core/tests/repositories/test_scan_repository.py -q

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/reconurge/flowsint/pull/199 **Author:** [@Ghraven](https://github.com/Ghraven) **Created:** 7/24/2026 **Status:** ✅ Merged **Merged:** 7/28/2026 **Merged by:** [@dextmorgn](https://github.com/dextmorgn) **Base:** `main` ← **Head:** `fix/scan-started-at-aware-utc` --- ### 📝 Commits (1) - [`0a47d8b`](https://github.com/reconurge/flowsint/commit/0a47d8b625e64e6060fcb586938a694b479cfece) Use timezone-aware Scan start defaults ### 📊 Changes **2 files changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `flowsint-core/src/flowsint_core/core/models.py` (+1 -1) 📝 `flowsint-core/tests/factories.py` (+1 -1) </details> ### 📄 Description ## Summary - replace the `Scan.started_at` `datetime.utcnow` default with a timezone-aware UTC timestamp - update the matching factory default so tests/builders create the same style of value ## Problem `datetime.utcnow()` returns a naive datetime object. The rest of this package already uses `datetime.now(timezone.utc)` in several timestamp paths, so `Scan.started_at` could be inconsistent with timezone-aware values. ## Before / After Before: newly-created `Scan` rows and `ScanFactory` instances received naive UTC datetimes. After: both defaults produce timezone-aware UTC datetimes. ## Verification - `python -m py_compile flowsint-core/src/flowsint_core/core/models.py flowsint-core/tests/factories.py` - `$env:AUTH_SECRET='test-secret-for-local-pytest'; $env:REDIS_URL='redis://localhost:6379/0'; $env:MASTER_VAULT_KEY_V1='base64:qnHTmwYb+uoygIw9MsRMY22vS5YPchY+QOi/E79GAvM='; $env:NEO4J_URI_BOLT='bolt://127.0.0.1:7687'; $env:NEO4J_USERNAME='neo4j'; $env:NEO4J_PASSWORD='test-password'; uv run --package flowsint-core pytest flowsint-core/tests/services/test_timezone_timestamps.py flowsint-core/tests/repositories/test_scan_repository.py -q` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-08-30 17:52:27 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/flowsint#4122