metomi / rose

:rose: Rose is a toolkit for writing, editing and running application configurations.
https://metomi.github.io/rose/
GNU General Public License v3.0
56 stars 53 forks source link

metadata fail-if not working as expected in rose edit #2775

Closed wxtim closed 6 months ago

wxtim commented 7 months ago

As described by @kaday (to whom many thanks for boiling it down to the toy example below):

The following rose config

#!/bin/bash

SRC=$(mktemp -d)

cat > "${SRC}/rose-suite.conf" <<__ICI__
[template variables]
DATE_END=20211203
DATE_START=20211202

__ICI__

mkdir "${SRC}/meta"

cat > "${SRC}/meta/rose-meta.conf" <<__ICI__
[template variables=DATE_END]
compulsory=false
description=Set end date of trial, YYYYMMDD format.
sort-key=a-03
type=integer
fail-if=this > 0 and this <= template variables=DATE_START;
ns=Control
help=This is the end date of the data you wish to plot

[template variables=DATE_START]
compulsory=true
description=Set start date of trial, YYYYMMDD format.
sort-key=a-02
type=integer
ns=Control
help=This is the start date of the data you wish to plot

__ICI__

tree "${SRC}"

rose metadata-check -C "${SRC}/meta"

Results in an unexpected failure:

[V] rose.metadata_check.MetadataChecker: issues: 1
    template variables=DATE_END=fail-if=this > 0 and this <= template variables=DATE_START;
        Not found: variables=DATE_START
oliver-sanders commented 7 months ago

Likely a duplicate of https://github.com/metomi/rose/issues/2737

oliver-sanders commented 6 months ago

Closing as a duplicate of #2737