jfrog / jfrog-cli

JFrog CLI is a client that provides a simple interface that automates access to the JFrog products.
https://www.jfrog.com/confluence/display/CLI/JFrog+CLI
Apache License 2.0
529 stars 227 forks source link

--sort-by and --sort-order flags not working with --include flag #2682

Open dsmaugy opened 3 weeks ago

dsmaugy commented 3 weeks ago

Describe the bug

There are a couple of issues at hand with the --sort-by, --include, and --sort-order flags when running jf rt search with --recursive=false and --include-dirs.

Specifying --sort-by removes the object props from the query response. Manually requesting properties via --include="props" does not respect sort order if --sort-order is also included.

This might be related to 649?

Current behavior

  1. Running jf rt search <path> --recursive=false --include-dirs returns the directories at the given path with any included properties as intended. However if --sort-by="created" is specified, the properties are removed from the query response.
  2. Running jf rt search <path> --recursive=false --include-dirs --include="path;type;created;property" --sort-by="created" ---sort-by=desc includes the properties in the response, but the order specified by --sort-order is not respected.

Reproduction steps

Run jf rt search <path> --recursive=false --include-dirs --include="path;type;created;property" --sort-by="created" ---sort-by=desc

The returned response is not sorted in descending order by creation date.

Expected behavior

I expected to see a JSON response object with a list of directories with their corresponding properties in sorted descending order.

JFrog CLI version

2.66.0

Operating system type and version

MacOS

JFrog Artifactory version

Jfrog Cloud

JFrog Xray version

No response