Skip to content

Add json output for report command#181

Merged
smacker merged 7 commits intosrc-d:masterfrom
smacker:json_output
Jan 25, 2019
Merged

Add json output for report command#181
smacker merged 7 commits intosrc-d:masterfrom
smacker:json_output

Conversation

@smacker
Copy link
Copy Markdown
Contributor

@smacker smacker commented Jan 22, 2019

We need it for PoC.

Signed-off-by: Maxim Sukharev <max@smacker.ru>
Replace --format param with --cassandra format which would enable
advanced cql queries.
Now functionality with Cassandra & ScyllaDB are the same.

Signed-off-by: Maxim Sukharev <max@smacker.ru>
Signed-off-by: Maxim Sukharev <max@smacker.ru>
Signed-off-by: Maxim Sukharev <max@smacker.ru>
Signed-off-by: Maxim Sukharev <max@smacker.ru>
Signed-off-by: Maxim Sukharev <max@smacker.ru>
@smacker smacker requested review from carlosms and smola January 22, 2019 16:14
@smacker
Copy link
Copy Markdown
Contributor Author

smacker commented Jan 22, 2019

Output example:

$ ./report --output-format=json | tail -n +2 | jq
{
  "duplicates": [
    [
      {
        "repo": "github.com/erizocosmico/borges.git",
        "commit": "b1fcd3bf0ba810c05cb418babc09cc7f7783cc03",
        "path": "MAINTAINERS",
        "sha": "dc6817245a5213ab250471276acb61c186acab11"
      },
      {
        "repo": "github.com/src-d/borges.git",
        "commit": "e784f9d5f59d5c081c5f8f71b6c517918b899df0",
        "path": "MAINTAINERS",
        "sha": "dc6817245a5213ab250471276acb61c186acab11"
      }
    ],
    ...
  ],
  "similarities": [
    [
      {
        "file": {
          "repo": "github.com/src-d/borges.git",
          "commit": "e784f9d5f59d5c081c5f8f71b6c517918b899df0",
          "path": "consumer_test.go",
          "sha": "c1dc2a658b05a68f6e68cffe953d119898f2f657"
        }
      },
      {
        "file": {
          "repo": "github.com/erizocosmico/borges.git",
          "commit": "b1fcd3bf0ba810c05cb418babc09cc7f7783cc03",
          "path": "consumer_test.go",
          "sha": "f55507972a35a9fb080a41d769d7ff2526a605be"
        }
      }
    ],
    ...
  ]
}

Copy link
Copy Markdown
Contributor

@carlosms carlosms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, although it would be nice to have docs for the new option. Maybe we can open an issue to document it later to not block the PoC.

Signed-off-by: Maxim Sukharev <max@smacker.ru>
@smacker
Copy link
Copy Markdown
Contributor Author

smacker commented Jan 22, 2019

Thanks! Added new cli params to README.

@smacker smacker merged commit 62695cc into src-d:master Jan 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants