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/09/12 08:06:47 UTC

[PR] CAMEL-24692: camel-jbang-plugin-tui - narrow the simple validation placeholder workaround [camel]

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

   Follow-up to #26349 — **stacked on top of it**, so this PR targets `fix/CAMEL-24692` and should be merged after it. Part of [CAMEL-24692](https://issues.apache.org/jira/browse/CAMEL-24692).
   
   ## Background
   
   The TUI save-time validation carried a workaround for the catalog bug fixed in #26349:
   
   ```java
   // Skip placeholder-only expressions
   if (simpleText.startsWith("{{") && simpleText.endsWith("}}")) {
       continue;
   }
   ```
   
   The obvious follow-up was to delete it. **That turns out not to be safe**, so this PR narrows it instead.
   
   ## Why it cannot just be removed
   
   A property placeholder can expand to an entire *predicate*, not just a value. The catalog substitutes a placeholder with a dummy value, which is what an operand of a binary operator needs, but a logical operator needs a predicate on either side. So these still fail validation, checked against the catalog built from #26349:
   
   ```
   {{a}} && {{b}}            -> Logical operator && does not support left hand side token '
   {{a}} and {{b}}           -> Unexpected token a
   ```
   
   Those are false positives: at runtime the placeholders resolve first, so `{{enabled}} && ${body} > 1` is a perfectly valid route. Deleting the guard would reintroduce exactly the class of false positive CAMEL-24692 is about.
   
   ## What this PR does
   
   Replaces the shape-based guard with a check for the one case the catalog genuinely cannot model — a placeholder used as an operand of a logical operator. The new guard is **narrower in one direction and wider in the other**:
   
   - Expressions that are merely placeholder-valued are now validated instead of skipped, so real errors in them get caught. `{{a}} =!= {{b}}` was silently ignored before.
   - It also covers a case the old guard missed. `${body} > 1 && {{flag}}` does not start with `{{`, so it was never skipped and was already reported as a false error, independently of CAMEL-24692.
   
   | expression | before | after |
   |---|---|---|
   | `{{hot.threshold}}` | skipped | validated (passes) |
   | `${body} >= {{hot.threshold}}` | validated (false error) | validated (passes) |
   | `{{a}} =!= {{b}}` | skipped (real error hidden) | validated (error reported) |
   | `{{a}} && {{b}}` | skipped | skipped |
   | `${body} > 1 && {{flag}}` | validated (false error) | skipped |
   
   The operand split ignores quoted literals, so a `&&` inside a string is not treated as an operator.
   
   ## Testing
   
   Three new tests in `SourceEditAssistValidateTest`: one pinning what must now be validated, one pinning what must still be skipped (including the quoted-literal case), and an end-to-end one running `validateSource` over a YAML route that uses both placeholder shapes under `choice`/`when`. 7/7 pass in that class.
   
   ---
   _Claude Code on behalf of davsclaus_
   


-- 
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-24692: camel-jbang-plugin-tui - narrow the simple validation placeholder workaround [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #26350:
URL: https://github.com/apache/camel/pull/26350#issuecomment-5653594666

   not needed being superseded


-- 
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-24692: camel-jbang-plugin-tui - narrow the simple validation placeholder workaround [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus closed pull request #26350: CAMEL-24692: camel-jbang-plugin-tui - narrow the simple validation placeholder workaround
URL: https://github.com/apache/camel/pull/26350


-- 
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-24692: camel-jbang-plugin-tui - narrow the simple validation placeholder workaround [camel]

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

   :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