Skip to content

fix: schedule audit retention cleanup - #51

Merged
OkiriGabriel merged 2 commits into
open-devops-agent:mainfrom
Nitjsefnie-OSC:candidate/open-devops-agent-8-retention-20260819
Aug 31, 2026
Merged

OkiriGabriel merged 2 commits into
open-devops-agent:mainfrom
Nitjsefnie-OSC:candidate/open-devops-agent-8-retention-20260819

Conversation

@Nitjsefnie

Copy link
Copy Markdown
Contributor

Description

Schedule the existing audit-retention helper from the API lifespan so cleanup runs once at startup and then every 24 hours for every configured organization. The task is cancelled and awaited during shutdown, and one organization's failure does not stop cleanup for the others.

Fixes #8

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring
  • New platform/collector support

Platform/Component

  • Core Agent
  • Kubernetes
  • CI/CD (specify: ____________)
  • Cloud Provider (specify: ____________)
  • ArgoCD
  • Docker
  • API Server
  • Tools/Executor
  • Documentation
  • Tests

Testing

  • Unit tests added/updated
  • Integration tests pass
  • Manual testing performed
  • Tested with dummy data
  • Tested in production-like environment

Test Configuration

OS: GitHub Actions Ubuntu runners
Python Version: 3.10, 3.11, 3.12
Kubernetes Version: not applicable
Cloud Provider: not applicable

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Screenshots (if applicable)

Not applicable.

Breaking Changes

None.

Additional Notes

  • Exact candidate dabf8826292ca8c282df49f973adc90d9fac38e2 passed all 10 fork-CI jobs on Python 3.10, 3.11, and 3.12, including lint, security, integration, collectors, tools, Docker, and documentation checks.
  • [BUG] Retention does not delete stored checkpoint or queue entries #50 [BUG] Retention does not delete stored checkpoint or queue entries
  • No documentation change is needed because AUDIT_RETENTION_DAYS is already documented; this change activates the existing setting.

Reviewer Checklist

  • Code quality is acceptable
  • Tests are comprehensive
  • Documentation is updated
  • No security concerns
  • Performance impact is acceptable

Generated by Kimi K3 (implementation, testing, verification), GPT-5.6 Sol (brief, review)

Nitjsefnie and others added 2 commits August 19, 2026 07:04
…-agent#8)

Lifespan startup must run one retention pass over the de-duplicated
union of ORG_ID and ORG_IDS; the spy-based test is RED until the
scheduler exists. Also characterize apply_retention aged-key deletion.

Co-Authored-By: Kimi K3 <[email protected]>
…ent#8)

apply_retention() was implemented but never invoked. Run one retention
pass at API startup, then every 24 hours, over the de-duplicated union
of ORG_ID and ORG_IDS. One org's storage failure is logged and does not
stop the remaining orgs; the task is cancelled and awaited at shutdown.

Co-Authored-By: Kimi K3 <[email protected]>
@OkiriGabriel

Copy link
Copy Markdown
Collaborator

Reviewed — CI is green across all checks. Audit retention cleanup scheduling looks good. Merging to main.

@OkiriGabriel
OkiriGabriel merged commit dfdadab into open-devops-agent:main Aug 31, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Schedule audit retention cleanup (AUDIT_RETENTION_DAYS)

2 participants