Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-15639

Size of a top level folder that contains sub-folders in AQL or Artifactory REST API

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: High
    • Resolution: Duplicate
    • Affects Version/s: 5.4.6
    • Fix Version/s: None
    • Component/s: AQL, REST API
    • Labels:
      None

      Description

      Problem

      Unable to get the size of a top level folder if this folder contains any sub-folders

      Possible Solution/Improvement

      Option 1: have the rest api for folder info contain the size of the folder including all sub-folders

      Option 2: Be able to retrieve size via AQL. We tried to perform an AQL query to get the size of the folder.
      Reproduce:
      1. create local repo and deploy an artifact/s to a folder
      2. deploy some other artifacts in a sub-folder of that folder
      3. run the following AQL query to get the folder size:
      items.find({"repo":

      {"$eq":"example-repo-local"}

      ,"path":{"$eq":"folder"}}).include("size")
      4. this returns only the size of the artifacts one layer below the top level folder and completely ignores all sub-folders (this seems to be intended but also seems a bit counter-intuitive)

      Customer Use Case
      Customer looking to get the size of individual top level folders for clean up script. They implemented a recursive function to aggregate all files in a top level folder but causes many issues when dealing with many files.

      The customers use case is their builds are deposited in each repository of different sizes so then need to query the top level folders (associated with their build) to see the largest folder before adding another folder. Their logic using the recursive function cleans out the oldest builds until there is enough space for one more build of size equal to the largest build. They have folders with over 1000 files that drastically impacts the API.

      The workaround for them now is to zip up the sources directory to limit the size to one API query. This then does not allow the source files that are used across other projects to leverage the checksum based storage.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                scottm Scott Mosher
              • Votes:
                4 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: