Repository navigation
feat: a revision cleanup strategy per type of space - #4111
Open
pbleser-oc wants to merge 4 commits into
Open
pbleser-oc wants to merge 4 commits into
pbleser-oc wants to merge 4 commits into
Conversation
Brings the revision cleanup strategy per type of space (opencloud-eu/reva#1042) and the corrected description of the age of a revision in the strategy option (opencloud-eu/reva#1041). Assisted-by: Claude Code:claude-opus-5-5
STORAGE_USERS_REVISIONS_CLEANUP_STRATEGY_PERSONAL and STORAGE_USERS_REVISIONS_CLEANUP_STRATEGY_PROJECT set the revision cleanup strategy of the personal and of the project spaces, for all storage drivers that support the cleanup. Empty, the default, leaves the spaces of that type to STORAGE_USERS_REVISIONS_CLEANUP_STRATEGY, "disabled" keeps all their revisions. Spaces of any other type get STORAGE_USERS_REVISIONS_CLEANUP_STRATEGY. The revisions cleanup command no longer hands the configured default to the storage driver as the strategy of the run: that one now applies to all spaces, whatever their type, so the driver would ignore the strategies of the space types. Without --strategy, the driver applies the configured strategies itself, by the type of each space. --strategy still applies one strategy to all spaces. The command checks every strategy before it opens the storage, naming the flag or the setting of an invalid one, and fails when none of them deletes anything. The README explains the settings, with examples. Assisted-by: Claude Code:claude-opus-5-5
…isions cleanup The revisions cleanup command gets --strategy-personal and --strategy-project, which replace the configured strategy of the personal or the project spaces for the run, e.g. to try a stricter strategy for the project spaces in a dry run, while the other spaces keep theirs. --strategy applies one strategy to all spaces, so it can't be combined with them. --verbose shows the strategy of every file and where it came from (--strategy, the space type or the default), and the JSON objects of the files have it in strategy and strategy_source. The files of a space whose strategy is "disabled" are skipped on purpose: like the files with nothing to delete, they are only listed with --verbose, and not counted as skipped. Otherwise a run over all spaces would list every file of every space whose type keeps all revisions. Assisted-by: Claude Code:claude-opus-5-5
…ace type - A configured strategy of the project spaces cleans up a file in a project space when it gets a new version, and leaves the personal space alone. - --strategy-project cleans up the project spaces in a run over all spaces, and the personal space keeps its versions. - --strategy can't be combined with --strategy-personal. Passes with posix (18 scenarios) and decomposed (17). Assisted-by: Claude Code:claude-opus-5-5
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 24 |
🟢 Coverage 92.63% diff coverage · +0.06% coverage variation
Metric Results Coverage variation ✅ +0.06% coverage variation (-1.00%) Diff coverage ✅ 92.63% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (0b73e9e) 95037 29280 30.81% Head commit (c553112) 95114 (+77) 29358 (+78) 30.87% (+0.06%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#4111) 95 88 92.63% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
This was referenced Nov 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
A revision cleanup strategy per type of space. Until now,
STORAGE_USERS_REVISIONS_CLEANUP_STRATEGYapplied to all spaces. Personal and project spaces can now have strategies of their own, e.g. to keep fewer versions in the personal spaces than in the project spaces.The cleanup in reva got this in opencloud-eu/reva#1042. This PR bumps reva and configures it.
Configuration
STORAGE_USERS_REVISIONS_CLEANUP_STRATEGYdisabledSTORAGE_USERS_REVISIONS_CLEANUP_STRATEGY_PERSONALdisabled: keep all their revisions, whatever the default isSTORAGE_USERS_REVISIONS_CLEANUP_STRATEGY_PROJECTSpaces of any other type get the default. Like the default, both apply to all storage drivers that support the cleanup (
decomposed,decomposeds3,posix), and an invalid one makes the storage-users service fail at startup.For example, keep 10 versions or 30 days by default, but only 7 days and at most 5 versions in the personal spaces:
opencloud storage-users revisions cleanup--strategy-personaland--strategy-projectreplace the configured strategy of that space type for the run, e.g. to try a stricter strategy for the project spaces in a dry run, while the other spaces keep theirs.--strategykeeps its meaning: one strategy for all spaces of the run, whatever their type. It can't be combined with the two new flags.--strategy, the command no longer passes the configured default to the driver as the strategy of the run, as that would override the strategies of the space types. The driver applies the configured strategies by the type of each space.--verboseshows the strategy of each file and where it came from (--strategy, the space type or the default); the JSON objects havestrategyandstrategy_source.disabledare only listed with--verbose, and not counted as skipped. Otherwise a run over all spaces would list every file of every space whose type keeps all revisions.Commits
chore: bump reva: brings feat: 4076: a revision cleanup strategy per type of space reva#1042 and docs: 1419: describe the age of a revision as the time it was created reva#1041 (the corrected description of the age of a revision), nothing elsecliCommands/cleanupFileVersions.feature)Each commit builds, and the storage-users tests pass.
Related Issue
Motivation and Context
Personal and project spaces are used differently: project spaces are shared by teams, and often need their history for longer, while personal spaces are where most of the storage goes.
How Has This Been Tested?
services/storage-users/...cliCommands/cleanupFileVersions.feature(posix: 18 scenarios, decomposed: 17), covering a configured project strategy that leaves the personal space alone,--strategy-projectin a run over all spaces, and the error for--strategywith--strategy-personal.Types of changes
Checklist:
AI assistance: Claude Code (claude-opus-5-5) wrote most of the code, the tests and the texts; I reviewed every change before pushing it.