Green-Software-Foundation / if

Impact Framework
https://if.greensoftware.foundation/
MIT License
157 stars 41 forks source link

Better developer experience CLI params and exhaust behavior #499

Closed jawache closed 5 months ago

jawache commented 8 months ago

After working with the new version of IE I have some suggestions for improving the developer experience with a different CLI args as well as other approaches I would take.

ie 
--manifest: <your manifest file>
--exhaust: yaml (default) or csv or a configured custom exhaust plugin name
--outfile: the name of the file to output to (full path, the user should expect this to be the name of the file they open without having to remember to append something to it)
--filter: only output this set of comma separated parameters (useful for CSV exporter and perhaps useful for Yaml exporter also)
--stdout: if this flag is present always also prints the YAML to STDOUT.
--verbose: raises the log level, prints a lot more detail.

Exhaust Configuration

Supporting native CSV export

Be consistent with YAML as the manifest file format

Regarding STDOUT

Logging

Perhaps there is no need for multiple simultaneous exhausts?

pazbardanl commented 8 months ago

@jawache @jmcook1186 @narekhovhannisyan The exhaust related directives above make sense to me, these are my inputs:

  1. If we take CSV as our main use case / example, this is how a command line will look like:

    ie 
    --manifest: my-manifest.yaml
    --exhaust: csv
    --outfile: my-exhausted-file.csv // this file is the being created by the csv export exhaust plugin which was specified in previous line
    --filter: energy, carbon
    --stdout
    --verbose

    question regarding filter - can you think of other meta-data such as timestamp that are always filtered-in?

  2. It might seem minor but it effects DX: if we are dynamically loading exhaust plugins (like regular ones), declaring the plugin in the --exhaust option must have the actual name of the plugin, same as we declare regular plugins:

    plugins:
    'time-sync':
      method: TimeSync // <==

    ... because this is the name that's being used for dynamically loading the plugin (@narekhovhannisyan please correct me here if this is inaccurate). Otherwise we'll need to maintain a mapping of alias (csv) --> plugin_name (ExportCsv) which is hard to maintain. So the command line should actually be:

    ie 
    --manifest: my-manifest.yaml
    --exhaust: ExportCsv // ...which is the actual name of the plugin
    ...
  3. Notice we have an issue this sprint for refactoring the exhaust infra to dynamically load the exhaust plugins: https://github.com/Green-Software-Foundation/if/issues/492. I pretty sure these 2 could very well be worked on in parallel by 2 different ppl, but in this case some syncing is needed to prevent conflicts.

pazbardanl commented 8 months ago

hi @jmcook1186 seems this issue is for sprint 8 (ends 15/3) but with the upcoming freeze i dont think we will make it.

zanete commented 6 months ago

as per @jmcook1186 comment in slack: this is backlogged, and maybe actually could be closed out and restarted with a fresh issue later. The backstory was that we wanted to move the export of results from IF to a set of plugins rather than being core features, but we've had some doubts about whether this is really the way we want to go, and bumped the decision making until after the "trust" epic.

jmcook1186 commented 5 months ago

Closing as obseleted by new epics