Green-Software-Foundation / Green-Software-Foundation/if
Parameter metadata audit feature
- Dominant language
- TypeScript
- Stars
- 183
- Forks
- 51
- PR merge metrics
- No merged PRs in 30d
Description
**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
```
The output could look as follows:
```sh
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:
```yaml
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:
```sh
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:
```yaml
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:
```sh
metadata coverage: 33%
parameters without metadata:
- network/energy
- energy
```
Contributor guide
Assessment
This issue has not been assessed yet.