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

   The second point of item 7 of 
[CAMEL-26930](https://issues.apache.org/jira/browse/CAMEL-26930).
   
   ## Problem
   
   A run of files without routes ends with exit 1, "No routes found in: ...". A 
run of a folder (`camel run .`, `--source-dir`) skipped that check, as files 
could be added to it later (CAMEL-25397), but that is only so in dev mode, 
which has its own skip. Without dev mode a folder without routes reported 
Running, did nothing until it was stopped, and exited with 0. A common reason 
is a `routes.yml`: the YAML DSL reads `.yaml` files only, and nothing said so.
   
   On the launcher, in a folder with only `routes.yml`:
   
   ```
   $ camel run . --max-seconds=5
   main:          (Camel starts with no routes)                                 
                                     exit 0
   this branch:   ERROR: No routes found in: . (a YAML DSL file ends with 
.yaml, such as routes.camel.yaml,
                  so these are not loaded: routes.yml)                          
                                     exit 1
   ```
   
   ## Change
   
   - `KameletMainIntegration.hasNoRoutes` checks a source directory too; 
`--empty`, dev mode and the runs for other commands are still skipped.
   - The message names the source directory, and the `.yml` files of the folder 
(up to 3 levels deep, not in hidden folders or `target`) or among the files 
given, leaving out `docker-compose.yml`, `compose.yml` and JKube files.
   
   Upgrade guide entry added, as a script that ran an empty folder gets 1 now.
   
   ## Tests
   
   - `JBangRunnerTest.aDirectoryWithoutRoutesEndsTheRun` (new): a folder with 
`routes.yml` and `docker-compose.yml` ends with 1 and names `routes.yml` only.
   - `JBangRunnerTest.routesAreExpectedUnlessFilesCanBeAddedOrNoneAreWanted` 
pinned that a source directory skips the check; it now expects the check 
without dev mode, and the skip with it.
   - camel-jbang-run: 320 pass. camel-jbang-core: 3069 + 264 pass 
(`DependencyUpdateTest` flaked once and passed on the rerun).
   
   _Claude Code on behalf of davsclaus_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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]

Reply via email to