chore: Update Citrus to 4.9.3#85
Conversation
- Since Citrus is not being used yet in Kaoto replace version instead of adding new versions
📝 WalkthroughWalkthroughCitrus catalog version bumped from 4.9.2 to 4.9.3 across version references and multiple JSON schema files. Schema constraints added via Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@catalog/citrus/4.9.3/citrus-catalog-aggregate-test-containers.json`:
- Line 34: The schema blocks that define action-holder objects currently declare
"type": "object" and "additionalProperties": false but declare no allowed
properties, which rejects valid nested action objects like {"send": ...},
{"receive": ...}, {"echo": ...}; locate each action-holder schema (the JSON
object nodes that have "type": "object" followed immediately by
"additionalProperties": false and no "properties" entry) and remove the
"additionalProperties": false entry (or change it to true) so nested action keys
are accepted; search for the repeated pattern occurrences in the file (the
blocks mentioned in the review) and apply the same change to each.
In `@catalog/citrus/4.9.3/citrus-testcase.json`:
- Around line 1007-1008: The schema node definitions.TestActionBuilder_Object_
incorrectly sets "additionalProperties": false without defining a "properties"
object, which makes only an empty object valid and rejects real action objects
(e.g., {"echo": {...}}); fix by updating the upstream schema source so
TestActionBuilder_Object_ either declares the allowed "properties" for nested
actions or allows arbitrary action keys (set additionalProperties: true)
depending on intended validation, then rebuild the generated catalog with yarn
build to regenerate catalog/citrus/4.9.3/citrus-testcase.json so the corrected
schema replaces the faulty definition.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (11)
catalog/citrus/4.9.3/citrus-agent-configuration.jsoncatalog/citrus/4.9.3/citrus-catalog-aggregate-endpoints.jsoncatalog/citrus/4.9.3/citrus-catalog-aggregate-functions.jsoncatalog/citrus/4.9.3/citrus-catalog-aggregate-test-actions.jsoncatalog/citrus/4.9.3/citrus-catalog-aggregate-test-containers.jsoncatalog/citrus/4.9.3/citrus-catalog-aggregate-validation-matcher.jsoncatalog/citrus/4.9.3/citrus-testcase.jsoncatalog/citrus/4.9.3/citrus-testcase.xsdcatalog/citrus/4.9.3/index.jsoncatalog/index.jsonindex.js
| "type": "array", | ||
| "items": { | ||
| "type": "object", | ||
| "additionalProperties": false, |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# First, check if the file exists and examine its basic structure
test -f "catalog/citrus/4.9.3/citrus-catalog-aggregate-test-containers.json" && echo "File exists" || echo "File not found"
# Count lines in file
wc -l "catalog/citrus/4.9.3/citrus-catalog-aggregate-test-containers.json"
# Check the specific line 34 mentioned in the review
sed -n '30,40p' "catalog/citrus/4.9.3/citrus-catalog-aggregate-test-containers.json"Repository: KaotoIO/camel-catalog
Length of output: 497
🏁 Script executed:
# Also check if yarn build is referenced in package.json or if catalog is generated
if [ -f "package.json" ]; then
echo "=== Checking build scripts ==="
jq '.scripts' package.json 2>/dev/null || grep -A 5 '"scripts"' package.json
fi
# Check if there's a build script or if catalog files are generated
ls -la catalog/ 2>/dev/null | head -20Repository: KaotoIO/camel-catalog
Length of output: 1108
🏁 Script executed:
# Now run the verification script provided in the review
python -m pip install --quiet jsonschema >/dev/null 2>&1
python - <<'PY'
import json
from pathlib import Path
from jsonschema import Draft7Validator
path = Path("catalog/citrus/4.9.3/citrus-catalog-aggregate-test-containers.json")
if not path.exists():
print(f"File not found: {path}")
else:
doc = json.loads(path.read_text())
samples = {
"assert": {"when": [{"send": {"endpoint": "e1"}}]},
"async": {"actions": [{"send": {"endpoint": "e1"}}]},
"catch": {"when": [{"receive": {"endpoint": "e1"}}]},
"conditional": {"actions": [{"echo": {"message": "ok"}}], "when": "true"},
"doFinally": {"actions": [{"echo": {"message": "done"}}]},
"iterate": {"actions": [{"echo": {"message": "i"}}], "condition": "i < 3"},
"parallel": {"actions": [{"echo": {"message": "p"}}]},
"repeat": {"actions": [{"echo": {"message": "r"}}]},
"repeatOnError": {"actions": [{"echo": {"message": "re"}}]},
"sequential": {"actions": [{"echo": {"message": "s"}}]},
"soap-assertFault": {"when": {"receive": {"endpoint": "soapClient"}}},
"timer": {"actions": [{"echo": {"message": "tick"}}]},
}
print("Testing schema validation:")
print("=" * 60)
for name, payload in samples.items():
if name not in doc:
print(f"{name}: SKIP (not in schema)")
continue
schema = doc[name].get("propertiesSchema")
if not schema:
print(f"{name}: SKIP (no propertiesSchema)")
continue
errors = list(Draft7Validator(schema).iter_errors(payload))
if errors:
print(f"{name}: INVALID -> {errors[0].message}")
else:
print(f"{name}: VALID")
PYRepository: KaotoIO/camel-catalog
Length of output: 1159
additionalProperties: false here breaks all nested actions—validation fails for any action object.
At line 34 (and identically at lines 61, 79, 92, 131, 158, 197, 230, 289, 322, 373, 429, 506, 532), the schema enforces type: object with additionalProperties: false but declares no allowed properties. This rejects every valid nested action: {"send": {...}}, {"receive": {...}}, {"echo": {...}}, etc. all fail with "Additional properties are not allowed."
Remove additionalProperties: false from all action-holder schemas (type:object with no declared properties).
Affected schemas (lines with same pattern)
34, 61, 79, 92, 131, 158, 197, 230, 289, 322, 373, 429, 506, 532
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@catalog/citrus/4.9.3/citrus-catalog-aggregate-test-containers.json` at line
34, The schema blocks that define action-holder objects currently declare
"type": "object" and "additionalProperties": false but declare no allowed
properties, which rejects valid nested action objects like {"send": ...},
{"receive": ...}, {"echo": ...}; locate each action-holder schema (the JSON
object nodes that have "type": "object" followed immediately by
"additionalProperties": false and no "properties" entry) and remove the
"additionalProperties": false entry (or change it to true) so nested action keys
are accepted; search for the repeated pattern occurrences in the file (the
blocks mentioned in the review) and apply the same change to each.
| "type" : "object", | ||
| "additionalProperties" : false |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# First, check the file structure and read lines around 1007-1008
wc -l catalog/citrus/4.9.3/citrus-testcase.jsonRepository: KaotoIO/camel-catalog
Length of output: 112
🏁 Script executed:
# Read the relevant section
sed -n '1000,1020p' catalog/citrus/4.9.3/citrus-testcase.jsonRepository: KaotoIO/camel-catalog
Length of output: 625
🏁 Script executed:
# Check the TestActionBuilder_Object_ definition more thoroughly
# Look for the full definition including properties
rg -A 20 '"TestActionBuilder_Object_"' catalog/citrus/4.9.3/citrus-testcase.json | head -40Repository: KaotoIO/camel-catalog
Length of output: 716
🏁 Script executed:
# Check if there's a properties key anywhere for this definition
rg -B 5 -A 15 '"TestActionBuilder_Object_"' catalog/citrus/4.9.3/citrus-testcase.jsonRepository: KaotoIO/camel-catalog
Length of output: 624
🏁 Script executed:
#!/bin/bash
set -euo pipefail
python3 -m pip install --quiet jsonschema
python3 - <<'PY'
import json
from jsonschema import Draft7Validator
schema_path = "catalog/citrus/4.9.3/citrus-testcase.json"
with open(schema_path) as f:
schema = json.load(f)
sample = {
"name": "demo",
"actions": [
{"async": {"actions": [{"echo": {"message": "hi"}}]}}
]
}
errors = list(Draft7Validator(schema).iter_errors(sample))
for err in errors[:10]:
print(f"path={list(err.path)} message={err.message}")
print(f"TOTAL_ERRORS={len(errors)}")
PYRepository: KaotoIO/camel-catalog
Length of output: 192
🏁 Script executed:
# Check if TestActionBuilder_Object_ is referenced in the schema
rg '"TestActionBuilder_Object_"' catalog/citrus/4.9.3/citrus-testcase.json | grep -v '^ *"TestActionBuilder_Object_" *:' | head -20Repository: KaotoIO/camel-catalog
Length of output: 47
🏁 Script executed:
# Check if the file has generation markers or comments
head -30 catalog/citrus/4.9.3/citrus-testcase.json
tail -30 catalog/citrus/4.9.3/citrus-testcase.jsonRepository: KaotoIO/camel-catalog
Length of output: 1862
🏁 Script executed:
# Check the build script and if this file is generated
if [ -f package.json ]; then
jq '.scripts | keys' package.json
fi
if [ -f yarn.lock ]; then
echo "yarn.lock exists - yarn is used"
fi
ls -la catalog/ | head -20Repository: KaotoIO/camel-catalog
Length of output: 680
🏁 Script executed:
# Search for $ref patterns pointing to TestActionBuilder_Object_
rg '\$ref.*TestActionBuilder_Object_' catalog/citrus/4.9.3/citrus-testcase.jsonRepository: KaotoIO/camel-catalog
Length of output: 1176
🏁 Script executed:
# Let's look at the TestActions definition and see how it relates
sed -n '1010,1050p' catalog/citrus/4.9.3/citrus-testcase.jsonRepository: KaotoIO/camel-catalog
Length of output: 1311
🏁 Script executed:
# Search for how "actions" arrays are defined - look for TestActionBuilder_Object_ pattern
rg -B 3 -A 3 'TestActionBuilder_Object_' catalog/citrus/4.9.3/citrus-testcase.json | head -50Repository: KaotoIO/camel-catalog
Length of output: 1821
🏁 Script executed:
# Check if there's a build process that generates this file
cat package.json | grep -A 10 '"build:catalog"'
if [ -f scripts/build.js ]; then echo "=== build.js ==="; head -50 scripts/build.js; fiRepository: KaotoIO/camel-catalog
Length of output: 535
Line 1008 blocks all nested actions due to missing properties schema
definitions.TestActionBuilder_Object_ defines an object type with "additionalProperties": false but no "properties" field, making only {} valid. This breaks all 16+ references in nested action arrays (async, iterate, doFinally, when blocks, etc.), rejecting valid actions like {"echo":{"message":"hi"}}.
The validation test confirms the exact failure:
path=['actions', 0, 'async', 'actions', 0]
message=Additional properties are not allowed ('echo' was unexpected)
Proposed fix
"TestActionBuilder_Object_" : {
"type" : "object",
- "additionalProperties" : false
},Since this file is generated by yarn build (per the coding guideline), regenerate the catalog after fixing the upstream schema source.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@catalog/citrus/4.9.3/citrus-testcase.json` around lines 1007 - 1008, The
schema node definitions.TestActionBuilder_Object_ incorrectly sets
"additionalProperties": false without defining a "properties" object, which
makes only an empty object valid and rejects real action objects (e.g., {"echo":
{...}}); fix by updating the upstream schema source so TestActionBuilder_Object_
either declares the allowed "properties" for nested actions or allows arbitrary
action keys (set additionalProperties: true) depending on intended validation,
then rebuild the generated catalog with yarn build to regenerate
catalog/citrus/4.9.3/citrus-testcase.json so the corrected schema replaces the
faulty definition.
lordrip
left a comment
There was a problem hiding this comment.
Hi @christophd, do you think it would be possible to use Tabs for the catalog JSON files? We switched from Spaces to Tabs in the Kaoto catalog and saved 40 MB 😬
|
Waiting for Citrus version 4.9.4 to fix some issues with the YAML DSL schema |
Summary by CodeRabbit