Repository navigation
feat: support permanent deletion of monthly workflow archives - #44052
Conversation
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-10-14 07:37:02.645675863 +0000
+++ /tmp/pyrefly_pr.txt 2026-10-14 07:36:54.385560362 +0000
@@ -5741,9 +5741,9 @@
ERROR No matching overload found for function `typing.MutableMapping.update` called with arguments: (dict[str, object]) [no-matching-overload]
--> tests/unit_tests/services/rag_pipeline/test_rag_pipeline_transform_service.py:46:18
ERROR Argument `dict[str, dict[str, int | str]]` is not assignable to parameter `tables` with type `dict[str, ArchiveBundleTableManifestEntry]` in function `services.retention.workflow_run.archive_bundle_index.ArchiveBundleManifest.__init__` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_archive_download_preparation.py:153:16
+ --> tests/unit_tests/services/retention/workflow_run/test_archive_download_preparation.py:163:16
ERROR Cannot index into `dict[str, bytes]` [bad-index]
- --> tests/unit_tests/services/retention/workflow_run/test_archive_download_preparation.py:243:52
+ --> tests/unit_tests/services/retention/workflow_run/test_archive_download_preparation.py:343:52
ERROR Argument `FakeRedis` is not assignable to parameter `redis` with type `RedisClientWrapper` in function `services.retention.workflow_run.archive_download_task_cache.WorkflowRunArchiveDownloadTaskCache.__init__` [bad-argument-type]
--> tests/unit_tests/services/retention/workflow_run/test_archive_download_task_cache.py:124:55
ERROR Argument `FakeRedis` is not assignable to parameter `redis` with type `RedisClientWrapper` in function `services.retention.workflow_run.archive_download_task_cache.WorkflowRunArchiveDownloadTaskCache.__init__` [bad-argument-type]
@@ -5753,9 +5753,9 @@
ERROR Argument `FakeRedis` is not assignable to parameter `redis` with type `RedisClientWrapper` in function `services.retention.workflow_run.archive_download_task_cache.WorkflowRunArchiveDownloadTaskCache.__init__` [bad-argument-type]
--> tests/unit_tests/services/retention/workflow_run/test_archive_download_task_cache.py:188:55
ERROR Argument `(_task: WorkflowRunArchiveDownloadTask) -> None` is not assignable to parameter `dispatcher` with type `WorkflowRunArchiveDownloadTaskDispatcher | None` in function `_service` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_archive_log_service.py:303:69
+ --> tests/unit_tests/services/retention/workflow_run/test_archive_log_service.py:340:69
ERROR Argument `(_storage_key: str, *, expires_in: int, filename: str) -> str` is not assignable to parameter `sign_download_url` with type `WorkflowRunArchiveDownloadUrlSigner` in function `services.retention.workflow_run.archive_log_service.WorkflowRunArchiveService.__init__` [bad-argument-type]
- --> tests/unit_tests/services/retention/workflow_run/test_archive_log_service.py:368:27
+ --> tests/unit_tests/services/retention/workflow_run/test_archive_log_service.py:405:27
ERROR Argument `list[FromClause]` is not assignable to parameter `tables` with type `Sequence[Table] | None` in function `sqlalchemy.sql.schema.MetaData.create_all` [bad-argument-type]
--> tests/unit_tests/services/retention/workflow_run/test_restore_archived_workflow_run.py:58:16
ERROR Argument `str` is not assignable to parameter `run_status` with type `SQLCoreOperations[WorkflowExecutionStatus] | WorkflowExecutionStatus` in function `models.workflow.WorkflowArchiveLog.__init__` [bad-argument-type]
|
Pyrefly Type Coverage
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #44052 +/- ##
==========================================
+ Coverage 88.92% 88.94% +0.01%
==========================================
Files 5332 5336 +4
Lines 329404 329761 +357
Branches 65910 65980 +70
==========================================
+ Hits 292923 293303 +380
+ Misses 31282 31258 -24
- Partials 5199 5200 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
CryoThrust
left a comment
There was a problem hiding this comment.
I checked the deletion/download failure boundaries on cf8935b98c and found two recovery gaps below.
Eight local method-boundary controls/observations completed: ordinary deletion, no-request protection, explicit retry after partial failure, real Celery success/retry handling, and delayed uploads after lease loss. The probe executes the unchanged deletion/preparation/storage methods and task decorator with Celery 5.6.3 and Pydantic 2.12.5; catalog, storage client, cache and lease ownership are controlled collaborators. ZIP conversion is stubbed. This is not the full API suite or live DB/Redis/S3 validation.
(cherry picked from commit c11b36c)
Summary
Fixes #44051.
Add owner-only permanent deletion of a selected month in Workflow Log Archives, with an irreversible-action confirmation, progress, retry, and lifecycle audit logs. Deletion durably blocks downloads, uses the existing
workflow_archivequeue to remove archive objects and prepared ZIPs, and removes catalog records after successful cleanup. Live workflow-run data is outside this action.Keep retention cleanup resumable when a saved catalog cursor has been deleted: the cursor remains an exclusive ID boundary and the query retains its month, tenant, and shard filters.
Checklist
make lint && make type-checkand frontendvp staged(focused checks above).