Skip to content

Commit 919ea40

Browse files
authored
Fix wording and punctuation in retention rules documentation
1 parent 7e7080e commit 919ea40

1 file changed

Lines changed: 21 additions & 21 deletions

File tree

src/content/artifact-management/retention-rules.mdx

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Cloudsmith Retention Rules automate artifact data management for a repository by
99
- The number of days (time).
1010
- A [search query](/artifact-management/search-filter-sort-packages) to filter packages.
1111

12-
Each repository has one configurable Retention Rule. This rule runs automatically when a new package is uploaded and synchronized; subsequently, it deletes any packages that do not meet the configured parameters.
12+
Each repository has one configurable Retention Rule. This rule runs automatically when a new package is uploaded and synchronized, subsequently deleting any packages that meet the configured parameters.
1313

1414
Retention Rules can be configured for a repository either via the Cloudsmith Web App, the Cloudsmith API, or the Cloudsmith Terraform Provider.
1515

@@ -41,12 +41,12 @@ From the Cloudsmith Web App UI, use the sliders to configure rule values, and th
4141
| Name | API | Description |
4242
|----------|----------|----------|
4343
| Enabled | `retention_enabled` | Enables/Disables a Retention Rule for a repository. A value of `true` enables the rule, and `false` disables it. |
44-
| Limit by Days | `retention_days_limit` | The number of days to retain packages. A cutoff date is calculated and packages with an upload date before this cutoff date are selected for deletion; packages uploaded on or after the cutoff are retained. Set to zero to remove this criteria from the rule. |
45-
| Limit by Count | `retention_count_limit` | The maximum number of packages to retain. Set to zero to remove this criteria from the rule. |
46-
| Limit by Size | `retention_size_limit` | The maximum total size (in bytes) of packages to retain. Set to zero to remove this criteria from the rule. |
47-
| Group Packages by Name | `retention_group_by_name` | If enabled, retention will apply to groups of packages by name rather than all packages. For example, when `retention_count_limit` is defined as "1" and packages `PkgA 1.0`, `PkgB 1.0` and `PkgB 1.1` are identified as eligible for deletion; only `PkgB 1.0` is deleted because there are two (2) `PkgBs` and one (1) `PkgA`; this parameter is applied to each grouped package name. |
44+
| Limit by Days | `retention_days_limit` | The number of days to retain packages. A cutoff date is calculated, and packages with an upload date before this cutoff date are selected for deletion; packages uploaded on or after the cutoff date are retained. Set to zero to remove this criterion from the rule. |
45+
| Limit by Count | `retention_count_limit` | The maximum number of packages to retain. Set to zero to remove this criterion from the rule. |
46+
| Limit by Size | `retention_size_limit` | The maximum total size (in bytes) of packages to retain. Set to zero to remove this criterion from the rule. |
47+
| Group Packages by Name | `retention_group_by_name` | If enabled, retention will apply to groups of packages by name rather than all packages. For example, when `retention_count_limit` is defined as "1" and packages `PkgA 1.0`, `PkgB 1.0`, and `PkgB 1.1` are identified as eligible for deletion; only `PkgB 1.0` is deleted because there are (2) `PkgBs` and (1) `PkgA`; this parameter is applied to each grouped package name. |
4848
| Group Packages by Format | `retention_group_by_format` | If enabled, retention will apply to packages by package formats rather than across all package formats. For example, when `retention_count_limit` is defined as "1" and packages `PkgA 1.0`(Python) and `PkgA 1.0`(Ruby) are identified as eligible for deletion; nothing is deleted because these packages are different formats and the rule must retain 1 for each grouped package format. |
49-
| Group Packages by Type | `retention_group_by_package_type` | If enabled, retention will apply to packages by package type (e.g. by binary, by source, etc.), rather than across all package types for one or more formats. For example, when retaining by a limit of 1 and packages `DebPackage 1.0` and `DebSourcePackage 1.0` are uploaded, no packages are deleted because they are different package types, binary and source respectively. |
49+
| Group Packages by Type | `retention_group_by_package_type` | If enabled, retention will apply to packages by package type (e.g. by binary, by source, etc.), rather than across all package types for one or more formats. For example, when retaining by a limit of 1 and packages `DebPackage 1.0` and `DebSourcePackage 1.0` are uploaded, no packages are deleted because they are of different types: binary and source, respectively. |
5050
| Query String | `retention_package_query_string` | A package search expression. If provided, this expression further filters the packages to be deleted. For example, a search expression of `name:foo` will result in only packages called `foo` being eligible for deletion, or a search expression of `tag:~latest` will prevent any packages with the `latest` tag from being deleted. Refer to the Cloudsmith documentation for package query syntax. |
5151

