Parameter metadata audit feature
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-checkto 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
Hello @jmcook1186 , would be glad to take on this issue.
@mouhamadalmounayar great - go for it!
nice one @mouhamadalmounayar - this will be a helpful feature!
@mouhamadalmounayar could you add some docs for this feature to https://github.com/Green-Software-Foundation/if-docs ?
@mouhamadalmounayar could you add some docs for this feature to https://github.com/Green-Software-Foundation/if-docs ?
Will do.