codeant-ai-for-open-source[bot] commented on code in PR #44190: URL: https://github.com/apache/superset/pull/44190#discussion_r4136136387
########## docs/docs/using-superset/recently-archived.mdx: ########## @@ -97,5 +104,95 @@ checks again when you submit. If dependencies changed while the confirmation was open, the refreshed impact replaces the previous result and you must type DELETE again before proceeding. -Objects are also deleted permanently on their own once they have been in the -archive longer than the retention window, without anyone acting. +Scheduled retention can also permanently delete archived objects after the +retention window, subject to deletion rules and the operator configuration +described below. A successful run is required; reaching the age threshold +alone does not delete an object. + +## Configuring retention (operators) + +The `deletion_retention.purge_soft_deleted` background task purges eligible +archived objects older than the retention window. The default Celery beat +configuration schedules it daily at 00:00 in the configured Celery timezone. +The task skips purging when `SOFT_DELETE` is off or the window is zero. +The window resolves in this order: + +1. A host policy, when one is installed as `SOFT_DELETE_RETENTION_DAYS_FUNC`. + Its result is authoritative; the two sources below are not consulted. + +2. Otherwise a per-deployment value set with the CLI, when present: + + ```bash + superset deletion-retention set-window --days 60 + superset deletion-retention show-window # print the effective window + ``` + +3. Otherwise the `SOFT_DELETE_RETENTION_DAYS` configuration value, which is + seeded from the environment variable of the same name and defaults to 30. + +Every source accepts whole days from -1 through 36500: + +- Zero disables scheduled purging, so archived objects are kept until someone + deletes them permanently by hand. +- `-1` makes every archived object eligible on the next scheduled run. It does + not start a run, and an object with a future archive time stays ineligible. +- Any other negative value, a value above 36500, or a non-integer is invalid. + +An invalid value defers purging; it never shortens the window. The CLI refuses +to store one. An invalid stored value, configuration value, or host policy +result (including a host policy that fails) is treated as zero and logs a +warning. Only an absent stored value falls back to configuration, and only an +absent configuration value uses the 30-day default. + +`SOFT_DELETE_PURGE_DRY_RUN` defaults to `False`: scheduled purging is +destructive when it runs. Set it to `True` in `superset_config.py` and restart +the relevant processes to log what the task *would* purge without deleting +anything. Validate the eligible backlog before enabling live purging or +shortening a window; the first live run can process accumulated old archives. + +### Running retention tasks + +For automatic retention, operators need all of the following: + +- A running Celery beat scheduler and workers connected to the appropriate + broker and queues. See [Celery configuration](/admin-docs/configuration/async-queries-celery/). +- Task registration on the workers. The default `CELERY_CONFIG.imports` + includes `superset.tasks.deletion_retention` and + `superset.tasks.version_history_retention`. +- Entries in `CELERY_CONFIG.beat_schedule` for + `deletion_retention.purge_soft_deleted` and + `version_history.prune_old_versions`. When replacing `CELERY_CONFIG`, + preserve the default imports and schedules or supply equivalent entries; + task registration alone does not schedule execution. Review Comment: **Suggestion:** The checklist says the default configuration registers and schedules version-history pruning, but the Docker Celery configuration replaces those defaults and omits that task. **Assessment:** ๐ `Major` ยท ๐ `Occurrence: Sometimes` ยท ๐ท๏ธ `Api mismatch` [](https://docs.codeant.ai/cli/resolve-pr-comments-skill) [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=4bfec6a2cad64a44a76457190e251b2a&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=4bfec6a2cad64a44a76457190e251b2a&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) <details> <summary><b>Prompt for AI Agent ๐ค </b></summary> ```mdx This is a comment left during a code review. **Path:** docs/docs/using-superset/recently-archived.mdx **Line:** 159:166 **Comment:** *Api Mismatch: The checklist says the default configuration registers and schedules version-history pruning, but the Docker Celery configuration replaces those defaults and omits that task. Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise. Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix ``` </details> <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F44190&comment_hash=dee1cc99020175cac22fc77a89faaebaa5dd91864eeb9be01db30f74535d7e89&reaction=like'>๐</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F44190&comment_hash=dee1cc99020175cac22fc77a89faaebaa5dd91864eeb9be01db30f74535d7e89&reaction=dislike'>๐</a> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