5252
### Configuration Parameters via the Cloudsmith API
@@ -55,19 +55,19 @@ Visit [API reference](https://api.cloudsmith.io/swagger/) and search by `/repos/
5555
As a reference, use the `GET` method to retrieve an existing retention rule or the `PATCH` method to update it.
5656

5757
## When Do Retention Rules Get Evaluated?
58-
1. **Upload Trigger:** A Retention Rule is evaluated automatically whenever a new package is uploaded and completes synchronization. This is the ideal method for triggering a retention rule to ensure packages are evaluated and actioned as expected.
59-
2. **Resync Trigger:** A Retention Rule can also be triggered by resyncing the most recently uploaded package. When using this mechanism, review this documentation to understand how the cutoff date is calculated and how it affects package deletion.
58+
1. **Upload Trigger:** A Retention Rule is evaluated automatically whenever a new package is uploaded and completes synchronization. This is the ideal method for triggering a retention rule to ensure that packages are evaluated and acted upon as expected.
59+
2. **Resync Trigger:** A Retention Rule can also be triggered by resyncing the most recently uploaded package. When using this mechanism, review this documentation to understand how the cutoff date is calculated and its impact on package deletion.
6060

6161
<Note variant="note" headline="Limit by Days: Cutoff Date Calculation">
6262
The cutoff date is calculated by subtracting the Limit by Days parameter value from the upload date of the newest package.
6363

64-
Example: If today is June 10 and you upload a new package and the Limit by Days parameter is 4, the cutoff date would be June 6. Packages uploaded before June 6 would be deleted.
64+
Example: If today is June 10 and you upload a new package with the Limit by Days parameter set to 4, the cutoff date would be June 6. Packages uploaded before June 6 would be deleted.
6565
</Note>
6666

6767
<Note variant="note" headline="Invoking an Evaluation Using the Resync Trigger">
68-
The Cloudsmith Package Resync feature does not alter the upload date of a package. The cutoff date is a relative calculation based on the upload date of the most recently uploaded package used to trigger the evaluation. If the most recently uploaded package is 1,000 days old, and the ***Limit by Days*** parameter is 90 (days), the cutoff date calculation will be based on the upload date of that 1,000-day-old package.
68+
The Cloudsmith Package Resync feature does not alter the upload date of a package. The cutoff date is calculated based on the upload date of the most recently uploaded package that triggered the evaluation. If the most recently uploaded package is 1,000 days old, and the **Limit by Days** parameter is 90 (days), the cutoff date calculation will be based on the upload date of this 1,000-day-old package.
6969

70-
Example: 1,000 (uploaded date) subtracted by 90 (Limit by Days parameter) = 910 (cutoff date). Packages 911 days old and older would be deleted. Additionally, the 1,000 day old package used to trigger the evaluation would not be deleted, as it is not eligible for deletion. To effectively delete this 1,000-day-old package, upload a new package to trigger a new evaluation based on the new package's upload date.
70+
Example: 1,000 (uploaded date) subtracted by 90 (Limit by Days parameter) = 910 (cutoff date). Packages 911 days old and older would be deleted. Additionally, the 1,000-day-old package used to trigger the evaluation would not be deleted, as it is not eligible for deletion. To effectively delete this 1,000-day-old package, upload a new package to trigger a new evaluation based on the new package's upload date.
7171
</Note>
7272

7373
## Other Considerations
@@ -76,23 +76,23 @@ When multiple parameters of a retention rule are enabled, a package that meets a
7676
### Understanding Groupings
7777
Enable grouping(s) to filter packages into groups based on specified criteria before applying retention rules.
7878

79-
For example, if “Group Packages by Name” is selected, retention will apply to groups of packages by name rather than all packages. For example, when retaining by a count limit of 1 and packages `PkgA 1.0`, `PkgB 1.0` and `PkgB 1.1` are uploaded; only `PkgB 1.0` is deleted because there are two (2) `PkgBs` and one (1) `PkgA`. Or, If “Group Packages by Format” is selected, retention will apply to packages within package types rather than across all package formats. For example, when retaining by a limit of 1 and packages `PythonPkg 1.0` and `RubyPkg 1.0` are uploaded, no packages are deleted because they are different formats.
79+
For example, if “Group Packages by Name” is selected, retention will apply to groups of packages by name rather than all packages. For example, when retaining by a count limit of 1 and packages `PkgA 1.0`, `PkgB 1.0`, and `PkgB 1.1` are uploaded; only `PkgB 1.0` is deleted because there are two (2) `PkgBs` and one (1) `PkgA`. Or, if “Group Packages by Format” is selected, retention will apply to packages within package types rather than across all package formats. For example, when retaining by a limit of 1 and packages `PythonPkg 1.0` and `RubyPkg 1.0` are uploaded, no packages are deleted because they are different formats.
8080

8181
### Understanding the Sequence of an Evaluation
8282
1. **Initial Query Set is Created** - All successfully synced packages within the repository are identified.
83-
2. **Grouping is Applied to the Initial Query Set** - The initial query set of all packages is grouped by format, grouped by name, grouped by type based on the enabled parameters specified in the retention rule. To be clear, if all (3) grouping parameters are enabled, this will result in (3) separate query sets.
83+
2. **Grouping is Applied to the Initial Query Set** - The initial query set of all packages is grouped by format, grouped by name, and grouped by type based on the enabled parameters specified in the retention rule. To be clear, if all 3 grouping parameters are enabled, this will result in 3 separate query sets.
8484
3. **Package Query String is Applied to Query Set** - The query string filters the packages of each existing query set. Again, if multiple grouping parameters are enabled, the query string is applied to each query set separately.
85-
4. **Query Set is Ordered by Package Upload Date** - Any query set(s) gets sorted based on the upload date of the packages, newest to oldest and excluding the newest package used to trigger the evaluation.
85+
4. **Query Set is Ordered by Package Upload Date** - Any query set(s) gets sorted based on the upload date of the packages, newest to oldest, and excluding the newest package used to trigger the evaluation.
8686
5. **Limit by Count is Applied** - The number of packages to keep is determined according to the Limit by Count parameter. Packages exceeding this limit are deleted from the query set.
8787
6. **Limit by Days is Applied** - The number of days to keep packages is determined according to the Limit by Days parameter. Packages older than the calculated cutoff date are deleted from the query set.
88-
7. **Limit by Size is Applied** - The total size of packages to keep is determined according to the Limit by Size parameter. The latest query set is reordered by semantic version value and packages are deleted from the oldest semantic version to newest until the total size of remaining packages is under the defined parameter.
88+
7. **Limit by Size is Applied** - The total size of packages to keep is determined according to the Limit by Size parameter. The latest query set is reordered by semantic version value, and packages are deleted from the oldest semantic version to the newest until the total size of remaining packages is under the defined parameter.
8989

9090
<Note variant="note">
9191
The Package Query String Parameter is an excellent way to further filter packages before applying retention rules. The Cloudsmith Web App UI repository Filter function can be used to refine a query string to a desired set of packages and visualize the results.
9292
</Note>
9393

9494
### Limiting the Number of Packages to Delete
95-
The **Limit by count** option defines the number of packages to keep. For example, if we set its value to `4` and only a total of `3` packages meet the criteria, then `0` packages will be deleted. But if `5` packages meet the criteria, then `1` will be deleted and `4` will be keep in the repository.
95+
The **Limit by count** option defines the number of packages to keep. For example, if we set its value to `4` and only a total of `3` packages meet the criteria, then `0` packages will be deleted. But if `5` packages meet the criteria, then `1` will be deleted and `4` will be kept in the repository.
9696

9797
This value applies per group. So, the maximum total number of packages to keep will always be the result of `retention_count_limit` multiplied by the number of groups.
9898

@@ -106,16 +106,16 @@ The **Limit by Size** option defines the total size of packages to keep. For exa
106106
### Example 1
107107
Delete packages older than 100 days.
108108

109-
To configure a retention rule in the UI that removes all packages older than 100 days, configure the next values:
109+
To configure a retention rule in the UI that removes all packages older than 100 days, configure the following values:
110110

111111
- "Limit By Days" = 100
112112
- "Limit By Count" = 0
113113
- "Limit By Size" = 0.0B (disabled)
114114

115-
By disabling count and size, it means it only uses the package age to delete.
115+
Disabling count and size means it only uses the package age to delete.
116116

117117
### Example 2
118-
Delete all packages that are more than 30 days old and do not have any tag.
118+
Delete all packages that are more than 30 days old and do not have any tags.
119119

120120
```shell
121121
curl --request PATCH \
@@ -131,7 +131,7 @@ curl --request PATCH \
131131
```
132132
133133
### Example 3
134-
Delete all packages that are more than 60 days old and have less than 10 downloads.
134+
Delete all packages that are more than 60 days old and have fewer than 10 downloads.
135135
136136
```shell
137137
curl --request PATCH \
@@ -147,7 +147,7 @@ curl --request PATCH \
147147
```
148148
149149
### Example 4
150-
Keep only 5 packages per format (python, docker, helm, etc.), that are not older than 100 days, are not tagged with `production`, have been downloaded less than 10 times and are violating some policies.
150+
Keep only 5 packages per format (Python, Docker, Helm, etc.) that are not older than 100 days, are not tagged with `production`, have been downloaded fewer than 10 times, and are violating some policies.
151151
152152
```shell
153153
curl --request PATCH \

0 commit comments

Comments
 (0)