if icon indicating copy to clipboard operation
if copied to clipboard

Parameter metadata audit feature

Open jmcook1186 opened this issue 1 year ago • 5 comments

What A feature (could be a new command) that checks a manifest and reports the number of unique parameters existing across all the plugins in a manifest and the proportion of them that have explicitly declared parameter metadata. If the coverage is not 100% it reports which parameters require metadata.

The feature could work as a new CLI command, if-metadata-check thattakes a manifest as it's sole argument, e,.g.

if-metadata-check -m <manifest .yml>

The output could look as follows:

metadata coverage: 95%
parameters without metadata:
- carbon
- energy

Why It is best practise to cover all parameters with metadata in the manifest. However, with large manifests it can be difficult to manually identify parameters whose metadata is missing.

Context This helps people with complex manifests conform to best practises

Prerequisites/resources n/a

SoW (scope of work)

  • [ ] add if-metadata-check to CLI
  • [ ] documentation updated
  • [ ] test cases added

Acceptance criteria

Scenario 1

Given the CLI has been shipped with the desired functionality

When I run if-metadata-check -m manifest.yml with the following manifest:

name: sum
description: successful path
tags:
initialize:
  plugins:
    sum:
      method: Sum
      path: "builtin"
      config:
        input-parameters: ["cpu/energy", "network/energy"]
        output-parameter: "energy"
tree:
  children:
    child:
      pipeline:
        compute:
          - sum
      inputs:
        - timestamp: 2023-08-06T00:00
          duration: 3600
          cpu/energy: 0.001
          network/energy: 0.001

Then I receive the following result:

metadata coverage: 0%
parameters without metadata:
- cpu/energy
- network/energy
- energy

Scenario 2

Given the CLI has been shipped with the desired functionality

When I run if-metadata-check -m manifest.yml with the following manifest:

name: sum
description: successful path
tags:
initialize:
  plugins:
    sum:
      method: Sum
      path: "builtin"
      config:
        input-parameters: ["cpu/energy", "network/energy"]
        output-parameter: "energy"
      parameter-metadata:
        inputs:
          cpu/energy:
            unit: kWh
            description: energy used by CPU
            aggregation-method:
              time: sum
              component: sum 
tree:
  children:
    child:
      pipeline:
        compute:
          - sum
      inputs:
        - timestamp: 2023-08-06T00:00
          duration: 3600
          cpu/energy: 0.001
          network/energy: 0.001

Then I receive the following result:

metadata coverage: 33%
parameters without metadata:
- network/energy
- energy

jmcook1186 avatar Feb 12 '25 10:02 jmcook1186

Hello @jmcook1186 , would be glad to take on this issue.

mouhamadalmounayar avatar May 05 '25 11:05 mouhamadalmounayar

@mouhamadalmounayar great - go for it!

jmcook1186 avatar May 06 '25 07:05 jmcook1186

nice one @mouhamadalmounayar - this will be a helpful feature!

jmcook1186 avatar Jun 23 '25 09:06 jmcook1186

@mouhamadalmounayar could you add some docs for this feature to https://github.com/Green-Software-Foundation/if-docs ?

jmcook1186 avatar Jun 23 '25 09:06 jmcook1186

@mouhamadalmounayar could you add some docs for this feature to https://github.com/Green-Software-Foundation/if-docs ?

Will do.

mouhamadalmounayar avatar Jun 23 '25 09:06 mouhamadalmounayar