From 855737fa2664aa0b4beff7c679a2fd97ae6aefa8 Mon Sep 17 00:00:00 2001 From: Srijan Saurav Date: Tue, 7 Nov 2023 17:18:02 +0530 Subject: [PATCH 1/3] feat: add support to pass analyzer type using `--type` flag With the introduction of community analyzers, it is required for the users to pass a `--type` flag. This is backwards compatible and would default to `core` for existing analyzers. --- .gitignore | 2 + command/report/constants.go | 5 +- command/report/report.go | 9 ++- ...report_graphql_community_request_body.json | 19 ++++++ .../report_graphql_request_body.json | 20 +++++- command/report/tests/report_workflow_test.go | 63 ++++++++++++++++++- command/report/types.go | 1 + 7 files changed, 113 insertions(+), 6 deletions(-) create mode 100644 command/report/tests/golden_files/report_graphql_community_request_body.json diff --git a/.gitignore b/.gitignore index 322b82fc..45c0feef 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,5 @@ cover.out # Completion files completions + +.vscode diff --git a/command/report/constants.go b/command/report/constants.go index 5d7fc399..35afd020 100644 --- a/command/report/constants.go +++ b/command/report/constants.go @@ -1,7 +1,7 @@ package report const ( - cliVersion = "v0.1.6" + CliVersion = "v0.8.0" commonUsageMessage = ` Usage: deepsource [] @@ -18,14 +18,17 @@ Usage: deepsource report [] Available arguments are: --analyzer Shortcode of the analyzer + --analyzer-type Type of the analyzer (default: "core") --key Name of the artifact --value Value of the artifact --value-file Path to the artifact value file Examples: deepsource report --analyzer test-coverage --key python --value-file ./coverage.xml deepsource report --analyzer git --key lines-changed --value 22 + deepsource report --analyzer kube-linter --type community --value-file ./kube-linter.sarif Notes: - Pass either '--value' or '--value-file'. If both are passed, contents of '--value' will be considered. + - '--analyzer-type' is optional. If not passed, it will default to 'core'. Documentation: https://deepsource.io/docs/cli#report ` diff --git a/command/report/report.go b/command/report/report.go index b54aa38f..b8859e61 100644 --- a/command/report/report.go +++ b/command/report/report.go @@ -19,6 +19,7 @@ import ( type ReportOptions struct { Analyzer string + Type string Key string Value string ValueFile string @@ -57,6 +58,8 @@ func NewCmdReport() *cobra.Command { // --repo, -r flag cmd.Flags().StringVar(&opts.Analyzer, "analyzer", "", "name of the analyzer to report the artifact to (example: test-coverage)") + cmd.Flags().StringVar(&opts.Type, "type", "core", "type of the analyzer (example: community)") + cmd.Flags().StringVar(&opts.Key, "key", "", "shortcode of the language (example: go)") cmd.Flags().StringVar(&opts.Value, "value", "", "value of the artifact") @@ -85,6 +88,7 @@ func (opts *ReportOptions) Run() int { ///////////////////// reportCommandAnalyzerShortcode := strings.TrimSpace(opts.Analyzer) + reportCommandAnalyzerType := strings.TrimSpace(opts.Type) reportCommandKey := strings.TrimSpace(opts.Key) reportCommandValue := opts.Value reportCommandValueFile := strings.TrimSpace(opts.ValueFile) @@ -198,10 +202,12 @@ func (opts *ReportOptions) Run() int { } var analyzerShortcode string + var analyzerType string var artifactKey string var artifactValue string analyzerShortcode = reportCommandAnalyzerShortcode + analyzerType = reportCommandAnalyzerType artifactKey = reportCommandKey if reportCommandValue != "" { @@ -299,10 +305,11 @@ func (opts *ReportOptions) Run() int { AccessToken: dsnAccessToken, CommitOID: headCommitOID, ReporterName: "cli", - ReporterVersion: cliVersion, + ReporterVersion: CliVersion, Key: artifactKey, Data: artifactValue, AnalyzerShortcode: analyzerShortcode, + AnalyzerType: analyzerType, Metadata: reportMeta, } diff --git a/command/report/tests/golden_files/report_graphql_community_request_body.json b/command/report/tests/golden_files/report_graphql_community_request_body.json new file mode 100644 index 00000000..c778e4bb --- /dev/null +++ b/command/report/tests/golden_files/report_graphql_community_request_body.json @@ -0,0 +1,19 @@ +{ + "query": "mutation($input: CreateArtifactInput!) {\r\n createArtifact(input: $input) {\r\n ok\r\n message\r\n error\r\n }\r\n}", + "variables": { + "input": { + "accessToken": "f59ab9314307", + "commitOid": "b9e678d8dcb43fa1340e8a0c579b2c642280dc27", + "reporter": "cli", + "reporterVersion": "v0.1.6", + "key": "python", + "data": "\u003c?xml version=\"1.0\" ?\u003e\n\u003ccoverage branch-rate=\"0.9333\" branches-covered=\"28\" branches-valid=\"30\" complexity=\"0\" line-rate=\"0.9839\" lines-covered=\"183\" lines-valid=\"186\" timestamp=\"1551180635459\" version=\"4.5.2\"\u003e\n \u003c!-- Generated by coverage.py: https://coverage.readthedocs.io --\u003e\n \u003c!-- Based on https://raw.githubusercontent.com/cobertura/web/master/htdocs/xml/coverage-04.dtd --\u003e\n \u003csources/\u003e\n \u003cpackages\u003e\n \u003cpackage branch-rate=\"0.9333\" complexity=\"0\" line-rate=\"0.9839\" name=\".Users.sanket.Code.s3tree.s3tree\"\u003e\n \u003cclasses\u003e\n \u003cclass branch-rate=\"1\" complexity=\"0\" filename=\"/code/s3tree/s3tree/__init__.py\" line-rate=\"1\" name=\"__init__.py\"\u003e\n \u003cmethods/\u003e\n \u003clines\u003e\n \u003cline hits=\"1\" number=\"4\"/\u003e\n \u003cline hits=\"1\" number=\"6\"/\u003e\n \u003cline hits=\"1\" number=\"7\"/\u003e\n \u003cline hits=\"1\" number=\"9\"/\u003e\n \u003cline hits=\"1\" number=\"10\"/\u003e\n \u003cline hits=\"1\" number=\"12\"/\u003e\n \u003c/lines\u003e\n \u003c/class\u003e\n \u003cclass branch-rate=\"1\" complexity=\"0\" filename=\"/code/s3tree/s3tree/__version__.py\" line-rate=\"1\" name=\"__version__.py\"\u003e\n \u003cmethods/\u003e\n \u003clines\u003e\n \u003cline hits=\"1\" number=\"4\"/\u003e\n \u003c/lines\u003e\n \u003c/class\u003e\n \u003cclass branch-rate=\"0.9375\" complexity=\"0\" filename=\"/code/s3tree/s3tree/core.py\" line-rate=\"0.9846\" name=\"core.py\"\u003e\n \u003cmethods/\u003e\n \u003clines\u003e\n \u003cline hits=\"1\" number=\"4\"/\u003e\n \u003cline hits=\"1\" number=\"5\"/\u003e\n \u003cline hits=\"1\" number=\"6\"/\u003e\n \u003cline hits=\"1\" number=\"7\"/\u003e\n \u003cline hits=\"1\" number=\"8\"/\u003e\n \u003cline hits=\"1\" number=\"10\"/\u003e\n \u003cline hits=\"1\" number=\"11\"/\u003e\n \u003cline hits=\"1\" number=\"13\"/\u003e\n \u003cline hits=\"1\" number=\"14\"/\u003e\n \u003cline hits=\"1\" number=\"17\"/\u003e\n \u003cline hits=\"1\" number=\"41\"/\u003e\n \u003cline hits=\"1\" number=\"43\"/\u003e\n \u003cline hits=\"1\" number=\"45\"/\u003e\n \u003cline hits=\"1\" number=\"49\"/\u003e\n \u003cline hits=\"1\" number=\"50\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"53\"/\u003e\n \u003cline hits=\"1\" number=\"54\"/\u003e\n \u003cline hits=\"1\" number=\"57\"/\u003e\n \u003cline hits=\"1\" number=\"61\"/\u003e\n \u003cline hits=\"1\" number=\"62\"/\u003e\n \u003cline hits=\"1\" number=\"65\"/\u003e\n \u003cline hits=\"1\" number=\"66\"/\u003e\n \u003cline hits=\"1\" number=\"69\"/\u003e\n \u003cline hits=\"1\" number=\"72\"/\u003e\n \u003cline hits=\"1\" number=\"73\"/\u003e\n \u003cline hits=\"1\" number=\"76\"/\u003e\n \u003cline hits=\"1\" number=\"78\"/\u003e\n \u003cline hits=\"1\" number=\"79\"/\u003e\n \u003cline hits=\"1\" number=\"81\"/\u003e\n \u003cline hits=\"1\" number=\"82\"/\u003e\n \u003cline hits=\"1\" number=\"84\"/\u003e\n \u003cline hits=\"1\" number=\"86\"/\u003e\n \u003cline hits=\"1\" number=\"90\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"94\"/\u003e\n \u003cline hits=\"1\" number=\"95\"/\u003e\n \u003cline hits=\"1\" number=\"99\"/\u003e\n \u003cline hits=\"1\" number=\"101\"/\u003e\n \u003cline hits=\"1\" number=\"104\"/\u003e\n \u003cline hits=\"1\" number=\"105\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"107\"/\u003e\n \u003cline hits=\"1\" number=\"108\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"110\"/\u003e\n \u003cline hits=\"1\" number=\"111\"/\u003e\n \u003cline hits=\"1\" number=\"113\"/\u003e\n \u003cline hits=\"1\" number=\"115\"/\u003e\n \u003cline hits=\"1\" number=\"120\"/\u003e\n \u003cline hits=\"1\" number=\"121\"/\u003e\n \u003cline hits=\"1\" number=\"122\"/\u003e\n \u003cline hits=\"1\" number=\"125\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"127\"/\u003e\n \u003cline hits=\"1\" number=\"128\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"50% (1/2)\" hits=\"1\" missing-branches=\"134\" number=\"130\"/\u003e\n \u003cline hits=\"1\" number=\"131\"/\u003e\n \u003cline hits=\"0\" number=\"134\"/\u003e\n \u003cline hits=\"1\" number=\"136\"/\u003e\n \u003cline hits=\"1\" number=\"139\"/\u003e\n \u003cline hits=\"1\" number=\"141\"/\u003e\n \u003cline hits=\"1\" number=\"144\"/\u003e\n \u003cline hits=\"1\" number=\"146\"/\u003e\n \u003cline hits=\"1\" number=\"149\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"151\"/\u003e\n \u003cline hits=\"1\" number=\"152\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"154\"/\u003e\n \u003cline hits=\"1\" number=\"155\"/\u003e\n \u003cline hits=\"1\" number=\"157\"/\u003e\n \u003c/lines\u003e\n \u003c/class\u003e\n \u003cclass branch-rate=\"1\" complexity=\"0\" filename=\"/code/s3tree/s3tree/exceptions.py\" line-rate=\"1\" name=\"exceptions.py\"\u003e\n \u003cmethods/\u003e\n \u003clines\u003e\n \u003cline hits=\"1\" number=\"5\"/\u003e\n \u003cline hits=\"1\" number=\"6\"/\u003e\n \u003cline hits=\"1\" number=\"7\"/\u003e\n \u003cline hits=\"1\" number=\"11\"/\u003e\n \u003cline hits=\"1\" number=\"14\"/\u003e\n \u003cline hits=\"1\" number=\"15\"/\u003e\n \u003cline hits=\"1\" number=\"16\"/\u003e\n \u003cline hits=\"1\" number=\"17\"/\u003e\n \u003cline hits=\"1\" number=\"20\"/\u003e\n \u003cline hits=\"1\" number=\"21\"/\u003e\n \u003cline hits=\"1\" number=\"22\"/\u003e\n \u003cline hits=\"1\" number=\"25\"/\u003e\n \u003cline hits=\"1\" number=\"28\"/\u003e\n \u003cline hits=\"1\" number=\"29\"/\u003e\n \u003cline hits=\"1\" number=\"30\"/\u003e\n \u003cline hits=\"1\" number=\"31\"/\u003e\n \u003cline hits=\"1\" number=\"34\"/\u003e\n \u003cline hits=\"1\" number=\"35\"/\u003e\n \u003cline hits=\"1\" number=\"36\"/\u003e\n \u003cline hits=\"1\" number=\"37\"/\u003e\n \u003cline hits=\"1\" number=\"40\"/\u003e\n \u003cline hits=\"1\" number=\"41\"/\u003e\n \u003cline hits=\"1\" number=\"42\"/\u003e\n \u003cline hits=\"1\" number=\"43\"/\u003e\n \u003c/lines\u003e\n \u003c/class\u003e\n \u003cclass branch-rate=\"1\" complexity=\"0\" filename=\"/code/s3tree/s3tree/models.py\" line-rate=\"0.9615\" name=\"models.py\"\u003e\n \u003cmethods/\u003e\n \u003clines\u003e\n \u003cline hits=\"1\" number=\"3\"/\u003e\n \u003cline hits=\"1\" number=\"5\"/\u003e\n \u003cline hits=\"1\" number=\"6\"/\u003e\n \u003cline hits=\"1\" number=\"7\"/\u003e\n \u003cline hits=\"1\" number=\"8\"/\u003e\n \u003cline hits=\"1\" number=\"9\"/\u003e\n \u003cline hits=\"1\" number=\"10\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"13\"/\u003e\n \u003cline hits=\"1\" number=\"14\"/\u003e\n \u003cline hits=\"1\" number=\"19\"/\u003e\n \u003cline hits=\"1\" number=\"20\"/\u003e\n \u003cline hits=\"1\" number=\"21\"/\u003e\n \u003cline hits=\"1\" number=\"23\"/\u003e\n \u003cline hits=\"1\" number=\"25\"/\u003e\n \u003cline hits=\"1\" number=\"27\"/\u003e\n \u003cline hits=\"1\" number=\"28\"/\u003e\n \u003cline hits=\"1\" number=\"30\"/\u003e\n \u003cline hits=\"1\" number=\"31\"/\u003e\n \u003cline hits=\"1\" number=\"37\"/\u003e\n \u003cline hits=\"1\" number=\"40\"/\u003e\n \u003cline hits=\"1\" number=\"45\"/\u003e\n \u003cline hits=\"1\" number=\"48\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"51\"/\u003e\n \u003cline hits=\"1\" number=\"52\"/\u003e\n \u003cline hits=\"1\" number=\"55\"/\u003e\n \u003cline hits=\"1\" number=\"57\"/\u003e\n \u003cline hits=\"1\" number=\"58\"/\u003e\n \u003cline hits=\"1\" number=\"59\"/\u003e\n \u003cline hits=\"1\" number=\"60\"/\u003e\n \u003cline hits=\"1\" number=\"61\"/\u003e\n \u003cline hits=\"1\" number=\"64\"/\u003e\n \u003cline hits=\"1\" number=\"67\"/\u003e\n \u003cline hits=\"1\" number=\"69\"/\u003e\n \u003cline hits=\"1\" number=\"72\"/\u003e\n \u003cline hits=\"1\" number=\"74\"/\u003e\n \u003cline hits=\"1\" number=\"77\"/\u003e\n \u003cline hits=\"1\" number=\"79\"/\u003e\n \u003cline hits=\"1\" number=\"82\"/\u003e\n \u003cline hits=\"1\" number=\"84\"/\u003e\n \u003cline hits=\"1\" number=\"86\"/\u003e\n \u003cline hits=\"1\" number=\"87\"/\u003e\n \u003cline hits=\"0\" number=\"90\"/\u003e\n \u003cline hits=\"0\" number=\"91\"/\u003e\n \u003cline hits=\"1\" number=\"93\"/\u003e\n \u003cline hits=\"1\" number=\"94\"/\u003e\n \u003cline hits=\"1\" number=\"96\"/\u003e\n \u003cline hits=\"1\" number=\"99\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"101\"/\u003e\n \u003cline hits=\"1\" number=\"102\"/\u003e\n \u003cline hits=\"1\" number=\"103\"/\u003e\n \u003cline hits=\"1\" number=\"105\"/\u003e\n \u003cline hits=\"1\" number=\"108\"/\u003e\n \u003c/lines\u003e\n \u003c/class\u003e\n \u003cclass branch-rate=\"0.5\" complexity=\"0\" filename=\"/code/s3tree/s3tree/types.py\" line-rate=\"1\" name=\"types.py\"\u003e\n \u003cmethods/\u003e\n \u003clines\u003e\n \u003cline hits=\"1\" number=\"3\"/\u003e\n \u003cline hits=\"1\" number=\"6\"/\u003e\n \u003cline hits=\"1\" number=\"8\"/\u003e\n \u003cline hits=\"1\" number=\"10\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"50% (1/2)\" hits=\"1\" missing-branches=\"14\" number=\"11\"/\u003e\n \u003cline hits=\"1\" number=\"12\"/\u003e\n \u003cline hits=\"1\" number=\"14\"/\u003e\n \u003cline hits=\"1\" number=\"17\"/\u003e\n \u003cline hits=\"1\" number=\"18\"/\u003e\n \u003cline hits=\"1\" number=\"21\"/\u003e\n \u003cline hits=\"1\" number=\"22\"/\u003e\n \u003cline hits=\"1\" number=\"23\"/\u003e\n \u003cline hits=\"1\" number=\"24\"/\u003e\n \u003c/lines\u003e\n \u003c/class\u003e\n \u003cclass branch-rate=\"1\" complexity=\"0\" filename=\"/code/s3tree/s3tree/utils.py\" line-rate=\"1\" name=\"utils.py\"\u003e\n \u003cmethods/\u003e\n \u003clines\u003e\n \u003cline hits=\"1\" number=\"3\"/\u003e\n \u003cline hits=\"1\" number=\"4\"/\u003e\n \u003cline hits=\"1\" number=\"5\"/\u003e\n \u003cline hits=\"1\" number=\"6\"/\u003e\n \u003cline hits=\"1\" number=\"8\"/\u003e\n \u003cline hits=\"1\" number=\"11\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"27\"/\u003e\n \u003cline hits=\"1\" number=\"28\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"30\"/\u003e\n \u003cline hits=\"1\" number=\"31\"/\u003e\n \u003cline hits=\"1\" number=\"34\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"37\"/\u003e\n \u003cline hits=\"1\" number=\"38\"/\u003e\n \u003cline hits=\"1\" number=\"40\"/\u003e\n \u003cline hits=\"1\" number=\"43\"/\u003e\n \u003cline hits=\"1\" number=\"56\"/\u003e\n \u003cline hits=\"1\" number=\"60\"/\u003e\n \u003cline hits=\"1\" number=\"65\"/\u003e\n \u003cline hits=\"1\" number=\"69\"/\u003e\n \u003cline hits=\"1\" number=\"73\"/\u003e\n \u003cline hits=\"1\" number=\"74\"/\u003e\n \u003cline hits=\"1\" number=\"76\"/\u003e\n \u003cline hits=\"1\" number=\"78\"/\u003e\n \u003cline hits=\"1\" number=\"81\"/\u003e\n \u003cline hits=\"1\" number=\"83\"/\u003e\n \u003c/lines\u003e\n \u003c/class\u003e\n \u003c/classes\u003e\n \u003c/package\u003e\n \u003c/packages\u003e\n\u003c/coverage\u003e\n", + "analyzer": "test-coverage", + "analyzerType": "community", + "metadata": { + "workDir": "/home/runner/code", + "compressed": "True" + } + } + } +} \ No newline at end of file diff --git a/command/report/tests/golden_files/report_graphql_request_body.json b/command/report/tests/golden_files/report_graphql_request_body.json index 5dbdc0de..d49dfc0e 100644 --- a/command/report/tests/golden_files/report_graphql_request_body.json +++ b/command/report/tests/golden_files/report_graphql_request_body.json @@ -1 +1,19 @@ -{"query":"mutation($input: CreateArtifactInput!) {\r\n createArtifact(input: $input) {\r\n ok\r\n message\r\n error\r\n }\r\n}","variables":{"input":{"accessToken":"f59ab9314307","commitOid":"b9e678d8dcb43fa1340e8a0c579b2c642280dc27","reporter":"cli","reporterVersion":"v0.1.6","key":"python","data":"\u003c?xml version=\"1.0\" ?\u003e\n\u003ccoverage branch-rate=\"0.9333\" branches-covered=\"28\" branches-valid=\"30\" complexity=\"0\" line-rate=\"0.9839\" lines-covered=\"183\" lines-valid=\"186\" timestamp=\"1551180635459\" version=\"4.5.2\"\u003e\n \u003c!-- Generated by coverage.py: https://coverage.readthedocs.io --\u003e\n \u003c!-- Based on https://raw.githubusercontent.com/cobertura/web/master/htdocs/xml/coverage-04.dtd --\u003e\n \u003csources/\u003e\n \u003cpackages\u003e\n \u003cpackage branch-rate=\"0.9333\" complexity=\"0\" line-rate=\"0.9839\" name=\".Users.sanket.Code.s3tree.s3tree\"\u003e\n \u003cclasses\u003e\n \u003cclass branch-rate=\"1\" complexity=\"0\" filename=\"/code/s3tree/s3tree/__init__.py\" line-rate=\"1\" name=\"__init__.py\"\u003e\n \u003cmethods/\u003e\n \u003clines\u003e\n \u003cline hits=\"1\" number=\"4\"/\u003e\n \u003cline hits=\"1\" number=\"6\"/\u003e\n \u003cline hits=\"1\" number=\"7\"/\u003e\n \u003cline hits=\"1\" number=\"9\"/\u003e\n \u003cline hits=\"1\" number=\"10\"/\u003e\n \u003cline hits=\"1\" number=\"12\"/\u003e\n \u003c/lines\u003e\n \u003c/class\u003e\n \u003cclass branch-rate=\"1\" complexity=\"0\" filename=\"/code/s3tree/s3tree/__version__.py\" line-rate=\"1\" name=\"__version__.py\"\u003e\n \u003cmethods/\u003e\n \u003clines\u003e\n \u003cline hits=\"1\" number=\"4\"/\u003e\n \u003c/lines\u003e\n \u003c/class\u003e\n \u003cclass branch-rate=\"0.9375\" complexity=\"0\" filename=\"/code/s3tree/s3tree/core.py\" line-rate=\"0.9846\" name=\"core.py\"\u003e\n \u003cmethods/\u003e\n \u003clines\u003e\n \u003cline hits=\"1\" number=\"4\"/\u003e\n \u003cline hits=\"1\" number=\"5\"/\u003e\n \u003cline hits=\"1\" number=\"6\"/\u003e\n \u003cline hits=\"1\" number=\"7\"/\u003e\n \u003cline hits=\"1\" number=\"8\"/\u003e\n \u003cline hits=\"1\" number=\"10\"/\u003e\n \u003cline hits=\"1\" number=\"11\"/\u003e\n \u003cline hits=\"1\" number=\"13\"/\u003e\n \u003cline hits=\"1\" number=\"14\"/\u003e\n \u003cline hits=\"1\" number=\"17\"/\u003e\n \u003cline hits=\"1\" number=\"41\"/\u003e\n \u003cline hits=\"1\" number=\"43\"/\u003e\n \u003cline hits=\"1\" number=\"45\"/\u003e\n \u003cline hits=\"1\" number=\"49\"/\u003e\n \u003cline hits=\"1\" number=\"50\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"53\"/\u003e\n \u003cline hits=\"1\" number=\"54\"/\u003e\n \u003cline hits=\"1\" number=\"57\"/\u003e\n \u003cline hits=\"1\" number=\"61\"/\u003e\n \u003cline hits=\"1\" number=\"62\"/\u003e\n \u003cline hits=\"1\" number=\"65\"/\u003e\n \u003cline hits=\"1\" number=\"66\"/\u003e\n \u003cline hits=\"1\" number=\"69\"/\u003e\n \u003cline hits=\"1\" number=\"72\"/\u003e\n \u003cline hits=\"1\" number=\"73\"/\u003e\n \u003cline hits=\"1\" number=\"76\"/\u003e\n \u003cline hits=\"1\" number=\"78\"/\u003e\n \u003cline hits=\"1\" number=\"79\"/\u003e\n \u003cline hits=\"1\" number=\"81\"/\u003e\n \u003cline hits=\"1\" number=\"82\"/\u003e\n \u003cline hits=\"1\" number=\"84\"/\u003e\n \u003cline hits=\"1\" number=\"86\"/\u003e\n \u003cline hits=\"1\" number=\"90\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"94\"/\u003e\n \u003cline hits=\"1\" number=\"95\"/\u003e\n \u003cline hits=\"1\" number=\"99\"/\u003e\n \u003cline hits=\"1\" number=\"101\"/\u003e\n \u003cline hits=\"1\" number=\"104\"/\u003e\n \u003cline hits=\"1\" number=\"105\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"107\"/\u003e\n \u003cline hits=\"1\" number=\"108\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"110\"/\u003e\n \u003cline hits=\"1\" number=\"111\"/\u003e\n \u003cline hits=\"1\" number=\"113\"/\u003e\n \u003cline hits=\"1\" number=\"115\"/\u003e\n \u003cline hits=\"1\" number=\"120\"/\u003e\n \u003cline hits=\"1\" number=\"121\"/\u003e\n \u003cline hits=\"1\" number=\"122\"/\u003e\n \u003cline hits=\"1\" number=\"125\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"127\"/\u003e\n \u003cline hits=\"1\" number=\"128\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"50% (1/2)\" hits=\"1\" missing-branches=\"134\" number=\"130\"/\u003e\n \u003cline hits=\"1\" number=\"131\"/\u003e\n \u003cline hits=\"0\" number=\"134\"/\u003e\n \u003cline hits=\"1\" number=\"136\"/\u003e\n \u003cline hits=\"1\" number=\"139\"/\u003e\n \u003cline hits=\"1\" number=\"141\"/\u003e\n \u003cline hits=\"1\" number=\"144\"/\u003e\n \u003cline hits=\"1\" number=\"146\"/\u003e\n \u003cline hits=\"1\" number=\"149\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"151\"/\u003e\n \u003cline hits=\"1\" number=\"152\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"154\"/\u003e\n \u003cline hits=\"1\" number=\"155\"/\u003e\n \u003cline hits=\"1\" number=\"157\"/\u003e\n \u003c/lines\u003e\n \u003c/class\u003e\n \u003cclass branch-rate=\"1\" complexity=\"0\" filename=\"/code/s3tree/s3tree/exceptions.py\" line-rate=\"1\" name=\"exceptions.py\"\u003e\n \u003cmethods/\u003e\n \u003clines\u003e\n \u003cline hits=\"1\" number=\"5\"/\u003e\n \u003cline hits=\"1\" number=\"6\"/\u003e\n \u003cline hits=\"1\" number=\"7\"/\u003e\n \u003cline hits=\"1\" number=\"11\"/\u003e\n \u003cline hits=\"1\" number=\"14\"/\u003e\n \u003cline hits=\"1\" number=\"15\"/\u003e\n \u003cline hits=\"1\" number=\"16\"/\u003e\n \u003cline hits=\"1\" number=\"17\"/\u003e\n \u003cline hits=\"1\" number=\"20\"/\u003e\n \u003cline hits=\"1\" number=\"21\"/\u003e\n \u003cline hits=\"1\" number=\"22\"/\u003e\n \u003cline hits=\"1\" number=\"25\"/\u003e\n \u003cline hits=\"1\" number=\"28\"/\u003e\n \u003cline hits=\"1\" number=\"29\"/\u003e\n \u003cline hits=\"1\" number=\"30\"/\u003e\n \u003cline hits=\"1\" number=\"31\"/\u003e\n \u003cline hits=\"1\" number=\"34\"/\u003e\n \u003cline hits=\"1\" number=\"35\"/\u003e\n \u003cline hits=\"1\" number=\"36\"/\u003e\n \u003cline hits=\"1\" number=\"37\"/\u003e\n \u003cline hits=\"1\" number=\"40\"/\u003e\n \u003cline hits=\"1\" number=\"41\"/\u003e\n \u003cline hits=\"1\" number=\"42\"/\u003e\n \u003cline hits=\"1\" number=\"43\"/\u003e\n \u003c/lines\u003e\n \u003c/class\u003e\n \u003cclass branch-rate=\"1\" complexity=\"0\" filename=\"/code/s3tree/s3tree/models.py\" line-rate=\"0.9615\" name=\"models.py\"\u003e\n \u003cmethods/\u003e\n \u003clines\u003e\n \u003cline hits=\"1\" number=\"3\"/\u003e\n \u003cline hits=\"1\" number=\"5\"/\u003e\n \u003cline hits=\"1\" number=\"6\"/\u003e\n \u003cline hits=\"1\" number=\"7\"/\u003e\n \u003cline hits=\"1\" number=\"8\"/\u003e\n \u003cline hits=\"1\" number=\"9\"/\u003e\n \u003cline hits=\"1\" number=\"10\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"13\"/\u003e\n \u003cline hits=\"1\" number=\"14\"/\u003e\n \u003cline hits=\"1\" number=\"19\"/\u003e\n \u003cline hits=\"1\" number=\"20\"/\u003e\n \u003cline hits=\"1\" number=\"21\"/\u003e\n \u003cline hits=\"1\" number=\"23\"/\u003e\n \u003cline hits=\"1\" number=\"25\"/\u003e\n \u003cline hits=\"1\" number=\"27\"/\u003e\n \u003cline hits=\"1\" number=\"28\"/\u003e\n \u003cline hits=\"1\" number=\"30\"/\u003e\n \u003cline hits=\"1\" number=\"31\"/\u003e\n \u003cline hits=\"1\" number=\"37\"/\u003e\n \u003cline hits=\"1\" number=\"40\"/\u003e\n \u003cline hits=\"1\" number=\"45\"/\u003e\n \u003cline hits=\"1\" number=\"48\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"51\"/\u003e\n \u003cline hits=\"1\" number=\"52\"/\u003e\n \u003cline hits=\"1\" number=\"55\"/\u003e\n \u003cline hits=\"1\" number=\"57\"/\u003e\n \u003cline hits=\"1\" number=\"58\"/\u003e\n \u003cline hits=\"1\" number=\"59\"/\u003e\n \u003cline hits=\"1\" number=\"60\"/\u003e\n \u003cline hits=\"1\" number=\"61\"/\u003e\n \u003cline hits=\"1\" number=\"64\"/\u003e\n \u003cline hits=\"1\" number=\"67\"/\u003e\n \u003cline hits=\"1\" number=\"69\"/\u003e\n \u003cline hits=\"1\" number=\"72\"/\u003e\n \u003cline hits=\"1\" number=\"74\"/\u003e\n \u003cline hits=\"1\" number=\"77\"/\u003e\n \u003cline hits=\"1\" number=\"79\"/\u003e\n \u003cline hits=\"1\" number=\"82\"/\u003e\n \u003cline hits=\"1\" number=\"84\"/\u003e\n \u003cline hits=\"1\" number=\"86\"/\u003e\n \u003cline hits=\"1\" number=\"87\"/\u003e\n \u003cline hits=\"0\" number=\"90\"/\u003e\n \u003cline hits=\"0\" number=\"91\"/\u003e\n \u003cline hits=\"1\" number=\"93\"/\u003e\n \u003cline hits=\"1\" number=\"94\"/\u003e\n \u003cline hits=\"1\" number=\"96\"/\u003e\n \u003cline hits=\"1\" number=\"99\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"101\"/\u003e\n \u003cline hits=\"1\" number=\"102\"/\u003e\n \u003cline hits=\"1\" number=\"103\"/\u003e\n \u003cline hits=\"1\" number=\"105\"/\u003e\n \u003cline hits=\"1\" number=\"108\"/\u003e\n \u003c/lines\u003e\n \u003c/class\u003e\n \u003cclass branch-rate=\"0.5\" complexity=\"0\" filename=\"/code/s3tree/s3tree/types.py\" line-rate=\"1\" name=\"types.py\"\u003e\n \u003cmethods/\u003e\n \u003clines\u003e\n \u003cline hits=\"1\" number=\"3\"/\u003e\n \u003cline hits=\"1\" number=\"6\"/\u003e\n \u003cline hits=\"1\" number=\"8\"/\u003e\n \u003cline hits=\"1\" number=\"10\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"50% (1/2)\" hits=\"1\" missing-branches=\"14\" number=\"11\"/\u003e\n \u003cline hits=\"1\" number=\"12\"/\u003e\n \u003cline hits=\"1\" number=\"14\"/\u003e\n \u003cline hits=\"1\" number=\"17\"/\u003e\n \u003cline hits=\"1\" number=\"18\"/\u003e\n \u003cline hits=\"1\" number=\"21\"/\u003e\n \u003cline hits=\"1\" number=\"22\"/\u003e\n \u003cline hits=\"1\" number=\"23\"/\u003e\n \u003cline hits=\"1\" number=\"24\"/\u003e\n \u003c/lines\u003e\n \u003c/class\u003e\n \u003cclass branch-rate=\"1\" complexity=\"0\" filename=\"/code/s3tree/s3tree/utils.py\" line-rate=\"1\" name=\"utils.py\"\u003e\n \u003cmethods/\u003e\n \u003clines\u003e\n \u003cline hits=\"1\" number=\"3\"/\u003e\n \u003cline hits=\"1\" number=\"4\"/\u003e\n \u003cline hits=\"1\" number=\"5\"/\u003e\n \u003cline hits=\"1\" number=\"6\"/\u003e\n \u003cline hits=\"1\" number=\"8\"/\u003e\n \u003cline hits=\"1\" number=\"11\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"27\"/\u003e\n \u003cline hits=\"1\" number=\"28\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"30\"/\u003e\n \u003cline hits=\"1\" number=\"31\"/\u003e\n \u003cline hits=\"1\" number=\"34\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"37\"/\u003e\n \u003cline hits=\"1\" number=\"38\"/\u003e\n \u003cline hits=\"1\" number=\"40\"/\u003e\n \u003cline hits=\"1\" number=\"43\"/\u003e\n \u003cline hits=\"1\" number=\"56\"/\u003e\n \u003cline hits=\"1\" number=\"60\"/\u003e\n \u003cline hits=\"1\" number=\"65\"/\u003e\n \u003cline hits=\"1\" number=\"69\"/\u003e\n \u003cline hits=\"1\" number=\"73\"/\u003e\n \u003cline hits=\"1\" number=\"74\"/\u003e\n \u003cline hits=\"1\" number=\"76\"/\u003e\n \u003cline hits=\"1\" number=\"78\"/\u003e\n \u003cline hits=\"1\" number=\"81\"/\u003e\n \u003cline hits=\"1\" number=\"83\"/\u003e\n \u003c/lines\u003e\n \u003c/class\u003e\n \u003c/classes\u003e\n \u003c/package\u003e\n \u003c/packages\u003e\n\u003c/coverage\u003e\n","analyzer":"test-coverage","metadata":{"workDir":"/home/runner/code","compressed":"True"}}}} +{ + "query": "mutation($input: CreateArtifactInput!) {\r\n createArtifact(input: $input) {\r\n ok\r\n message\r\n error\r\n }\r\n}", + "variables": { + "input": { + "accessToken": "f59ab9314307", + "commitOid": "b9e678d8dcb43fa1340e8a0c579b2c642280dc27", + "reporter": "cli", + "reporterVersion": "v0.1.6", + "key": "python", + "data": "\u003c?xml version=\"1.0\" ?\u003e\n\u003ccoverage branch-rate=\"0.9333\" branches-covered=\"28\" branches-valid=\"30\" complexity=\"0\" line-rate=\"0.9839\" lines-covered=\"183\" lines-valid=\"186\" timestamp=\"1551180635459\" version=\"4.5.2\"\u003e\n \u003c!-- Generated by coverage.py: https://coverage.readthedocs.io --\u003e\n \u003c!-- Based on https://raw.githubusercontent.com/cobertura/web/master/htdocs/xml/coverage-04.dtd --\u003e\n \u003csources/\u003e\n \u003cpackages\u003e\n \u003cpackage branch-rate=\"0.9333\" complexity=\"0\" line-rate=\"0.9839\" name=\".Users.sanket.Code.s3tree.s3tree\"\u003e\n \u003cclasses\u003e\n \u003cclass branch-rate=\"1\" complexity=\"0\" filename=\"/code/s3tree/s3tree/__init__.py\" line-rate=\"1\" name=\"__init__.py\"\u003e\n \u003cmethods/\u003e\n \u003clines\u003e\n \u003cline hits=\"1\" number=\"4\"/\u003e\n \u003cline hits=\"1\" number=\"6\"/\u003e\n \u003cline hits=\"1\" number=\"7\"/\u003e\n \u003cline hits=\"1\" number=\"9\"/\u003e\n \u003cline hits=\"1\" number=\"10\"/\u003e\n \u003cline hits=\"1\" number=\"12\"/\u003e\n \u003c/lines\u003e\n \u003c/class\u003e\n \u003cclass branch-rate=\"1\" complexity=\"0\" filename=\"/code/s3tree/s3tree/__version__.py\" line-rate=\"1\" name=\"__version__.py\"\u003e\n \u003cmethods/\u003e\n \u003clines\u003e\n \u003cline hits=\"1\" number=\"4\"/\u003e\n \u003c/lines\u003e\n \u003c/class\u003e\n \u003cclass branch-rate=\"0.9375\" complexity=\"0\" filename=\"/code/s3tree/s3tree/core.py\" line-rate=\"0.9846\" name=\"core.py\"\u003e\n \u003cmethods/\u003e\n \u003clines\u003e\n \u003cline hits=\"1\" number=\"4\"/\u003e\n \u003cline hits=\"1\" number=\"5\"/\u003e\n \u003cline hits=\"1\" number=\"6\"/\u003e\n \u003cline hits=\"1\" number=\"7\"/\u003e\n \u003cline hits=\"1\" number=\"8\"/\u003e\n \u003cline hits=\"1\" number=\"10\"/\u003e\n \u003cline hits=\"1\" number=\"11\"/\u003e\n \u003cline hits=\"1\" number=\"13\"/\u003e\n \u003cline hits=\"1\" number=\"14\"/\u003e\n \u003cline hits=\"1\" number=\"17\"/\u003e\n \u003cline hits=\"1\" number=\"41\"/\u003e\n \u003cline hits=\"1\" number=\"43\"/\u003e\n \u003cline hits=\"1\" number=\"45\"/\u003e\n \u003cline hits=\"1\" number=\"49\"/\u003e\n \u003cline hits=\"1\" number=\"50\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"53\"/\u003e\n \u003cline hits=\"1\" number=\"54\"/\u003e\n \u003cline hits=\"1\" number=\"57\"/\u003e\n \u003cline hits=\"1\" number=\"61\"/\u003e\n \u003cline hits=\"1\" number=\"62\"/\u003e\n \u003cline hits=\"1\" number=\"65\"/\u003e\n \u003cline hits=\"1\" number=\"66\"/\u003e\n \u003cline hits=\"1\" number=\"69\"/\u003e\n \u003cline hits=\"1\" number=\"72\"/\u003e\n \u003cline hits=\"1\" number=\"73\"/\u003e\n \u003cline hits=\"1\" number=\"76\"/\u003e\n \u003cline hits=\"1\" number=\"78\"/\u003e\n \u003cline hits=\"1\" number=\"79\"/\u003e\n \u003cline hits=\"1\" number=\"81\"/\u003e\n \u003cline hits=\"1\" number=\"82\"/\u003e\n \u003cline hits=\"1\" number=\"84\"/\u003e\n \u003cline hits=\"1\" number=\"86\"/\u003e\n \u003cline hits=\"1\" number=\"90\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"94\"/\u003e\n \u003cline hits=\"1\" number=\"95\"/\u003e\n \u003cline hits=\"1\" number=\"99\"/\u003e\n \u003cline hits=\"1\" number=\"101\"/\u003e\n \u003cline hits=\"1\" number=\"104\"/\u003e\n \u003cline hits=\"1\" number=\"105\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"107\"/\u003e\n \u003cline hits=\"1\" number=\"108\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"110\"/\u003e\n \u003cline hits=\"1\" number=\"111\"/\u003e\n \u003cline hits=\"1\" number=\"113\"/\u003e\n \u003cline hits=\"1\" number=\"115\"/\u003e\n \u003cline hits=\"1\" number=\"120\"/\u003e\n \u003cline hits=\"1\" number=\"121\"/\u003e\n \u003cline hits=\"1\" number=\"122\"/\u003e\n \u003cline hits=\"1\" number=\"125\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"127\"/\u003e\n \u003cline hits=\"1\" number=\"128\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"50% (1/2)\" hits=\"1\" missing-branches=\"134\" number=\"130\"/\u003e\n \u003cline hits=\"1\" number=\"131\"/\u003e\n \u003cline hits=\"0\" number=\"134\"/\u003e\n \u003cline hits=\"1\" number=\"136\"/\u003e\n \u003cline hits=\"1\" number=\"139\"/\u003e\n \u003cline hits=\"1\" number=\"141\"/\u003e\n \u003cline hits=\"1\" number=\"144\"/\u003e\n \u003cline hits=\"1\" number=\"146\"/\u003e\n \u003cline hits=\"1\" number=\"149\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"151\"/\u003e\n \u003cline hits=\"1\" number=\"152\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"154\"/\u003e\n \u003cline hits=\"1\" number=\"155\"/\u003e\n \u003cline hits=\"1\" number=\"157\"/\u003e\n \u003c/lines\u003e\n \u003c/class\u003e\n \u003cclass branch-rate=\"1\" complexity=\"0\" filename=\"/code/s3tree/s3tree/exceptions.py\" line-rate=\"1\" name=\"exceptions.py\"\u003e\n \u003cmethods/\u003e\n \u003clines\u003e\n \u003cline hits=\"1\" number=\"5\"/\u003e\n \u003cline hits=\"1\" number=\"6\"/\u003e\n \u003cline hits=\"1\" number=\"7\"/\u003e\n \u003cline hits=\"1\" number=\"11\"/\u003e\n \u003cline hits=\"1\" number=\"14\"/\u003e\n \u003cline hits=\"1\" number=\"15\"/\u003e\n \u003cline hits=\"1\" number=\"16\"/\u003e\n \u003cline hits=\"1\" number=\"17\"/\u003e\n \u003cline hits=\"1\" number=\"20\"/\u003e\n \u003cline hits=\"1\" number=\"21\"/\u003e\n \u003cline hits=\"1\" number=\"22\"/\u003e\n \u003cline hits=\"1\" number=\"25\"/\u003e\n \u003cline hits=\"1\" number=\"28\"/\u003e\n \u003cline hits=\"1\" number=\"29\"/\u003e\n \u003cline hits=\"1\" number=\"30\"/\u003e\n \u003cline hits=\"1\" number=\"31\"/\u003e\n \u003cline hits=\"1\" number=\"34\"/\u003e\n \u003cline hits=\"1\" number=\"35\"/\u003e\n \u003cline hits=\"1\" number=\"36\"/\u003e\n \u003cline hits=\"1\" number=\"37\"/\u003e\n \u003cline hits=\"1\" number=\"40\"/\u003e\n \u003cline hits=\"1\" number=\"41\"/\u003e\n \u003cline hits=\"1\" number=\"42\"/\u003e\n \u003cline hits=\"1\" number=\"43\"/\u003e\n \u003c/lines\u003e\n \u003c/class\u003e\n \u003cclass branch-rate=\"1\" complexity=\"0\" filename=\"/code/s3tree/s3tree/models.py\" line-rate=\"0.9615\" name=\"models.py\"\u003e\n \u003cmethods/\u003e\n \u003clines\u003e\n \u003cline hits=\"1\" number=\"3\"/\u003e\n \u003cline hits=\"1\" number=\"5\"/\u003e\n \u003cline hits=\"1\" number=\"6\"/\u003e\n \u003cline hits=\"1\" number=\"7\"/\u003e\n \u003cline hits=\"1\" number=\"8\"/\u003e\n \u003cline hits=\"1\" number=\"9\"/\u003e\n \u003cline hits=\"1\" number=\"10\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"13\"/\u003e\n \u003cline hits=\"1\" number=\"14\"/\u003e\n \u003cline hits=\"1\" number=\"19\"/\u003e\n \u003cline hits=\"1\" number=\"20\"/\u003e\n \u003cline hits=\"1\" number=\"21\"/\u003e\n \u003cline hits=\"1\" number=\"23\"/\u003e\n \u003cline hits=\"1\" number=\"25\"/\u003e\n \u003cline hits=\"1\" number=\"27\"/\u003e\n \u003cline hits=\"1\" number=\"28\"/\u003e\n \u003cline hits=\"1\" number=\"30\"/\u003e\n \u003cline hits=\"1\" number=\"31\"/\u003e\n \u003cline hits=\"1\" number=\"37\"/\u003e\n \u003cline hits=\"1\" number=\"40\"/\u003e\n \u003cline hits=\"1\" number=\"45\"/\u003e\n \u003cline hits=\"1\" number=\"48\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"51\"/\u003e\n \u003cline hits=\"1\" number=\"52\"/\u003e\n \u003cline hits=\"1\" number=\"55\"/\u003e\n \u003cline hits=\"1\" number=\"57\"/\u003e\n \u003cline hits=\"1\" number=\"58\"/\u003e\n \u003cline hits=\"1\" number=\"59\"/\u003e\n \u003cline hits=\"1\" number=\"60\"/\u003e\n \u003cline hits=\"1\" number=\"61\"/\u003e\n \u003cline hits=\"1\" number=\"64\"/\u003e\n \u003cline hits=\"1\" number=\"67\"/\u003e\n \u003cline hits=\"1\" number=\"69\"/\u003e\n \u003cline hits=\"1\" number=\"72\"/\u003e\n \u003cline hits=\"1\" number=\"74\"/\u003e\n \u003cline hits=\"1\" number=\"77\"/\u003e\n \u003cline hits=\"1\" number=\"79\"/\u003e\n \u003cline hits=\"1\" number=\"82\"/\u003e\n \u003cline hits=\"1\" number=\"84\"/\u003e\n \u003cline hits=\"1\" number=\"86\"/\u003e\n \u003cline hits=\"1\" number=\"87\"/\u003e\n \u003cline hits=\"0\" number=\"90\"/\u003e\n \u003cline hits=\"0\" number=\"91\"/\u003e\n \u003cline hits=\"1\" number=\"93\"/\u003e\n \u003cline hits=\"1\" number=\"94\"/\u003e\n \u003cline hits=\"1\" number=\"96\"/\u003e\n \u003cline hits=\"1\" number=\"99\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"101\"/\u003e\n \u003cline hits=\"1\" number=\"102\"/\u003e\n \u003cline hits=\"1\" number=\"103\"/\u003e\n \u003cline hits=\"1\" number=\"105\"/\u003e\n \u003cline hits=\"1\" number=\"108\"/\u003e\n \u003c/lines\u003e\n \u003c/class\u003e\n \u003cclass branch-rate=\"0.5\" complexity=\"0\" filename=\"/code/s3tree/s3tree/types.py\" line-rate=\"1\" name=\"types.py\"\u003e\n \u003cmethods/\u003e\n \u003clines\u003e\n \u003cline hits=\"1\" number=\"3\"/\u003e\n \u003cline hits=\"1\" number=\"6\"/\u003e\n \u003cline hits=\"1\" number=\"8\"/\u003e\n \u003cline hits=\"1\" number=\"10\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"50% (1/2)\" hits=\"1\" missing-branches=\"14\" number=\"11\"/\u003e\n \u003cline hits=\"1\" number=\"12\"/\u003e\n \u003cline hits=\"1\" number=\"14\"/\u003e\n \u003cline hits=\"1\" number=\"17\"/\u003e\n \u003cline hits=\"1\" number=\"18\"/\u003e\n \u003cline hits=\"1\" number=\"21\"/\u003e\n \u003cline hits=\"1\" number=\"22\"/\u003e\n \u003cline hits=\"1\" number=\"23\"/\u003e\n \u003cline hits=\"1\" number=\"24\"/\u003e\n \u003c/lines\u003e\n \u003c/class\u003e\n \u003cclass branch-rate=\"1\" complexity=\"0\" filename=\"/code/s3tree/s3tree/utils.py\" line-rate=\"1\" name=\"utils.py\"\u003e\n \u003cmethods/\u003e\n \u003clines\u003e\n \u003cline hits=\"1\" number=\"3\"/\u003e\n \u003cline hits=\"1\" number=\"4\"/\u003e\n \u003cline hits=\"1\" number=\"5\"/\u003e\n \u003cline hits=\"1\" number=\"6\"/\u003e\n \u003cline hits=\"1\" number=\"8\"/\u003e\n \u003cline hits=\"1\" number=\"11\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"27\"/\u003e\n \u003cline hits=\"1\" number=\"28\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"30\"/\u003e\n \u003cline hits=\"1\" number=\"31\"/\u003e\n \u003cline hits=\"1\" number=\"34\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"37\"/\u003e\n \u003cline hits=\"1\" number=\"38\"/\u003e\n \u003cline hits=\"1\" number=\"40\"/\u003e\n \u003cline hits=\"1\" number=\"43\"/\u003e\n \u003cline hits=\"1\" number=\"56\"/\u003e\n \u003cline hits=\"1\" number=\"60\"/\u003e\n \u003cline hits=\"1\" number=\"65\"/\u003e\n \u003cline hits=\"1\" number=\"69\"/\u003e\n \u003cline hits=\"1\" number=\"73\"/\u003e\n \u003cline hits=\"1\" number=\"74\"/\u003e\n \u003cline hits=\"1\" number=\"76\"/\u003e\n \u003cline hits=\"1\" number=\"78\"/\u003e\n \u003cline hits=\"1\" number=\"81\"/\u003e\n \u003cline hits=\"1\" number=\"83\"/\u003e\n \u003c/lines\u003e\n \u003c/class\u003e\n \u003c/classes\u003e\n \u003c/package\u003e\n \u003c/packages\u003e\n\u003c/coverage\u003e\n", + "analyzer": "test-coverage", + "analyzerType": "core", + "metadata": { + "workDir": "/home/runner/code", + "compressed": "True" + } + } + } +} \ No newline at end of file diff --git a/command/report/tests/report_workflow_test.go b/command/report/tests/report_workflow_test.go index 230da0d8..30b8db2b 100644 --- a/command/report/tests/report_workflow_test.go +++ b/command/report/tests/report_workflow_test.go @@ -37,8 +37,6 @@ func graphQLAPIMock(w http.ResponseWriter, r *http.Request) { return } - log.Println("Request body: ", string(req)) - // Check if the request has ArtifactMetadataInput in body if bytes.Contains(req, []byte("ArtifactMetadataInput")) { log.Println("ArtifactMetadataInput found in request body") @@ -82,7 +80,14 @@ func graphQLAPIMock(w http.ResponseWriter, r *http.Request) { reportQuery.Variables.Input.Data = string(decompressedData) // Read test graphql request body artifact file - requestBodyData, err := os.ReadFile("./golden_files/report_graphql_request_body.json") + requestBodyGoldenFilePath := "./golden_files/report_graphql_request_body.json" + + if reportQuery.Variables.Input.AnalyzerType == "community" { + // There's a separate goldenfile for request made with a type flag passed as community + requestBodyGoldenFilePath = "./golden_files/report_graphql_community_request_body.json" + } + + requestBodyData, err := os.ReadFile(requestBodyGoldenFilePath) if err != nil { log.Println(err) return @@ -96,6 +101,15 @@ func graphQLAPIMock(w http.ResponseWriter, r *http.Request) { return } + // Make a map for metadata with workdir and compressed.This is to make local tests respect env variables. + metadata := make(map[string]interface{}) + metadata["workDir"] = os.Getenv("CODE_PATH") + metadata["compressed"] = "True" + requestReportQuery.Variables.Input.Metadata = metadata + + // Also change the ReporterVersion to the version of the CLI + requestReportQuery.Variables.Input.ReporterVersion = report.CliVersion + // Read test graphql success response body artifact file successResponseBodyData, err := os.ReadFile("./golden_files/report_graphql_success_response_body.json") if err != nil { @@ -212,3 +226,46 @@ func TestReportKeyValueFileWorkflow(t *testing.T) { t.Errorf("Expected: %s, Got: %s", want, outStr) } } + +func TestReportAnalyzerTypeWorkflow(t *testing.T) { + cmd := exec.Command("/tmp/deepsource", + "report", + "--analyzer", + analyzer, + "--type", + "community", + "--key", + key, + "--value-file", + "/tmp/python_coverage.xml", + ) + + // Set env variables + cmd.Env = os.Environ() + cmd.Env = append(cmd.Env, "DEEPSOURCE_DSN="+dsn) + cmd.Dir = os.Getenv("CODE_PATH") + + var stdout, stderr bytes.Buffer + cmd.Stdout = &stdout + cmd.Stderr = &stderr + + err := cmd.Run() + + outStr, errStr := stdout.String(), stderr.String() + log.Printf("== Run deepsource CLI command ==\n%s\n%s\n", outStr, errStr) + + if err != nil { + log.Println(outStr) + log.Println(errStr) + t.Errorf("Error executing deepsource CLI command: %v", err) + } + + output, err := os.ReadFile("./golden_files/report_success.txt") + if err != nil { + t.Fatal(err) + } + + if want := string(output); want != outStr { + t.Errorf("Expected: %s, Got: %s", want, outStr) + } +} diff --git a/command/report/types.go b/command/report/types.go index 5e464b4b..e56b5c3e 100644 --- a/command/report/types.go +++ b/command/report/types.go @@ -10,6 +10,7 @@ type ReportQueryInput struct { Key string `json:"key"` Data string `json:"data"` AnalyzerShortcode string `json:"analyzer"` + AnalyzerType string `json:"analyzerType"` Metadata interface{} `json:"metadata,omitempty"` } From 468a9c162dc2f9874eb2967e962049fd1a122036 Mon Sep 17 00:00:00 2001 From: Srijan Saurav Date: Tue, 7 Nov 2023 17:45:24 +0530 Subject: [PATCH 2/3] rename `--type` to `--analyzer-type` --- command/report/report.go | 6 +++--- command/report/tests/report_workflow_test.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/command/report/report.go b/command/report/report.go index b8859e61..8520ee5a 100644 --- a/command/report/report.go +++ b/command/report/report.go @@ -19,7 +19,7 @@ import ( type ReportOptions struct { Analyzer string - Type string + AnalyzerType string Key string Value string ValueFile string @@ -58,7 +58,7 @@ func NewCmdReport() *cobra.Command { // --repo, -r flag cmd.Flags().StringVar(&opts.Analyzer, "analyzer", "", "name of the analyzer to report the artifact to (example: test-coverage)") - cmd.Flags().StringVar(&opts.Type, "type", "core", "type of the analyzer (example: community)") + cmd.Flags().StringVar(&opts.AnalyzerType, "analyzer-type", "core", "type of the analyzer") cmd.Flags().StringVar(&opts.Key, "key", "", "shortcode of the language (example: go)") @@ -88,7 +88,7 @@ func (opts *ReportOptions) Run() int { ///////////////////// reportCommandAnalyzerShortcode := strings.TrimSpace(opts.Analyzer) - reportCommandAnalyzerType := strings.TrimSpace(opts.Type) + reportCommandAnalyzerType := strings.TrimSpace(opts.AnalyzerType) reportCommandKey := strings.TrimSpace(opts.Key) reportCommandValue := opts.Value reportCommandValueFile := strings.TrimSpace(opts.ValueFile) diff --git a/command/report/tests/report_workflow_test.go b/command/report/tests/report_workflow_test.go index 30b8db2b..186ab8ba 100644 --- a/command/report/tests/report_workflow_test.go +++ b/command/report/tests/report_workflow_test.go @@ -232,7 +232,7 @@ func TestReportAnalyzerTypeWorkflow(t *testing.T) { "report", "--analyzer", analyzer, - "--type", + "--analyzer-type", "community", "--key", key, From c4c991828a59f7f224b1dcebb407ce8b6f1a9bff Mon Sep 17 00:00:00 2001 From: Srijan Saurav Date: Thu, 9 Nov 2023 15:04:59 +0530 Subject: [PATCH 3/3] add `analyzerType` to the query only when it is passed This is to maintain backwards compatibility --- command/report/report.go | 12 +++++++++--- .../golden_files/report_graphql_request_body.json | 1 - command/report/types.go | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/command/report/report.go b/command/report/report.go index 8520ee5a..41131226 100644 --- a/command/report/report.go +++ b/command/report/report.go @@ -58,7 +58,7 @@ func NewCmdReport() *cobra.Command { // --repo, -r flag cmd.Flags().StringVar(&opts.Analyzer, "analyzer", "", "name of the analyzer to report the artifact to (example: test-coverage)") - cmd.Flags().StringVar(&opts.AnalyzerType, "analyzer-type", "core", "type of the analyzer") + cmd.Flags().StringVar(&opts.AnalyzerType, "analyzer-type", "", "type of the analyzer (example: community)") cmd.Flags().StringVar(&opts.Key, "key", "", "shortcode of the language (example: go)") @@ -309,11 +309,17 @@ func (opts *ReportOptions) Run() int { Key: artifactKey, Data: artifactValue, AnalyzerShortcode: analyzerShortcode, - AnalyzerType: analyzerType, - Metadata: reportMeta, + // AnalyzerType: analyzerType, // Add this in the later steps, only is the analyzer type is passed. + // This makes sure that the cli is always backwards compatible. The API is designed to accept analyzer type only if it is passed. + Metadata: reportMeta, } query := ReportQuery{Query: reportGraphqlQuery} + // Check if analyzerType is passed and add it to the queryInput + if analyzerType != "" { + queryInput.AnalyzerType = analyzerType + } + // Pass queryInput to the query query.Variables.Input = queryInput // Marshal request body diff --git a/command/report/tests/golden_files/report_graphql_request_body.json b/command/report/tests/golden_files/report_graphql_request_body.json index d49dfc0e..8873419b 100644 --- a/command/report/tests/golden_files/report_graphql_request_body.json +++ b/command/report/tests/golden_files/report_graphql_request_body.json @@ -9,7 +9,6 @@ "key": "python", "data": "\u003c?xml version=\"1.0\" ?\u003e\n\u003ccoverage branch-rate=\"0.9333\" branches-covered=\"28\" branches-valid=\"30\" complexity=\"0\" line-rate=\"0.9839\" lines-covered=\"183\" lines-valid=\"186\" timestamp=\"1551180635459\" version=\"4.5.2\"\u003e\n \u003c!-- Generated by coverage.py: https://coverage.readthedocs.io --\u003e\n \u003c!-- Based on https://raw.githubusercontent.com/cobertura/web/master/htdocs/xml/coverage-04.dtd --\u003e\n \u003csources/\u003e\n \u003cpackages\u003e\n \u003cpackage branch-rate=\"0.9333\" complexity=\"0\" line-rate=\"0.9839\" name=\".Users.sanket.Code.s3tree.s3tree\"\u003e\n \u003cclasses\u003e\n \u003cclass branch-rate=\"1\" complexity=\"0\" filename=\"/code/s3tree/s3tree/__init__.py\" line-rate=\"1\" name=\"__init__.py\"\u003e\n \u003cmethods/\u003e\n \u003clines\u003e\n \u003cline hits=\"1\" number=\"4\"/\u003e\n \u003cline hits=\"1\" number=\"6\"/\u003e\n \u003cline hits=\"1\" number=\"7\"/\u003e\n \u003cline hits=\"1\" number=\"9\"/\u003e\n \u003cline hits=\"1\" number=\"10\"/\u003e\n \u003cline hits=\"1\" number=\"12\"/\u003e\n \u003c/lines\u003e\n \u003c/class\u003e\n \u003cclass branch-rate=\"1\" complexity=\"0\" filename=\"/code/s3tree/s3tree/__version__.py\" line-rate=\"1\" name=\"__version__.py\"\u003e\n \u003cmethods/\u003e\n \u003clines\u003e\n \u003cline hits=\"1\" number=\"4\"/\u003e\n \u003c/lines\u003e\n \u003c/class\u003e\n \u003cclass branch-rate=\"0.9375\" complexity=\"0\" filename=\"/code/s3tree/s3tree/core.py\" line-rate=\"0.9846\" name=\"core.py\"\u003e\n \u003cmethods/\u003e\n \u003clines\u003e\n \u003cline hits=\"1\" number=\"4\"/\u003e\n \u003cline hits=\"1\" number=\"5\"/\u003e\n \u003cline hits=\"1\" number=\"6\"/\u003e\n \u003cline hits=\"1\" number=\"7\"/\u003e\n \u003cline hits=\"1\" number=\"8\"/\u003e\n \u003cline hits=\"1\" number=\"10\"/\u003e\n \u003cline hits=\"1\" number=\"11\"/\u003e\n \u003cline hits=\"1\" number=\"13\"/\u003e\n \u003cline hits=\"1\" number=\"14\"/\u003e\n \u003cline hits=\"1\" number=\"17\"/\u003e\n \u003cline hits=\"1\" number=\"41\"/\u003e\n \u003cline hits=\"1\" number=\"43\"/\u003e\n \u003cline hits=\"1\" number=\"45\"/\u003e\n \u003cline hits=\"1\" number=\"49\"/\u003e\n \u003cline hits=\"1\" number=\"50\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"53\"/\u003e\n \u003cline hits=\"1\" number=\"54\"/\u003e\n \u003cline hits=\"1\" number=\"57\"/\u003e\n \u003cline hits=\"1\" number=\"61\"/\u003e\n \u003cline hits=\"1\" number=\"62\"/\u003e\n \u003cline hits=\"1\" number=\"65\"/\u003e\n \u003cline hits=\"1\" number=\"66\"/\u003e\n \u003cline hits=\"1\" number=\"69\"/\u003e\n \u003cline hits=\"1\" number=\"72\"/\u003e\n \u003cline hits=\"1\" number=\"73\"/\u003e\n \u003cline hits=\"1\" number=\"76\"/\u003e\n \u003cline hits=\"1\" number=\"78\"/\u003e\n \u003cline hits=\"1\" number=\"79\"/\u003e\n \u003cline hits=\"1\" number=\"81\"/\u003e\n \u003cline hits=\"1\" number=\"82\"/\u003e\n \u003cline hits=\"1\" number=\"84\"/\u003e\n \u003cline hits=\"1\" number=\"86\"/\u003e\n \u003cline hits=\"1\" number=\"90\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"94\"/\u003e\n \u003cline hits=\"1\" number=\"95\"/\u003e\n \u003cline hits=\"1\" number=\"99\"/\u003e\n \u003cline hits=\"1\" number=\"101\"/\u003e\n \u003cline hits=\"1\" number=\"104\"/\u003e\n \u003cline hits=\"1\" number=\"105\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"107\"/\u003e\n \u003cline hits=\"1\" number=\"108\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"110\"/\u003e\n \u003cline hits=\"1\" number=\"111\"/\u003e\n \u003cline hits=\"1\" number=\"113\"/\u003e\n \u003cline hits=\"1\" number=\"115\"/\u003e\n \u003cline hits=\"1\" number=\"120\"/\u003e\n \u003cline hits=\"1\" number=\"121\"/\u003e\n \u003cline hits=\"1\" number=\"122\"/\u003e\n \u003cline hits=\"1\" number=\"125\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"127\"/\u003e\n \u003cline hits=\"1\" number=\"128\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"50% (1/2)\" hits=\"1\" missing-branches=\"134\" number=\"130\"/\u003e\n \u003cline hits=\"1\" number=\"131\"/\u003e\n \u003cline hits=\"0\" number=\"134\"/\u003e\n \u003cline hits=\"1\" number=\"136\"/\u003e\n \u003cline hits=\"1\" number=\"139\"/\u003e\n \u003cline hits=\"1\" number=\"141\"/\u003e\n \u003cline hits=\"1\" number=\"144\"/\u003e\n \u003cline hits=\"1\" number=\"146\"/\u003e\n \u003cline hits=\"1\" number=\"149\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"151\"/\u003e\n \u003cline hits=\"1\" number=\"152\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"154\"/\u003e\n \u003cline hits=\"1\" number=\"155\"/\u003e\n \u003cline hits=\"1\" number=\"157\"/\u003e\n \u003c/lines\u003e\n \u003c/class\u003e\n \u003cclass branch-rate=\"1\" complexity=\"0\" filename=\"/code/s3tree/s3tree/exceptions.py\" line-rate=\"1\" name=\"exceptions.py\"\u003e\n \u003cmethods/\u003e\n \u003clines\u003e\n \u003cline hits=\"1\" number=\"5\"/\u003e\n \u003cline hits=\"1\" number=\"6\"/\u003e\n \u003cline hits=\"1\" number=\"7\"/\u003e\n \u003cline hits=\"1\" number=\"11\"/\u003e\n \u003cline hits=\"1\" number=\"14\"/\u003e\n \u003cline hits=\"1\" number=\"15\"/\u003e\n \u003cline hits=\"1\" number=\"16\"/\u003e\n \u003cline hits=\"1\" number=\"17\"/\u003e\n \u003cline hits=\"1\" number=\"20\"/\u003e\n \u003cline hits=\"1\" number=\"21\"/\u003e\n \u003cline hits=\"1\" number=\"22\"/\u003e\n \u003cline hits=\"1\" number=\"25\"/\u003e\n \u003cline hits=\"1\" number=\"28\"/\u003e\n \u003cline hits=\"1\" number=\"29\"/\u003e\n \u003cline hits=\"1\" number=\"30\"/\u003e\n \u003cline hits=\"1\" number=\"31\"/\u003e\n \u003cline hits=\"1\" number=\"34\"/\u003e\n \u003cline hits=\"1\" number=\"35\"/\u003e\n \u003cline hits=\"1\" number=\"36\"/\u003e\n \u003cline hits=\"1\" number=\"37\"/\u003e\n \u003cline hits=\"1\" number=\"40\"/\u003e\n \u003cline hits=\"1\" number=\"41\"/\u003e\n \u003cline hits=\"1\" number=\"42\"/\u003e\n \u003cline hits=\"1\" number=\"43\"/\u003e\n \u003c/lines\u003e\n \u003c/class\u003e\n \u003cclass branch-rate=\"1\" complexity=\"0\" filename=\"/code/s3tree/s3tree/models.py\" line-rate=\"0.9615\" name=\"models.py\"\u003e\n \u003cmethods/\u003e\n \u003clines\u003e\n \u003cline hits=\"1\" number=\"3\"/\u003e\n \u003cline hits=\"1\" number=\"5\"/\u003e\n \u003cline hits=\"1\" number=\"6\"/\u003e\n \u003cline hits=\"1\" number=\"7\"/\u003e\n \u003cline hits=\"1\" number=\"8\"/\u003e\n \u003cline hits=\"1\" number=\"9\"/\u003e\n \u003cline hits=\"1\" number=\"10\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"13\"/\u003e\n \u003cline hits=\"1\" number=\"14\"/\u003e\n \u003cline hits=\"1\" number=\"19\"/\u003e\n \u003cline hits=\"1\" number=\"20\"/\u003e\n \u003cline hits=\"1\" number=\"21\"/\u003e\n \u003cline hits=\"1\" number=\"23\"/\u003e\n \u003cline hits=\"1\" number=\"25\"/\u003e\n \u003cline hits=\"1\" number=\"27\"/\u003e\n \u003cline hits=\"1\" number=\"28\"/\u003e\n \u003cline hits=\"1\" number=\"30\"/\u003e\n \u003cline hits=\"1\" number=\"31\"/\u003e\n \u003cline hits=\"1\" number=\"37\"/\u003e\n \u003cline hits=\"1\" number=\"40\"/\u003e\n \u003cline hits=\"1\" number=\"45\"/\u003e\n \u003cline hits=\"1\" number=\"48\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"51\"/\u003e\n \u003cline hits=\"1\" number=\"52\"/\u003e\n \u003cline hits=\"1\" number=\"55\"/\u003e\n \u003cline hits=\"1\" number=\"57\"/\u003e\n \u003cline hits=\"1\" number=\"58\"/\u003e\n \u003cline hits=\"1\" number=\"59\"/\u003e\n \u003cline hits=\"1\" number=\"60\"/\u003e\n \u003cline hits=\"1\" number=\"61\"/\u003e\n \u003cline hits=\"1\" number=\"64\"/\u003e\n \u003cline hits=\"1\" number=\"67\"/\u003e\n \u003cline hits=\"1\" number=\"69\"/\u003e\n \u003cline hits=\"1\" number=\"72\"/\u003e\n \u003cline hits=\"1\" number=\"74\"/\u003e\n \u003cline hits=\"1\" number=\"77\"/\u003e\n \u003cline hits=\"1\" number=\"79\"/\u003e\n \u003cline hits=\"1\" number=\"82\"/\u003e\n \u003cline hits=\"1\" number=\"84\"/\u003e\n \u003cline hits=\"1\" number=\"86\"/\u003e\n \u003cline hits=\"1\" number=\"87\"/\u003e\n \u003cline hits=\"0\" number=\"90\"/\u003e\n \u003cline hits=\"0\" number=\"91\"/\u003e\n \u003cline hits=\"1\" number=\"93\"/\u003e\n \u003cline hits=\"1\" number=\"94\"/\u003e\n \u003cline hits=\"1\" number=\"96\"/\u003e\n \u003cline hits=\"1\" number=\"99\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"101\"/\u003e\n \u003cline hits=\"1\" number=\"102\"/\u003e\n \u003cline hits=\"1\" number=\"103\"/\u003e\n \u003cline hits=\"1\" number=\"105\"/\u003e\n \u003cline hits=\"1\" number=\"108\"/\u003e\n \u003c/lines\u003e\n \u003c/class\u003e\n \u003cclass branch-rate=\"0.5\" complexity=\"0\" filename=\"/code/s3tree/s3tree/types.py\" line-rate=\"1\" name=\"types.py\"\u003e\n \u003cmethods/\u003e\n \u003clines\u003e\n \u003cline hits=\"1\" number=\"3\"/\u003e\n \u003cline hits=\"1\" number=\"6\"/\u003e\n \u003cline hits=\"1\" number=\"8\"/\u003e\n \u003cline hits=\"1\" number=\"10\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"50% (1/2)\" hits=\"1\" missing-branches=\"14\" number=\"11\"/\u003e\n \u003cline hits=\"1\" number=\"12\"/\u003e\n \u003cline hits=\"1\" number=\"14\"/\u003e\n \u003cline hits=\"1\" number=\"17\"/\u003e\n \u003cline hits=\"1\" number=\"18\"/\u003e\n \u003cline hits=\"1\" number=\"21\"/\u003e\n \u003cline hits=\"1\" number=\"22\"/\u003e\n \u003cline hits=\"1\" number=\"23\"/\u003e\n \u003cline hits=\"1\" number=\"24\"/\u003e\n \u003c/lines\u003e\n \u003c/class\u003e\n \u003cclass branch-rate=\"1\" complexity=\"0\" filename=\"/code/s3tree/s3tree/utils.py\" line-rate=\"1\" name=\"utils.py\"\u003e\n \u003cmethods/\u003e\n \u003clines\u003e\n \u003cline hits=\"1\" number=\"3\"/\u003e\n \u003cline hits=\"1\" number=\"4\"/\u003e\n \u003cline hits=\"1\" number=\"5\"/\u003e\n \u003cline hits=\"1\" number=\"6\"/\u003e\n \u003cline hits=\"1\" number=\"8\"/\u003e\n \u003cline hits=\"1\" number=\"11\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"27\"/\u003e\n \u003cline hits=\"1\" number=\"28\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"30\"/\u003e\n \u003cline hits=\"1\" number=\"31\"/\u003e\n \u003cline hits=\"1\" number=\"34\"/\u003e\n \u003cline branch=\"true\" condition-coverage=\"100% (2/2)\" hits=\"1\" number=\"37\"/\u003e\n \u003cline hits=\"1\" number=\"38\"/\u003e\n \u003cline hits=\"1\" number=\"40\"/\u003e\n \u003cline hits=\"1\" number=\"43\"/\u003e\n \u003cline hits=\"1\" number=\"56\"/\u003e\n \u003cline hits=\"1\" number=\"60\"/\u003e\n \u003cline hits=\"1\" number=\"65\"/\u003e\n \u003cline hits=\"1\" number=\"69\"/\u003e\n \u003cline hits=\"1\" number=\"73\"/\u003e\n \u003cline hits=\"1\" number=\"74\"/\u003e\n \u003cline hits=\"1\" number=\"76\"/\u003e\n \u003cline hits=\"1\" number=\"78\"/\u003e\n \u003cline hits=\"1\" number=\"81\"/\u003e\n \u003cline hits=\"1\" number=\"83\"/\u003e\n \u003c/lines\u003e\n \u003c/class\u003e\n \u003c/classes\u003e\n \u003c/package\u003e\n \u003c/packages\u003e\n\u003c/coverage\u003e\n", "analyzer": "test-coverage", - "analyzerType": "core", "metadata": { "workDir": "/home/runner/code", "compressed": "True" diff --git a/command/report/types.go b/command/report/types.go index e56b5c3e..ab69242c 100644 --- a/command/report/types.go +++ b/command/report/types.go @@ -10,7 +10,7 @@ type ReportQueryInput struct { Key string `json:"key"` Data string `json:"data"` AnalyzerShortcode string `json:"analyzer"` - AnalyzerType string `json:"analyzerType"` + AnalyzerType string `json:"analyzerType,omitempty"` Metadata interface{} `json:"metadata,omitempty"` }