Skip to content

Conversation

chlins
Copy link
Member

@chlins chlins commented Apr 23, 2025

This pull request introduces changes to support a default garbage collection (GC) configuration in the database layer. The most important updates include adding new constants and types for GC configuration, seeding the database with a default GC configuration, and importing necessary dependencies.

Database enhancements:

  • manager/database/database.go: Updated the seed function to create a default GC configuration in the database if it does not already exist. This involves defining default TTL values for audit and job configurations, serializing them to JSON, and storing them in the Config table.

Configuration model updates:

  • manager/models/config.go: Added constants for the GC configuration name (ConfigGC) and default TTL values (DefaultGCJobTTL, DefaultGCAuditTTL). These values are used to define the default behavior for GC operations.
  • manager/models/config.go: Introduced new types GCConfig, GCAuditConfig, and GCJobConfig to represent the structure of the GC configuration, including TTL fields for audit and job settings.

Dependency updates:

Description

Related Issue

#3811

Motivation and Context

Screenshots (if appropriate)

Types of changes

  • 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 change)
  • Documentation Update (if none of the other choices apply)

Checklist

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

Signed-off-by: chlins <chlins.zhang@gmail.com>
@chlins chlins added the enhancement New feature or request label Apr 23, 2025
@chlins chlins added this to the v2.3.0 milestone Apr 23, 2025
@chlins chlins requested a review from a team as a code owner April 23, 2025 08:57
Copy link

codecov bot commented Apr 23, 2025

Codecov Report

❌ Patch coverage is 0% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 34.37%. Comparing base (0cfd020) to head (0ac6e45).
⚠️ Report is 215 commits behind head on main.

Files with missing lines Patch % Lines
manager/database/database.go 0.00% 23 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3987      +/-   ##
==========================================
- Coverage   34.40%   34.37%   -0.03%     
==========================================
  Files         341      341              
  Lines       40072    40095      +23     
==========================================
- Hits        13787    13783       -4     
- Misses      25377    25403      +26     
- Partials      908      909       +1     
Flag Coverage Δ
unittests 34.37% <0.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
manager/database/database.go 0.00% <0.00%> (ø)

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@gaius-qi gaius-qi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

@Liam-Zhao Liam-Zhao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chlins chlins enabled auto-merge (squash) April 23, 2025 09:08
@chlins chlins merged commit a61d870 into main Apr 23, 2025
27 of 28 checks passed
@chlins chlins deleted the feat/gc-config branch April 23, 2025 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request security
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants