davsclaus opened a new pull request, #28109: URL: https://github.com/apache/camel/pull/28109
[CAMEL-25817](https://issues.apache.org/jira/browse/CAMEL-25817): `camel dirty` counted as dirty every file in `~/.camel` whose name does not start with the pid of a live process, and `camel dirty --clean` deleted them. So it also deleted files that belong to no process: - the log of a Spring Boot or Quarkus app that `camel run` runs (`<name>.log`), also while the app runs; - the console output that the `camel_run` and `camel_control restart` tools keep, also of a server that still runs; - files the CLI keeps there on purpose, such as the history of the AI prompt. It also counted directories, which it cannot delete when they are not empty, so "Cleaned 4 orphan files" was printed after 3 were deleted. ## What - **Only the files of a process that is gone count**: a file named after its pid, as `pidOf` already reads it (`<pid>`, `<pid>-status.json`, `<pid>.log`, `infra-<service>-<pid>.json`), when that pid no longer runs. Every other file is left alone. - **Directories are left alone.** - **`--clean` counts only the files it removed**, and names the ones it could not remove in a `WARN:` line. - The special case for `camel-export.log` goes, as that file is named after no pid. What `camel dirty` no longer removes: - The console output of a camel-jbang-mcp server that was killed. CAMEL-25818 is about that output: the server can remove it itself, or name it after a pid. - The `<name>.log` of a Spring Boot or Quarkus app whose `camel run` was killed. The next run of that name replaces it. #28107 (CAMEL-25784) also changes `Dirty.java`, in the lines next to these, and adds a note at the end of the 4.24 upgrade guide, as this PR does. Whichever of the two is merged second needs a small rebase. ## Tests - `DirtyTest` (2 more): - Files that belong to no process (`<name>.log`, `camel-launch-*.log`, a history file, `camel-export.log`) and directories (also one whose name starts with a pid) are not dirty, and `--clean` leaves them. - `--clean` counts only the files it removed (a directory that cannot be written, not on Windows). - Without the fix, both tests fail. - All tests of camel-jbang-core pass (2307, 2 skipped, and 237). 🤖 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
