# \[rose\]: metadata for optional configs

**URL:** <https://cylc.discourse.group/t/rose-metadata-for-optional-configs/309>\
**Category:** Rose Support\
**Created:** [February 19, 2021, 12:03pm UTC](https://cylc.discourse.group/t/rose-metadata-for-optional-configs/309 "2021-02-19T12:03:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![edmundh](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/edmundh/32/70_2.png) [@edmundh](https://cylc.discourse.group/u/edmundh)\
**Post date:** [February 19, 2021, 12:03pm UTC](https://cylc.discourse.group/t/rose-metadata-for-optional-configs/309/1 "2021-02-19T12:03:43Z")

</div>

Some more metadata questions!

Is there a sensible way to record metadata for an optional config?

I’m wanting to create an app, and have an optional configurations which implement test modes.  
In test mode, the optional configuration may specify arguments not present in the default configuration.  
Or the argument values may be something I want to explain - e.g. in default config `ARG1=normal_value`, while in an optional config `ARG1=crazy_value`, and I want to give a reason for why `crazy_value` - ideally in a help metadata entry.  
Note am testing at this rose/cylc level (rather than within the app itself) as in some cases the test mode may specify a value intended to test app integration/suite handling for edge-cases.

I guess I could try workarounds like:

1. don’t try to use metadata to record why an optional config has given values, instead keep this information in relevant commit messages (and hope later reader thinks to use blame & friends)
2. ensure the standard `app/meta/rose-meta.conf` documents all args (ie. across all configs, default and optional)
3. for a given arg present in multiple configs, use comments in the optional config to explain the variant used there, and rely on the [app comments](https://cylc.discourse.group/t/rose-cylc-advice-on-best-way-to-record-purpose-of-a-rose-app/304) behaviour
4. for a given arg present in multiple configs, have the [help] text exhaustively documents all reasoning, e.g.

```ini
[env=ARG1]
title=arg1 file
description=The input file to use for arg1
help=Files used depend on the the configuration:
      = Default: provided by suite
      =opt-config-1: test the app handles small values
      =opt-config-2: test the app can handle datagaps
...
      =opt-config-N: test the app restarts if encounters NaNs

```

I’m currently leaning towards 2. and 3. However, I’m just wanting to check that there isn’t a rose-meta.conf-per-optional-config option I’m missing, which might let me avoid the above workarounds!

Apologies if this is covered somewhere - I can’t see it (or have missed it!) in the places I’ve looked:

- [metadata docs](http://metomi.github.io/rose/doc/html/api/configuration/metadata.html) or [tutorial](http://metomi.github.io/rose/doc/html/tutorial/rose/metadata.html)
- [optional config docs](https://metomi.github.io/rose/2019.01.2/html/tutorial/rose/furthertopics/optional-configurations.html)
  - I might not be understanding [the final bullet re metadata configurations](https://metomi.github.io/rose/2019.01.2/html/tutorial/rose/furthertopics/optional-configurations.html#other-optional-configurations) - is there an example of this being used somewhere?

- fully-fledged tutorial suites which implement both optional configs and metadata [e.g. the weather one](http://metomi.github.io/rose/doc/html/tutorial/cylc/scheduling/datetime-cycling.html#tutorial-datetime-cycling-practical)
- my goto suites for cribbing (GloSea, UM - neither always ideal for a given nooby question - are there better ones for this?)

---

<div class="post-metadata">

**Author:** ![dpmatthews](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/dpmatthews/32/26_2.png) [@dpmatthews](https://cylc.discourse.group/u/dpmatthews)\
**Post date:** [February 24, 2021, 8:28am UTC](https://cylc.discourse.group/t/rose-metadata-for-optional-configs/309/2 "2021-02-24T08:28:37Z")

</div>

The metadata applies to the entire configuration - there isn’t any optional config specific metadata. I agree that your options 2 & 3 make sense.

All Rose configs can have optional configs so that includes metadata configs. However, I’m not really sure why the optional config documentation specifically mentions this since I can’t think of a good use case.

---

<div class="post-metadata">

**Author:** ![edmundh](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/edmundh/32/70_2.png) [@edmundh](https://cylc.discourse.group/u/edmundh)\
**Post date:** [February 24, 2021, 9:00am UTC](https://cylc.discourse.group/t/rose-metadata-for-optional-configs/309/3 "2021-02-24T09:00:29Z")

</div>

Very helpful, thanks Dave!
