You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "davsclaus (via GitHub)" <gi...@apache.org> on 2026/10/20 08:11:18 UTC

[PR] CAMEL-25832: camel-jbang - camel run on the quarkus, spring-boot and main runtimes keeps the log of the previous run [camel]

davsclaus opened a new pull request, #28171:
URL: https://github.com/apache/camel/pull/28171

   https://issues.apache.org/jira/browse/CAMEL-25832
   
   Follow-up of CAMEL-25784. Before this change, `camel run` kept the log of a run that ended only for the default runtime. The Maven runtimes deleted the log when the run ended, or when the next run started. So after an app failed to start, `camel log <name> --previous` and the AI tools had nothing to read.
   
   ## What changes
   
   - **The log is kept when the run ends.** This covers quarkus, spring-boot and main, and also `camel run pom.xml` of an existing project. The `stopOnExit` callback keeps `<name>.log` as the previous run (`PreviousRun.keep`), where it used to delete it. The callback runs after the app has stopped, so the kept log is complete.
     - When `camel run` started the app itself (`java -jar` for main, `mvn camel:run` where Camel runs in the Maven JVM), the previous run has the pid and exit code of the app.
     - With quarkus and spring-boot, Maven runs the app in a process of its own. So there is no pid and no exit code of the app. When Maven fails, the failure says `Maven ended with exit code N`.
     - Exit codes 130, 137 and 143 are reported as the signal (SIGINT, SIGKILL, SIGTERM).
   - **A log left behind is kept when the next run starts.** A run that was killed leaves its `<name>.log`. The next run of that name now keeps it as the previous run, instead of deleting it (main, existing projects) or appending to it (quarkus). How that run ended is not known, so the time is the last write of the log.
   - **Spring Boot logs to `<name>.log`,** as the other runtimes do, instead of `<pid>.log` (the pid of the Spring Boot JVM). The readers already look for `<name>.log` when there is no `<pid>.log`. An existing Spring Boot project now gets `-Dcamel.main.name`, so the app reports the name of its log file. Existing Quarkus and Camel Main projects already get it.
   - The docs section "The log of the previous run" now covers all runtimes.
   
   ## Tested end to end
   
   I used a launcher built from this branch and a route that fails at startup (`timer:tick?period=notanumber`):
   
   | Run | Exit | Previous run |
   |---|---|---|
   | `--runtime=main` | 1 | pid of the app, exit code 1 |
   | `--runtime=main --max-seconds=8` (ok route) | 0 | pid, exit code 0, both log lines |
   | `--runtime=main`, CLI stopped with SIGTERM | 143 | pid, exit code 143, SIGTERM |
   | `--runtime=spring-boot` | 1 | `Maven ended with exit code 1`; the log has the startup error |
   | `--runtime=quarkus` | 1 | `Maven ended with exit code 1`; the log has the startup error |
   | `camel run pom.xml --runtime=spring-boot` (exported project) | 0 | while it ran, `camel ps` showed the name and the app wrote `<name>.log`; kept at the end |
   
   `camel log prevlog-boom --previous` printed "The previous run of prevlog-boom (pid 16017) ended at ... with exit code 1", followed by the log.
   
   One finding for a follow-up, not changed here: with `--runtime=main`, Camel Main does not log a startup failure. The exception leaves `main()`, and only the JVM prints it, to stderr. So the kept log ends before the error. Spring Boot ("Application run failed") and Quarkus ("Failed to start application") log it, so their kept logs show it.
   
   ## Tests
   
   - New `RunMavenRuntimePreviousLogTest` (8): an app's pid and exit code, the Maven exit code as the failure, signals, no log or no name, a log left behind, and the Spring Boot logback file.
   - `RunExistingProjectTest` and `RunExportedProjectTest` are updated: the log left behind is kept, and Spring Boot gets `<name>.log` and `-Dcamel.main.name`. The tests of the default runtime (`RunPreviousLogTest`, `PreviousRunTest`) pass.
   - All tests of camel-jbang-core pass (2364 + 237, before the new test class got its own name; the five classes for the run logs pass after).
   
   _Claude Code on behalf of davsclaus_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_01STT6whBgK1AqsSsUKrnE8m


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25832: camel-jbang - camel run on the quarkus, spring-boot and main runtimes keeps the log of the previous run [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #28171:
URL: https://github.com/apache/camel/pull/28171#issuecomment-6290858718

   <!-- ci-tested-modules -->
   :test_tube: **CI tested the following changed modules:**
   
   - `docs`
   - `dsl/camel-jbang/camel-jbang-core`
   
   :repeat: **2 tests passed only after a retry on JDK 21** (2 retried attempts)
   
   <details><summary>Recovered flaky tests on JDK 21 (2)</summary>
   
   | Module | Test | Failed attempts | First failure |
   | --- | --- | --- | --- |
   | `dsl/camel-jbang/camel-jbang-plugin-tui` | `AiPanelAcpTest.unknownSlashCommandIsForwardedToTheAgentWithoutThePreamble` | 1 | Index 1 out of bounds for length 1 |
   | `dsl/camel-jbang/camel-jbang-plugin-tui` | `LaunchManagerOutcomeTest.startedWhenTheStatusFileSaysSo` | 1 | expected: null but was: LaunchOutcome[ok=false, log=null] |
   
   > :information_source: These tests did **not** fail the build. Surefire retried them and they passed.
   > Retries are enabled project-wide by `surefire.rerunFailingTestsCount` in `parent/pom.xml`.
   
   </details>
   
   ---
   
   <details><summary>:microscope: Scalpel shadow comparison — Scalpel: 5 of 707 tested, 8 compile-only — current: 5 all tested</summary>
   
   [Maveniverse Scalpel](https://github.com/maveniverse/scalpel) detected **5 affected modules** (current approach: 5).
   
   **Skip-tests mode would test 5 modules** (2 direct + 5 downstream), **skip tests for 8** (generated code, meta-modules)
   
   <details><summary>Modules Scalpel would test (5)</summary>
   
   - `camel-jbang-mcp` ← downstream of org.apache.camel:camel-jbang-core
   - `camel-jbang-plugin-mcp` ← downstream of org.apache.camel:camel-jbang-core
   - `camel-jbang-plugin-tui` ← downstream of org.apache.camel:camel-jbang-core
   - `camel-jbang-plugin-validate` ← downstream of org.apache.camel:camel-jbang-core
   - `camel-launcher-container` ← downstream of org.apache.camel:camel-launcher
   
   </details>
   
   <details><summary>Modules with tests skipped (8)</summary>
   
   - `camel-jbang-it`
   - `camel-jbang-main`
   - `camel-jbang-plugin-edit`
   - `camel-jbang-plugin-generate`
   - `camel-jbang-plugin-kubernetes`
   - `camel-jbang-plugin-test`
   - `camel-launcher`
   - `coverage`
   
   </details>
   
   > :information_source: Shadow mode — Scalpel observes but does not affect test execution. [Learn more](https://github.com/maveniverse/scalpel)
   
   </details>
   
   :warning: **Some tests are disabled on GitHub Actions** (`@DisabledIfSystemProperty(named = "ci.env.name")`) and require manual verification:
   
   - `dsl/camel-jbang/camel-jbang-core`: 2 test(s) disabled on GitHub Actions
   
   :bulb: **Manual integration tests recommended:**
   
   > You modified `dsl/camel-jbang/camel-jbang-core`. The related integration tests in `dsl/camel-jbang/camel-jbang-it` are excluded from CI. Consider running them manually:
   > ```
   > mvn verify -f dsl/camel-jbang/camel-jbang-it -Djbang-it-test
   > ```
   
   <details><summary>All tested modules (15 modules, 2m 17s total)</summary>
   
   **Total reactor time:** 2m 17s
   
   | Module | Duration | Status |
   | --- | --- | --- |
   | Camel :: Launcher | 34.9s | SUCCESS |
   | Camel :: JBang :: MCP | 30.7s | SUCCESS |
   | Camel :: JBang :: Plugin :: Validate | 26.4s | SUCCESS |
   | Camel :: Docs | 17.2s | SUCCESS |
   | Camel :: JBang :: Plugin :: Kubernetes | 10.7s | SUCCESS |
   | Camel :: JBang :: Plugin :: Testing | 9.4s | SUCCESS |
   | Camel :: JBang :: Plugin :: Edit | 1.4s | SUCCESS |
   | Camel :: Coverage | 1.3s | SUCCESS |
   | Camel :: JBang :: Plugin :: MCP | 1.3s | SUCCESS |
   | Camel :: JBang :: Integration tests | 1.2s | SUCCESS |
   | Camel :: JBang :: Plugin :: Generate | 1.1s | SUCCESS |
   | Camel :: JBang :: Main | 0.8s | SUCCESS |
   | Camel :: Launcher :: Container | 0.6s | SUCCESS |
   | Camel :: JBang :: Core | n/a |  |
   | Camel :: JBang :: Plugin :: TUI | n/a |  |
   
   **Top 20 slowest modules:**
   - `Camel :: Launcher` (34.9s)
   - `Camel :: JBang :: MCP` (30.7s)
   - `Camel :: JBang :: Plugin :: Validate` (26.4s)
   - `Camel :: Docs` (17.2s)
   - `Camel :: JBang :: Plugin :: Kubernetes` (10.7s)
   - `Camel :: JBang :: Plugin :: Testing` (9.4s)
   - `Camel :: JBang :: Plugin :: Edit` (1.4s)
   - `Camel :: Coverage` (1.3s)
   - `Camel :: JBang :: Plugin :: MCP` (1.3s)
   - `Camel :: JBang :: Integration tests` (1.2s)
   - `Camel :: JBang :: Plugin :: Generate` (1.1s)
   - `Camel :: JBang :: Main` (0.8s)
   - `Camel :: Launcher :: Container` (0.6s)
   
   </details>
   
   ---
   :gear: [View full build and test results](https://github.com/apache/camel/actions/runs/39400322282)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25832: camel-jbang - camel run on the quarkus, spring-boot and main runtimes keeps the log of the previous run [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #28171:
URL: https://github.com/apache/camel/pull/28171#issuecomment-6286668384

   :star2: Thank you for your contribution to the Apache Camel project! :star2:
     :robot: CI automation will test this PR automatically.
   
     :camel: Apache Camel Committers, please review the following items:
   
     * First-time contributors **require MANUAL approval** for the GitHub Actions to run
     * You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
     * You can label PRs using `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
     * Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
     
     :warning: Be careful when sharing logs. Review their contents before sharing them publicly.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25832: camel-jbang - camel run on the quarkus, spring-boot and main runtimes keeps the log of the previous run [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #28171:
URL: https://github.com/apache/camel/pull/28171


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org