Skip to content

Parameter metadata audit feature #1121

@jmcook1186

Description

@jmcook1186

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

Metadata

Metadata

Labels

good-first-issueThis issue is a good one for someone looking to get involved with this project/initiative.help-wantedGood issues for community contributors

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions