-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add release history cleaning function #4813
Conversation
# Conflicts: # README.md
Codecov Report
@@ Coverage Diff @@
## master #4813 +/- ##
============================================
+ Coverage 47.89% 48.26% +0.37%
- Complexity 1701 1722 +21
============================================
Files 346 346
Lines 10697 10778 +81
Branches 1066 1075 +9
============================================
+ Hits 5123 5202 +79
+ Misses 5258 5254 -4
- Partials 316 322 +6
... and 4 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/config/BizConfig.java
Show resolved
Hide resolved
apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/config/BizConfig.java
Outdated
Show resolved
Hide resolved
apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/service/ReleaseHistoryService.java
Outdated
Show resolved
Hide resolved
apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/service/ReleaseHistoryService.java
Outdated
Show resolved
Hide resolved
apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/service/ReleaseHistoryService.java
Outdated
Show resolved
Hide resolved
apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/service/ReleaseHistoryService.java
Show resolved
Hide resolved
apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/service/ReleaseHistoryService.java
Outdated
Show resolved
Hide resolved
apollo-biz/src/test/java/com/ctrip/framework/apollo/biz/service/ReleaseHistoryServiceTest.java
Outdated
Show resolved
Hide resolved
@@ -42,4 +44,9 @@ Page<ReleaseHistory> findByAppIdAndClusterNameAndNamespaceNameOrderByIdDesc(Stri | |||
@Query("update ReleaseHistory set IsDeleted = true, DeletedAt = ROUND(UNIX_TIMESTAMP(NOW(4))*1000), DataChange_LastModifiedBy = ?4 where AppId=?1 and ClusterName=?2 and NamespaceName = ?3 and IsDeleted = false") | |||
int batchDelete(String appId, String clusterName, String namespaceName, String operator); | |||
|
|||
@Query(value = "select Id from ReleaseHistory where AppId=?1 and ClusterName=?2 and NamespaceName = ?3 and BranchName = ?4 and IsDeleted = false order by Id desc Limit 1 offset ?5", nativeQuery = true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need to use native query here as it may not work well with other databases. I can see the limit offset setup but I suppose it could be replaced with Pageable
?
apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/config/BizConfig.java
Show resolved
Hide resolved
apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/config/BizConfig.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What's the purpose of this PR
apollo.release-history.retention.size
configuration to set the global retention time for release history, or use theapollo.release-history.retention.size.override
configuration to finely control the number of release history for each appId+clusterName+namespaceName+branchName.Which issue(s) this PR fixes:
Fixes #3208