From 1c13cfbef6c7f3109d679cf273846aba798d2ed4 Mon Sep 17 00:00:00 2001 From: Tim Dudgeon Date: Thu, 13 Aug 2026 13:24:07 +0100 Subject: [PATCH] fix: move moldb-count-rows options under variables, and correct them The 'options:' block sat directly on the job rather than under 'variables:'. The schema's 'job' object does not set 'additionalProperties: false', so the stray key validated silently and the options were ignored - documented as hole 2 in docs/schema-coverage.md in the umbrella repository. Because nothing ever validated the block, it had drifted into a state that could not have worked: - 'required' listed all four of table, count, min_rows and max_rows, but the command guards the last three with '{% if ... is defined %}' and no caller supplies all four. The three tests supply table+count, table+count, and table+min_rows+max_rows respectively, so every one of them would have failed. - 'table' had no 'type', which 'job-option-property' requires. - 'min_rows' and 'max_rows' were declared required but never defined. So this is not a move. The block is relocated under 'variables' and corrected: only 'table' is required, 'table' gains 'type: string', and 'min_rows'/'max_rows' are properly declared. The Job could not previously be run from the Data Manager at all - with no options visible, there was no way to supply the table name its command needs. It has worked only under jote, which passes options directly. Making the options real is therefore a behaviour change, so the version is bumped 1.0.0 -> 1.0.1. Verified with jote 0.14.0 against decoder 2.7.0: all six manifests pass 'jote --dry-run', and each of the three tests' supplied options validates against the corrected schema. Co-Authored-By: Claude Opus 5 --- data-manager/moldb.yaml | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/data-manager/moldb.yaml b/data-manager/moldb.yaml index 254a648..5ad134e 100644 --- a/data-manager/moldb.yaml +++ b/data-manager/moldb.yaml @@ -73,7 +73,7 @@ jobs: name: MolDB count rows description: >- Verify there are the expected number of rows in a database table - version: '1.0.0' + version: '1.0.1' # no category as this is only used as part of testing keywords: - moldb @@ -110,20 +110,28 @@ jobs: {% if count is defined %}--expected-rows {{ count }}{% endif %} {% if min_rows is defined %}--min-rows {{ min_rows }}{% endif %} {% if max_rows is defined %}--max-rows {{ max_rows }}{% endif %} - options: - type: object - required: - - table - - count - - min_rows - - max_rows - properties: - table: - title: Table name - pattern: "^[A-Za-z0-9_\\.\\-]+$" - count: - title: Expected row count - type: integer + variables: + options: + type: object + # Only 'table' is always needed. The command guards the other three + # with '{% if ... is defined %}': a caller supplies either 'count' + # (exact) or 'min_rows'/'max_rows' (a range), not all of them. + required: + - table + properties: + table: + title: Table name + type: string + pattern: "^[A-Za-z0-9_\\.\\-]+$" + count: + title: Expected row count + type: integer + min_rows: + title: Minimum row count + type: integer + max_rows: + title: Maximum row count + type: integer tests: supply: run-groups: