Merge branch 'backstage:master' into plugin-azure-functions

This commit is contained in:
Wesley
2022-09-28 18:07:29 +02:00
committed by GitHub
5 changed files with 32 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder': patch
---
Making the description of the GitLab repoUrl owner field more clearer by focusing it refers to the GitLab namespace.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-search-backend': minor
---
Be less restrictive with unknown keys on query endpoint
@@ -66,8 +66,8 @@ export const GitlabRepoPicker = (props: {
</>
)}
<FormHelperText>
The organization, groups, subgroups, user, project (also known as
namespaces in gitlab), that this repo will belong to
GitLab namespace where this repository will belong to. It can be the
name of organization, group, subgroup, user, or the project.
</FormHelperText>
</FormControl>
</>
@@ -148,6 +148,25 @@ describe('createRouter', () => {
});
});
it('is less restrictive with unknown keys on query endpoint', async () => {
const queryString =
'term=test&%5BdocType%5D%5B0%5D=Service&filters%5BdocType%5D%5B0%5D=filter1&unknownKey1%5B2%5D=unknownValue1&unknownKey1%5B3%5D=unknownValue2&unknownKey2=unknownValue1&pageCursor';
const response = await request(app).get(`/query?${queryString}`);
const firstArg: Object = {
docType: ['Service'],
filters: { docType: ['filter1'] },
pageCursor: '',
term: 'test',
unknownKey1: ['unknownValue1', 'unknownValue2'],
unknownKey2: 'unknownValue1',
};
const secondArg = {
token: undefined,
};
expect(response.status).toEqual(200);
expect(mockSearchEngine.query).toHaveBeenCalledWith(firstArg, secondArg);
});
describe('search result filtering', () => {
beforeAll(async () => {
const logger = getVoidLogger();
+1 -1
View File
@@ -133,7 +133,7 @@ export async function createRouter(
req: express.Request,
res: express.Response<SearchResultSet | ErrorResponseBody>,
) => {
const parseResult = requestSchema.safeParse(req.query);
const parseResult = requestSchema.passthrough().safeParse(req.query);
if (!parseResult.success) {
throw new InputError(`Invalid query string: ${parseResult.error}`);