From b3d2d76eab89cfa7f9e35c372c0af93d15c5b714 Mon Sep 17 00:00:00 2001 From: Casey Marshall Date: Fri, 11 Oct 2024 08:06:48 -0500 Subject: [PATCH 1/2] chore: correction on diagnostic example in readme Removing a phantom attribute that doesn't actually exist in the Diagnostic type, from README examples. --- README.md | 88 ++++++++++++++++++++++++++----------------------------- 1 file changed, 42 insertions(+), 46 deletions(-) diff --git a/README.md b/README.md index b30be43bd..a886078a4 100644 --- a/README.md +++ b/README.md @@ -74,23 +74,21 @@ Right now the language server supports the following actions: "message": "Message", "tags": ["security"], "data": { - "scanIssue": { - "id": "123", - "issueType": "vulnerability", - "packageName": "packageName", - "packageVersion": "packageVersion", - "issue": "issue", - "additionalData": { - "ruleId": "ruleId", - "identifiers": { - "cwe": ["cwe"], - "cve": ["cve"] - }, - "description": "description", - "language": "language", - "packageManager": "packageManager", - "packageName": "packageName" - } + "id": "123", + "issueType": "vulnerability", + "packageName": "packageName", + "packageVersion": "packageVersion", + "issue": "issue", + "additionalData": { + "ruleId": "ruleId", + "identifiers": { + "cwe": ["cwe"], + "cve": ["cve"] + }, + "description": "description", + "language": "language", + "packageManager": "packageManager", + "packageName": "packageName" } } } @@ -113,35 +111,33 @@ Right now the language server supports the following actions: "message": "Message", "tags": ["security"], "data": { - "scanIssue": { - "id": "123", - "filePath": "filePath", - "range": { - "start": { "line": 1, "character": 0 }, - "end": { "line": 2, "character": 0 }, - }, - "additionalData": { - "message": "message", - "rule": "rule", - "ruleId": "ruleId", - "dataFlow": [ - { - "filePath": "filePath", - "range": { - "start": { "line": 1, "character": 0 }, - "end": { "line": 2, "character": 0 }, - }, - } - ], - "exampleCommitFixes": [ - { - "commit": "commit", - "diff": "diff" - } - ], - "cwe": "cwe", - "isSecurityType": true - } + "id": "123", + "filePath": "filePath", + "range": { + "start": { "line": 1, "character": 0 }, + "end": { "line": 2, "character": 0 }, + }, + "additionalData": { + "message": "message", + "rule": "rule", + "ruleId": "ruleId", + "dataFlow": [ + { + "filePath": "filePath", + "range": { + "start": { "line": 1, "character": 0 }, + "end": { "line": 2, "character": 0 }, + }, + } + ], + "exampleCommitFixes": [ + { + "commit": "commit", + "diff": "diff" + } + ], + "cwe": "cwe", + "isSecurityType": true } } } From 23d0d33d6fa7bc8b310cc669ed1991931ed65783 Mon Sep 17 00:00:00 2001 From: Casey Marshall Date: Fri, 11 Oct 2024 15:43:01 -0500 Subject: [PATCH 2/2] chore: increase timeout of server trust message test Test_initialize_handlesUntrustedFoldersWhenAuthenticated is failing in CI but not locally. This is likely due to too-short a timeout waiting for an async condition. 5s timeout chosen based on similar increase in a similar test in 68b6aa874231a5ee6865ab49fdefad06b199b724. --- application/server/server_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/server/server_test.go b/application/server/server_test.go index 971e1e3b3..691a177ee 100644 --- a/application/server/server_test.go +++ b/application/server/server_test.go @@ -680,7 +680,7 @@ func Test_initialize_handlesUntrustedFoldersWhenAuthenticated(t *testing.T) { } assert.Nil(t, err) - assert.Eventually(t, func() bool { return checkTrustMessageRequest(jsonRPCRecorder) }, time.Second, time.Millisecond) + assert.Eventually(t, func() bool { return checkTrustMessageRequest(jsonRPCRecorder) }, time.Second*5, time.Millisecond) } func Test_initialize_doesnotHandleUntrustedFolders(t *testing.T) {