Avoid throwing validation error on invalid URIs
The recent update of jsonschema inadvertently caused extra validation of `uri-reference` formatted properties. This change ensures that these errors are converted to warnings. Note that we cannot revert the change to jsonschema since the old version does not handle `uniqueItems` correctly.
This commit is contained in:
parent
3912995667
commit
9c5706e1a2
7 changed files with 101 additions and 8 deletions
12
lib/upload-lib.test.js
generated
12
lib/upload-lib.test.js
generated
|
|
@ -233,6 +233,18 @@ ava_1.default.beforeEach(() => {
|
|||
t.deepEqual(loggedMessages.length, 1);
|
||||
t.assert(loggedMessages[0].includes("Pruned 2 results"));
|
||||
});
|
||||
(0, ava_1.default)("accept results with invalid artifactLocation.uri value", (t) => {
|
||||
const loggedMessages = [];
|
||||
const mockLogger = {
|
||||
info: (message) => {
|
||||
loggedMessages.push(message);
|
||||
},
|
||||
};
|
||||
const sarifFile = `${__dirname}/../src/testdata/with-invalid-uri.sarif`;
|
||||
uploadLib.validateSarifFileSchema(sarifFile, mockLogger);
|
||||
t.deepEqual(loggedMessages.length, 1);
|
||||
t.deepEqual(loggedMessages[0], "Warning: 'not a valid URI' is not a valid URI in 'instance.runs[0].results[0].locations[0].physicalLocation.artifactLocation.uri'.");
|
||||
});
|
||||
const affectedCodeQLVersion = {
|
||||
driver: {
|
||||
name: "CodeQL",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue