davsclaus opened a new pull request, #27932: URL: https://github.com/apache/camel/pull/27932
Step 11 of [CAMEL-25388](https://issues.apache.org/jira/browse/CAMEL-25388): the remaining commands with a wrong exit code, a silent fallback or a misleading error. ### Data and requests - `camel export --dir=./`, `--dir=$PWD` or `--dir=..` deleted the files of the project: only the text `.` was recognized as the current directory, and any other export directory is cleaned to avoid stale files. Now the current directory, and any directory that contains it, is only cleaned with `--clean-dir` (which asks first). - `camel harden --url` with an LLM that cannot be reached exits `1`, instead of sending the route to a local Ollama. ### Exit codes - `camel sbom` with an unknown `--sbom-format` or `--sbom-output-format` exits `2` before exporting (it exited `0` and did nothing; spdx with another output format passed `-DoutputFormat=null`), and exits `124` with a message when Maven does not finish in time. - `camel update run --upgradeTimeout` applies: the output was read to the end before the wait, so the timeout never triggered. It exits `124` when it is reached. - `camel version list` exits `1` when the versions cannot be downloaded (an empty list and `0`). - `camel validate yaml` and `camel validate properties` with no file to validate exit `3` (`Validation success (files:0)`). - `camel kubernetes logs` exits `3` when no pod with the label shows up, `1` when reading the log fails, and `2` for a bad `--label`. - `camel kubernetes run` exits `124` when the pod is not running after 10 minutes (an internal error before). - `camel debug` of a Spring Boot or Quarkus project does not run the jar of a build that failed. ### Behaviour - `camel doc <name>` looks in the catalog of Camel before it downloads the Kamelet catalog, so a component is documented also offline. `camel catalog kamelet` has `--repos` (and `--download`, `--fresh`), and uses the loader `camel doc` uses instead of its own copy. - `--sort=description` (and type, support level) of the catalog listings no longer fails on a row without the value. - `camel version get` shows a configuration with only the Kamelets version, and `camel version set --reset` removes it too. - `camel kubernetes run` prints the end of the Maven output when the build or deployment fails; without `--verbose` it was discarded. - `--jvm-args` keeps a quoted value with spaces as one argument (`CommandLineHelper.splitArguments`). Already done by earlier steps: `doctor` exit code (CAMEL-25392), `debug` exiting 255 on a normal end (CAMEL-25389), the exit codes of `generate`; the route-parser plugin is removed. ### Docs - 4.24 upgrade guide: "exit codes and errors of more commands". ### Tests - `CommandInputErrorsTest`: sbom with an unknown format (2), harden with an LLM that cannot be reached (1, no LLM configuration printed), the current directory and its parents are protected from the export cleanup. - `CommandLineArgumentsTest`: whitespace, double and single quotes, backslash. - `CatalogDocTest`: a component is documented with a Kamelet catalog that cannot be downloaded. - `CatalogKameletTest`: a Kamelet without a description sorts first. - `VersionGetTest`, `VersionSetTest`: only the Kamelets version, and reset removes it. - `ValidateJsonTest`: no file to validate (3). - `KubernetesPodLogsTest`: no pod is not found (3). - `mvn test` of camel-jbang-core, camel-jbang-plugin-validate and camel-jbang-plugin-kubernetes: all tests pass. _Claude Code on behalf of davsclaus_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01DDRLJAyf8cDXSg8iX785My -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
