capa icon indicating copy to clipboard operation
capa copied to clipboard

read and render results document

Open mr-tz opened this issue 2 years ago • 1 comments

when wanting to display different output modes, e.g. plain or verbose, the whole program needs to run again

with the results document saved by the user, we could also take that as an input and render per the specified arguments

alternatively/additionally, we could think about a "workspace option" combining the results and/or freeze output (underused, currently I think) to speed up subsequent runs

uses cases for this would be:

  • rule dev
  • results exploration

this will require a bit of refactoring so let's agree if this is worth it and how to do it, first

mr-tz avatar Apr 12 '22 07:04 mr-tz

rendering an existing results document is a great idea!

williballenthin avatar Apr 12 '22 18:04 williballenthin

Could you please explain it a bit more and guide me how to do it ?

ggold7046 avatar Mar 12 '23 15:03 ggold7046

For the rendering of an existing result document (JSON), we'll have to:

  • find a good way to provide the result file to capa
  • render the loaded results per the arguments

mr-tz avatar Mar 14 '23 07:03 mr-tz

@williballenthin is adding a new format FORMAT_RESULT a correct approach as by this we can reuse args.sample to accept json file as cited by @mr-tz ,and rather than --format=result we can just compare the initial buf.read of the file to be {"meta": to ensure its a results.json file

ooprathamm avatar Mar 23 '23 14:03 ooprathamm

Yes, an explicit new FORMAT and auto-detection via the first few bytes (and subquential successful loading) sound great.

mr-tz avatar Mar 23 '23 14:03 mr-tz

Hi @mr-tz -tz ,I would like to work on fixing issue. I would appreciate your guidance as I work on this issue. Let me know if you have any suggestions or guidance on how I can get started. Thank you!

EmperialX avatar Mar 28 '23 18:03 EmperialX

No, @ooprathamm is working on this in #1396 so let’s follow their work and lend a hand if they ask for help. Otherwise, is feature is already being addressed.

williballenthin avatar Mar 28 '23 19:03 williballenthin