You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "Croway (via GitHub)" <gi...@apache.org> on 2023/05/03 12:04:08 UTC

[GitHub] [camel] Croway opened a new pull request, #9987: CAMEL-19313: resolve option placeholder

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

   # Description
   
   <!--
   - Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   -->
   
   # Target
   
   - [ ] I checked that the commit is targeting the correct branch (note that Camel 3 uses `camel-3.x`, whereas Camel 4 uses the `main` branch)
   
   # Tracking
   - [ ] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it).
   
   <!--
   # *Note*: trivial changes like, typos, minor documentation fixes and other small items do not require a JIRA issue. In this case your pull request should address just this issue, without pulling in other changes.
   -->
   
   # Apache Camel coding standards and style
   
   - [ ] I checked that each commit in the pull request has a meaningful subject line and body.
   
   <!--  
   If you're unsure, you can format the pull request title like `[CAMEL-XXX] Fixes bug in camel-file component`, where you replace `CAMEL-XXX` with the appropriate JIRA issue.
   -->
   
   - [ ] I formatted the code using `mvn -Pformat,fastinstall install && mvn -Psourcecheck`
   
   <!-- 
   You can run the aforementioned command in your module so that the build auto-formats your code and the source check verifies that is complies with our coding style. This will also be verified as part of the checks and your PR may be rejected if the checkstyle does not pass.
   
   You can learn more about the contribution guidelines at https://github.com/apache/camel/blob/main/CONTRIBUTING.md
   -->
   
   


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


[GitHub] [camel] Croway merged pull request #9987: CAMEL-19313: resolve option placeholder

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


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


[GitHub] [camel] github-actions[bot] commented on pull request #9987: CAMEL-19313: resolve option placeholder

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

   :no_entry_sign: There are (likely) no components to be tested in this PR


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


[GitHub] [camel] davsclaus commented on pull request #9987: CAMEL-19313: resolve option placeholder

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

   Can you maybe also add a little part in the camel-jbang doc about this


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


[GitHub] [camel] Croway commented on a diff in pull request #9987: CAMEL-19313: resolve option placeholder

Posted by "Croway (via GitHub)" <gi...@apache.org>.
Croway commented on code in PR #9987:
URL: https://github.com/apache/camel/pull/9987#discussion_r1188661363


##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/CamelCommand.java:
##########
@@ -67,9 +68,28 @@ public Integer call() throws Exception {
             configureLoggingOff();
         }
 
+        replacePlaceholders();
+
         return doCall();
     }
 
+    private void replacePlaceholders() throws Exception {
+        for (CommandLine.Model.ArgSpec argSpec : spec.args()) {
+            String defaultValue = spec.defaultValueProvider().defaultValue(argSpec);

Review Comment:
   exactly, the `defaultValueProvider()` loads the value from the properties file (updated via `camel config set`)



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


[GitHub] [camel] davsclaus commented on pull request #9987: CAMEL-19313: resolve option placeholder

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

   This is a draft PR is it ready to be merged or do you need more work?


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


[GitHub] [camel] Croway commented on pull request #9987: CAMEL-19313: resolve option placeholder

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

   Thanks @apupier for checking it, I have added some doc too.


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


[GitHub] [camel] apupier commented on a diff in pull request #9987: CAMEL-19313: resolve option placeholder

Posted by "apupier (via GitHub)" <gi...@apache.org>.
apupier commented on code in PR #9987:
URL: https://github.com/apache/camel/pull/9987#discussion_r1188617909


##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/CamelCommand.java:
##########
@@ -67,9 +68,28 @@ public Integer call() throws Exception {
             configureLoggingOff();
         }
 
+        replacePlaceholders();
+
         return doCall();
     }
 
+    private void replacePlaceholders() throws Exception {
+        for (CommandLine.Model.ArgSpec argSpec : spec.args()) {
+            String defaultValue = spec.defaultValueProvider().defaultValue(argSpec);

Review Comment:
   the default values are the values set in configuration? (like when set with `jbang camel@apache/camel config set repos=https://maven.repository.redhat.com/ga`)



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


[GitHub] [camel] github-actions[bot] commented on pull request #9987: CAMEL-19313: resolve option placeholder

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

   :no_entry_sign: There are (likely) no components to be tested in this PR


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