Repository navigation
CAMEL-26933: camel-jbang-plugin-validate - validate exits with 66 for a missing file or nothing to validate - #29926
Conversation
… a missing file or nothing to validate validate yaml of a missing file reported a validation error with exit 1, while validate source and validate properties exit 66; validate source said "Validation success (files:0)" and validate normalize exited 0 when no file could be handled. All three exit 66 now, with a message that says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
🔄 Backport BotThis bugfix targets
Add a Backport PRs will be created automatically on merge (once a port label is added). Comment ℹ️ If you push additional commits after |
gnodet-bot
left a comment
There was a problem hiding this comment.
LGTM. The fix correctly aligns all three validate subcommands with the existing EX_NOINPUT exit-code contract (66), the test covers all three scenarios, and the upgrade guide documents the breaking change.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 1 of 726 tested, 0 compile-only — current: 2 all testedMaveniverse Scalpel detected 1 affected modules (current approach: 2). Skip-tests mode would test 1 modules (3 direct + 0 downstream), skip tests for 0 (generated code, meta-modules) Modules only in current approach (1)
Modules Scalpel would test (1)
💡 Manual integration tests recommended:
All tested modules (4 modules, 48.2s total)Total reactor time: 48.2s
Top 20 slowest modules:
|
…validation error, not a missing file Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
Part of item 5 of CAMEL-26933: the exit codes of
camel validate.Problem
Agents run
camel validateafter every edit, so its exit codes need to say what happened. They disagreed:camel validate yaml nope.yamlreported a validation error with exit 1 (YamlValidateCommand), whilevalidate sourceandvalidate propertiesexit 66 (file not found) for a missing file.camel validate source notes.txtprinted "Validation success (files:0)" and exited 0 (SourceValidateCommand), although nothing was validated.camel validate normalize notes.txtexited 0 with no output.Change
validate yamlof a file that does not exist: exit 66, "File not found: ".validate sourcewith no file it can validate: exit 66, "No files to validate (YAML, XML, Java and properties files)", asvalidate yaml("No YAML files to validate") andvalidate propertiesalready do.validate normalizewith no YAML file: exit 66, "No YAML files to normalize".The rest of item 5 (
validate yaml --camel-version=9.9.9, the wording of the messages,validate normalizedropping comments,application.yaml,validate propertiesoptions) is not in this PR.Tests
ValidateJsonTest.theCommandsAgreeOnMissingFilesAndNothingToDo: the three cases.CamelLauncherTest.testLauncherValidatePluginvalidatedcheese.yaml, which does not exist, and took the exit 1 of that as the validation error it checks. It now validatesbad.yaml(an unknownsetCheesestep), which is a real validation error: exit 1, "Validation error detected (errors:1)".Claude Code on behalf of davsclaus
🤖 Generated with Claude Code