Azure / Azure/azure-devops-cli-extension

Bug: pipeline runs --query-order does not only order by the given argument (also includes at least status)

Open
#969 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
682
Forks
278
Avg merge
3d 23h
Merged PRs (30d)
3

Description

The `--query-order` argument does not wholly define the sort order of the returned results. The results are also grouped/ordered by other properties, at least `status` and possibly others.

How to reproduce:

Run `az pipelines runs list` with `--query-order` parameter.
```
az pipelines runs list --pipeline-ids 880 --query-order StartTimeDesc --query "[].{id: id,startTime: startTime,status: status}"
```

Expected output:
All pipeline runs are ordered by Start Time ascending
```
[
{
"id": 121706,
"startTime": "2020-03-19T11:19:19.417192+00:00",
"status": "inProgress"
},
{
"id": 122232,
"startTime": "2020-03-22T21:12:29.012326+00:00",
"status": "inProgress"
},
{
"id": 122233,
"startTime": "2020-03-22T21:16:56.237058+00:00",
"status": "completed"
},
{
"id": 122284,
"startTime": "2020-03-22T23:04:31.035596+00:00",
"status": "inProgress"
}
]
```

Actual output:
The pipeline runs are grouped by status, and within each group are ordered by Start Time ascending.
```
[
{
"id": 122233,
"startTime": "2020-03-22T21:16:56.237058+00:00",
"status": "completed"
},
{
"id": 121706,
"startTime": "2020-03-19T11:19:19.417192+00:00",
"status": "inProgress"
},
{
"id": 122232,
"startTime": "2020-03-22T21:12:29.012326+00:00",
"status": "inProgress"
},
{
"id": 122284,
"startTime": "2020-03-22T23:04:31.035596+00:00",
"status": "inProgress"
}
]
```
The same occurs for Start Time descending, and Queue Time ascending and descending.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.