Merge pull request #19478 from RoadieHQ/sort-search-results-azure

Improve consistency of results from azure provider
This commit is contained in:
Johan Haals
2023-08-21 16:48:41 +02:00
committed by GitHub
3 changed files with 35 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-backend-module-azure': patch
---
Improve consistency of results from the `AzureDevOpsEntityProvider`.
@@ -63,6 +63,12 @@ describe('azure', () => {
expect(req.headers.get('Authorization')).toBe('Basic OkFCQw==');
expect(req.body).toEqual({
searchText: 'path:/catalog-info.yaml repo:* proj:engineering',
$orderBy: [
{
field: 'path',
sortOrder: 'ASC',
},
],
$skip: 0,
$top: 1000,
});
@@ -122,6 +128,12 @@ describe('azure', () => {
expect(req.headers.get('Authorization')).toBe('Basic OkFCQw==');
expect(req.body).toEqual({
searchText: 'path:/catalog-info.yaml repo:* proj:engineering',
$orderBy: [
{
field: 'path',
sortOrder: 'ASC',
},
],
$skip: 0,
$top: 1000,
});
@@ -171,6 +183,12 @@ describe('azure', () => {
expect(req.body).toEqual({
searchText:
'path:/catalog-info.yaml repo:backstage proj:engineering',
$orderBy: [
{
field: 'path',
sortOrder: 'ASC',
},
],
$skip: 0,
$top: 1000,
});
@@ -220,6 +238,12 @@ describe('azure', () => {
expect(req.headers.get('Authorization')).toBe('Basic OkFCQw==');
expect(req.body).toEqual({
searchText: 'path:/catalog-info.yaml repo:* proj:engineering',
$orderBy: [
{
field: 'path',
sortOrder: 'ASC',
},
],
$skip: 0,
$top: 1000,
});
@@ -70,6 +70,12 @@ export async function codeSearch(
method: 'POST',
body: JSON.stringify({
searchText: `path:${path} repo:${repo || '*'} proj:${project || '*'}`,
$orderBy: [
{
field: 'path',
sortOrder: 'ASC',
},
],
$skip: items.length,
$top: PAGE_SIZE,
}),