gnodet-bot commented on code in PR #26634:
URL: https://github.com/apache/camel/pull/26634#discussion_r4057512324


##########
docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_23.adoc:
##########
@@ -796,6 +796,12 @@ The compact notation they used to be written in (`setBody: 
{simple: "..."}`, `lo
 rewrites a file in the canonical format. Existing files keep working; only the 
generated starting point
 changed. Scripts that post-process the generated YAML by matching the old text 
need to be updated.
 
+`camel run` now looks a `classpath:` or `file:` resource that is not found up 
in the directories of the route

Review Comment:
   💡 **Grammar nit** — "looks a … resource … up in" should be "looks up a … 
resource … in" (the preposition belongs next to the verb).
   
   ```suggestion
   `camel run` now looks up a `classpath:` or `file:` resource that is not 
found in the directories of the route
   ```



##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/EndpointChecks.java:
##########
@@ -337,6 +338,39 @@ static void checkRegexOptions(List<String> errors, String 
fullUri, int uriLineId
         }
     }
 
+    /**
+     * file:archived/${header.monthDir} on a to: fails at startup: the 
directory of a file endpoint cannot be dynamic
+     * (the runtime says "Dynamic expressions with ${ } placeholders is not 
allowed. Use the fileName option"). Says to
+     * keep the directory fixed and put the dynamic part in fileName, or to 
use toD: (which evaluates the uri first).
+     * toD, wireTap, enrich and pollEnrich evaluate the expression before the 
endpoint is created and are left alone.
+     */
+    static void checkDynamicDirectory(List<String> errors, String fullUri, int 
uriLineIdx, String eipName) {
+        int colon = fullUri.indexOf(':');
+        if (colon < 0 || !FILE_SCHEMES.contains(fullUri.substring(0, colon))) {
+            return;
+        }
+        if (eipName != null && !eipName.equals("to") && 
!eipName.equals("from")) {

Review Comment:
   💡 **Edge case: `null` eipName falls through** — when `eipName` is `null` 
(can happen if the YAML indent walk-back in the caller reaches the top without 
finding a parent EIP), the condition `eipName != null && …` evaluates to 
`false`, so the early-return is skipped and the dynamic-directory check fires 
for *any* file-scheme URI in that context, including ones under `toD:` or 
`wireTap:` if their parent wasn't resolved. The check should treat `null` the 
same way it treats any non-`to`/non-`from` EIP — skip it, since we cannot be 
sure the restriction applies.
   
   ```suggestion
           if (eipName == null || (!eipName.equals("to") && 
!eipName.equals("from"))) {
   ```



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