twitter-archive / diffy

Find potential bugs in your services with Diffy
https://twitter.com/diffyproject
Apache License 2.0
3.83k stars 368 forks source link

How to export data from the server #76

Closed pedromss closed 5 years ago

pedromss commented 5 years ago

Is there a way to get a representation of the differences?

If not, is this something you would accept? Perhaps through an HTTP endpoint?

The use case for this is to be able to reset Diffy but keep the data regarding the differences.

puneetkhanduri commented 5 years ago

You can fetch the differences via the json api used to power the UI.

Take a look at https://github.com/opendiffy/diffy/blob/master/src/main/scala/ai/diffy/ApiController.scala

Let me know if you have something else in mind.

pedromss commented 5 years ago

Just discovered the JSON API last night while looking at the code. My first suggestion here would be to include this API in the README so people know it exists.

Looking at the API it appears one can:

The next step for this would be to include 2 buttons in the UI + 1 more endpoint:

As mentioned before the use case for this is to be able to reset Diffy keeping the differences data. The upload button is so people can see the old differences they downloaded in the UI which is a nicer way to view the differences, especially if you are presenting to more people.

If for some reason I'm missing something and one can already download and upload the differences currently in memory, please let me know.