forked from oss-review-toolkit/ort
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(fossid-webapp):
creatScan
response can be polymorphic
Under some rare circumstances, `createScan` can return an error message as data payload instead of the scan id. This commit changes the function's signature to make it polymorphic. Fixes oss-review-toolkit#8462. Signed-off-by: Nicolas Nobelis <[email protected]>
- Loading branch information
Showing
7 changed files
with
49 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
clients/fossid-webapp/src/test/assets/return-type/mappings/apiphp-create_scan.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"id" : "a1163704-9a3b-492c-bfd8-44593eeb9b25", | ||
"name" : "apiphp", | ||
"request" : { | ||
"url" : "/api.php", | ||
"method" : "POST", | ||
"bodyPatterns" : [ { | ||
"equalToJson" : "{\"action\":\"create\",\"group\":\"scans\",\"data\":{\"username\":\"\",\"key\":\"\",\"scan_code\":\"semver4j_20201203_090342\",\"project_code\":\"semver4j\",\"git_repo_url\":\"git_repo_url\",\"git_branch\":\"develop\"}}", | ||
"ignoreArrayOrder" : true, | ||
"ignoreExtraElements" : true | ||
} ] | ||
}, | ||
"response" : { | ||
"status" : 200, | ||
"body" : "{\"operation\":\"scans_create\", \"status\":\"0\", \"data\":[{\"code\": \"RequestData.Base.issue_with_executing_command\", \"message\":\"Field git_repo_url: there was an issue executing command: timeout 200 git ls-remote 'ssh git repo' 2>&1. Exit status: 128. Output: Repository not found The requested repository does not exist, or you do not have permission to access it. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.\", \"message_parameters\":{\"fieldname\":\"git_repo_url\", \"cmd\":\"timeout 200 git ls-remote 'ssh git repo' 2>&1\", \"exitStatus\":128, \"out\":\"Repository not found The requested repository does not exist, or you do not have permission to access it. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.\"} }], \"error\":\"RequestData.Base.issues_while_parsing_request\", \"message\":\"These issues were found while parsing the request:\", \"message_parameters\":[]}", | ||
"headers" : { | ||
"Content-Type" : "text/html; charset=UTF-8", | ||
"Date" : "Thu, 03 Dec 2020 08:03:42 GMT", | ||
"Server" : "Apache/2.4.38 (Debian)", | ||
"Vary" : "Accept-Encoding" | ||
} | ||
}, | ||
"uuid" : "a1163704-9a3b-492c-bfd8-44593eeb9b25", | ||
"persistent" : true, | ||
"insertionIndex" : 5 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters