Skip to content
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

Unwanted artifacts deleted because stats.remote_downloads not used in AQL queries #156

Open
philippe-granet opened this issue Jan 8, 2025 · 0 comments · May be fixed by #157
Open

Unwanted artifacts deleted because stats.remote_downloads not used in AQL queries #156

philippe-granet opened this issue Jan 8, 2025 · 0 comments · May be fixed by #157

Comments

@philippe-granet
Copy link

philippe-granet commented Jan 8, 2025

I have this rule:

    - name: Delete Maven artifacts not used since 90 days
      rules:
        - rule: RepoList
          repos:
            - my-repo
        - rule: DeleteNotUsedSince
          days: 90

This generate this AQL query:
items.find({"$and": [{"$or": [{"repo": {"$eq": "my-repo"}}]}, {"$or": [{"stat.downloaded": {"$lte": "2024-10-10"}}, {"$and": [{"stat.downloads": {"$eq": null}}, {"created": {"$lte": "2024-10-10"}}]}]}]}).include("*", "property", "stat")

The problem is that I don't query artifacts directly on my Artifactory instance. For security reasons, I query artifacts form a second Artifactory proxy instance , which remotely access artifacts from the first Artifactory instance.

On the first Artifactory instance, stat.downloaded attribute is never update, only stats.remote_downloads attribute is updated after each download of the artifacts from the second Artifactory proxy instance:
image

philippe-granet added a commit to philippe-granet/artifactory-cleanup that referenced this issue Jan 8, 2025
philippe-granet added a commit to philippe-granet/artifactory-cleanup that referenced this issue Jan 8, 2025
philippe-granet added a commit to philippe-granet/artifactory-cleanup that referenced this issue Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant