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


##########
components/camel-salesforce/camel-salesforce-component/pom.xml:
##########
@@ -401,12 +401,12 @@ 
${salesforce.component.root}/it/resources/salesforce-source]]></message>
                                         
<argument>setup-salesforce.sh</argument>
                                     </arguments>
                                     <environmentVariables>
-                                        
<SALESFORCE_USERNAME>${env.SALESFORCE_USERNAME}</SALESFORCE_USERNAME>
-                                        
<SALESFORCE_PASSWORD>${env.SALESFORCE_PASSWORD}</SALESFORCE_PASSWORD>
-                                        
<SALESFORCE_LOGIN_URL>${env.SALESFORCE_LOGIN_URL}</SALESFORCE_LOGIN_URL>
                                         
<SALESFORCE_DEV_HUB>${env.SALESFORCE_DEV_HUB}</SALESFORCE_DEV_HUB>
                                         
<SALESFORCE_DEPLOY_SOURCE>${env.SALESFORCE_DEPLOY_SOURCE}</SALESFORCE_DEPLOY_SOURCE>
                                         
<SALESFORCE_SCRATCH_ORG_DURATION>${env.SALESFORCE_SCRATCH_ORG_DURATION}</SALESFORCE_SCRATCH_ORG_DURATION>
+                                        <!-- -D options reach the tests as 
system properties, the script checks them -->
+                                        
<MAVEN_SALESFORCE_PASSWORD>${salesforce.password}</MAVEN_SALESFORCE_PASSWORD>
+                                        
<MAVEN_SALESFORCE_AUTH_TYPE>${salesforce.auth.type}</MAVEN_SALESFORCE_AUTH_TYPE>

Review Comment:
   **Bug — `${salesforce.password}` resolves to a literal string**
   
   `${salesforce.password}` and `${salesforce.auth.type}` are not declared with 
defaults in `<properties>`. When the user does **not** pass 
`-Dsalesforce.password=…`, Maven leaves the expression unresolved and the env 
var receives the **literal string** `${salesforce.password}`. 
`has_login_setting` checks `[ -n "$maven_value" ]` — that literal is non-empty 
— so `HAS_PASSWORD=true` fires unconditionally from Maven, and 
`fail_on_password_with_refresh_token` aborts every scratch org run.
   
   Fix: use `${env.MAVEN_SALESFORCE_PASSWORD}`, which resolves to empty when 
the env var is unset:
   ```suggestion
                                           
<MAVEN_SALESFORCE_PASSWORD>${env.MAVEN_SALESFORCE_PASSWORD}</MAVEN_SALESFORCE_PASSWORD>
                                           
<MAVEN_SALESFORCE_AUTH_TYPE>${env.MAVEN_SALESFORCE_AUTH_TYPE}</MAVEN_SALESFORCE_AUTH_TYPE>
   ```
   Alternatively, declare empty defaults in the `integration` profile 
`<properties>` block:
   ```xml
   <salesforce.password></salesforce.password>
   <salesforce.auth.type></salesforce.auth.type>
   ```



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