You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/04/12 17:23:30 UTC

[GitHub] [beam] tweise opened a new pull request #11399: Interpolate publish credentials as expected for Maven settings.xml

tweise opened a new pull request #11399: Interpolate publish credentials as expected for Maven settings.xml
URL: https://github.com/apache/beam/pull/11399
 
 
   Allow for expansion of environment variables as supported by Maven. Example:
   ```
   <server>
      <username>${env.CREDENTIALS_MAVEN_USERNAME}</username>
      <password>${env.CREDENTIALS_MAVEN_PASSWORD}</password>
      <id>private-repository</id>
   </server>
   ```
   Post-Commit Tests Status (on master branch)
   ------------------------------------------------------------------------------------------------
   
   Lang | SDK | Apex | Dataflow | Flink | Gearpump | Samza | Spark
   --- | --- | --- | --- | --- | --- | --- | ---
   Go | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Go/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Go/lastCompletedBuild/) | --- | --- | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Go_VR_Flink/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Go_VR_Flink/lastCompletedBuild/) | --- | --- | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Go_VR_Spark/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Go_VR_Spark/lastCompletedBuild/)
   Java | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Apex/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Apex/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow/lastCompletedBuild/)<br>[![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow_Java11/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow_Java11/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink/lastCompletedBuild/)<br>[![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Flink_Batch/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Flink_Batch/lastCompletedBuild/)<br>[![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Flink_Streaming/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Flink_Streaming/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Gearpump/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Gearpump/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Samza/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Samza/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Spark/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Spark/lastCompletedBuild/)<br>[![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Spark_Batch/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Spark_Batch/lastCompletedBuild/)<br>[![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_SparkStructuredStreaming/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_SparkStructuredStreaming/lastCompletedBuild/)
   Python | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Python2/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Python2/lastCompletedBuild/)<br>[![Build Status](https://builds.apache.org/job/beam_PostCommit_Python35/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Python35/lastCompletedBuild/)<br>[![Build Status](https://builds.apache.org/job/beam_PostCommit_Python36/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Python36/lastCompletedBuild/)<br>[![Build Status](https://builds.apache.org/job/beam_PostCommit_Python37/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Python37/lastCompletedBuild/) | --- | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Py_VR_Dataflow/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Py_VR_Dataflow/lastCompletedBuild/)<br>[![Build Status](https://builds.apache.org/job/beam_PostCommit_Py_VR_Dataflow_V2/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Py_VR_Dataflow_V2/lastCompletedBuild/)<br>[![Build Status](https://builds.apache.org/job/beam_PostCommit_Py_ValCont/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Py_ValCont/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PreCommit_Python2_PVR_Flink_Cron/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PreCommit_Python2_PVR_Flink_Cron/lastCompletedBuild/)<br>[![Build Status](https://builds.apache.org/job/beam_PostCommit_Python35_VR_Flink/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Python35_VR_Flink/lastCompletedBuild/) | --- | --- | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Python_VR_Spark/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Python_VR_Spark/lastCompletedBuild/)
   XLang | --- | --- | --- | [![Build Status](https://builds.apache.org/job/beam_PostCommit_XVR_Flink/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_XVR_Flink/lastCompletedBuild/) | --- | --- | [![Build Status](https://builds.apache.org/job/beam_PostCommit_XVR_Spark/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_XVR_Spark/lastCompletedBuild/)
   
   Pre-Commit Tests Status (on master branch)
   ------------------------------------------------------------------------------------------------
   
   --- |Java | Python | Go | Website
   --- | --- | --- | --- | ---
   Non-portable | [![Build Status](https://builds.apache.org/job/beam_PreCommit_Java_Cron/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PreCommit_Java_Cron/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PreCommit_Python_Cron/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PreCommit_Python_Cron/lastCompletedBuild/)<br>[![Build Status](https://builds.apache.org/job/beam_PreCommit_PythonLint_Cron/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PreCommit_PythonLint_Cron/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PreCommit_Go_Cron/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PreCommit_Go_Cron/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PreCommit_Website_Cron/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PreCommit_Website_Cron/lastCompletedBuild/) 
   Portable | --- | [![Build Status](https://builds.apache.org/job/beam_PreCommit_Portable_Python_Cron/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PreCommit_Portable_Python_Cron/lastCompletedBuild/) | --- | ---
   
   See [.test-infra/jenkins/README](https://github.com/apache/beam/blob/master/.test-infra/jenkins/README.md) for trigger phrase, status and link of all Jenkins jobs.
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [beam] tweise commented on a change in pull request #11399: Interpolate publish credentials as expected for Maven settings.xml

Posted by GitBox <gi...@apache.org>.
tweise commented on a change in pull request #11399: Interpolate publish credentials as expected for Maven settings.xml
URL: https://github.com/apache/beam/pull/11399#discussion_r407605687
 
 

 ##########
 File path: buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
 ##########
 @@ -600,9 +600,10 @@ class BeamModulePlugin implements Plugin<Project> {
                   ? 'apache.releases.https' : 'apache.snapshots.https')
           def m2SettingCreds = new XmlSlurper().parse(settingsXml).servers.server.find { server -> serverId.equals(server.id.text()) }
           if (m2SettingCreds) {
+            def GroovyShell shell = new GroovyShell(new Binding([env:System.getenv()]))
             credentials {
-              username m2SettingCreds.username.text()
-              password m2SettingCreds.password.text()
+              username shell.evaluate('"' + m2SettingCreds.username.text() +'"')
+              password shell.evaluate('"' + m2SettingCreds.password.text() +'"')
 
 Review comment:
   @lukecwik the gradle-maven-publish-auth plugin looks like a good fit, but AFAIK the LGPL license would be in the way of using it (hard dependency in our build system).

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [beam] lukecwik commented on issue #11399: Interpolate publish credentials as expected for Maven settings.xml

Posted by GitBox <gi...@apache.org>.
lukecwik commented on issue #11399: Interpolate publish credentials as expected for Maven settings.xml
URL: https://github.com/apache/beam/pull/11399#issuecomment-614103040
 
 
   Run Python2_PVR_Flink PreCommit

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [beam] tweise commented on issue #11399: Interpolate publish credentials as expected for Maven settings.xml

Posted by GitBox <gi...@apache.org>.
tweise commented on issue #11399: Interpolate publish credentials as expected for Maven settings.xml
URL: https://github.com/apache/beam/pull/11399#issuecomment-612925443
 
 
   Unrelated test failure:
   ```
   10:26:09 /home/jenkins/jenkins-slave/workspace/beam_PreCommit_SQL_Commit/src/sdks/java/core/src/test/java/org/apache/beam/sdk/options/PipelineOptionsReflectorTest.java:97: error: no suitable method found for assertThat(Set<PipelineOptionSpec>,Matcher<Iterable<? super PipelineOptionSpec>>)
   10:26:09     assertThat(props, hasItem(allOf(hasName("foo"), hasClass(ExtendsSimpleOptions.class))));
   10:26:09     ^
   10:26:09     method MatcherAssert.assertThat(String,boolean) is not applicable
   10:26:09       (argument mismatch; Set<PipelineOptionSpec> cannot be converted to String)
   10:26:09     method MatcherAssert.<T#1>assertThat(String,T#1,Matcher<? super T#1>) is not applicable
   10:26:09       (cannot infer type-variable(s) T#1
   10:26:09         (actual and formal argument lists differ in length))
   10:26:09     method MatcherAssert.<T#2>assertThat(T#2,Matcher<? super T#2>) is not applicable
   10:26:09       (inference variable T#3 has incompatible bounds
   10:26:09         upper bounds: PipelineOptionSpec,Object
   10:26:09         lower bounds: Matcher<T#4>)
   10:26:09   where T#1,T#2,T#3,T#4 are type-variables:
   10:26:09     T#1 extends Object declared in method <T#1>assertThat(String,T#1,Matcher<? super T#1>)
   10:26:09     T#2 extends Object declared in method <T#2>assertThat(T#2,Matcher<? super T#2>)
   10:26:09     T#3 extends Object declared in method <T#3>hasItem(T#3)
   10:26:09     T#4 extends Object declared in method <T#4>allOf(Matcher<? super T#4>,Matcher<? super T#4>)
   10:26:09 Note: Some input files use or override a deprecated API.
   10:26:09 Note: Recompile with -Xlint:deprecation for details.
   10:26:09 Note: Some input files use unchecked or unsafe operations.
   10:26:09 Note: Recompile with -Xlint:unchecked for details.
   10:26:09 1 error
   10:26:09 
   10:26:09 > Task :sdks:java:core:compileTestJava FAILED
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [beam] tweise commented on a change in pull request #11399: Interpolate publish credentials as expected for Maven settings.xml

Posted by GitBox <gi...@apache.org>.
tweise commented on a change in pull request #11399: Interpolate publish credentials as expected for Maven settings.xml
URL: https://github.com/apache/beam/pull/11399#discussion_r407857668
 
 

 ##########
 File path: buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
 ##########
 @@ -600,9 +600,10 @@ class BeamModulePlugin implements Plugin<Project> {
                   ? 'apache.releases.https' : 'apache.snapshots.https')
           def m2SettingCreds = new XmlSlurper().parse(settingsXml).servers.server.find { server -> serverId.equals(server.id.text()) }
           if (m2SettingCreds) {
+            def GroovyShell shell = new GroovyShell(new Binding([env:System.getenv()]))
             credentials {
-              username m2SettingCreds.username.text()
-              password m2SettingCreds.password.text()
+              username shell.evaluate('"' + m2SettingCreds.username.text() +'"')
+              password shell.evaluate('"' + m2SettingCreds.password.text() +'"')
 
 Review comment:
   @lukecwik I found a plugin with Apache license that achieves what is required. PTAL.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [beam] tweise commented on issue #11399: Interpolate publish credentials as expected for Maven settings.xml

Posted by GitBox <gi...@apache.org>.
tweise commented on issue #11399: Interpolate publish credentials as expected for Maven settings.xml
URL: https://github.com/apache/beam/pull/11399#issuecomment-612927435
 
 
   Unrelated test failure:
   ```
   10:31:20 ERROR: /home/jenkins/jenkins-slave/workspace/beam_PreCommit_PythonLint_Commit/src/sdks/python/test-suites/tox/py37/build/srcs/sdks/python/apache_beam/runners/portability/fn_api_runner/fn_runner.py Imports are incorrectly sorted.
   10:31:20 --- /home/jenkins/jenkins-slave/workspace/beam_PreCommit_PythonLint_Commit/src/sdks/python/test-suites/tox/py37/build/srcs/sdks/python/apache_beam/runners/portability/fn_api_runner/fn_runner.py:before	2020-04-12 17:25:57.123880
   10:31:20 +++ /home/jenkins/jenkins-slave/workspace/beam_PreCommit_PythonLint_Commit/src/sdks/python/test-suites/tox/py37/build/srcs/sdks/python/apache_beam/runners/portability/fn_api_runner/fn_runner.py:after	2020-04-12 17:31:13.728203
   10:31:20 @@ -25,8 +25,8 @@
   10:31:20  import contextlib
   10:31:20  import copy
   10:31:20  import itertools
   10:31:20 +import logging
   10:31:20  import multiprocessing
   10:31:20 -import logging
   10:31:20  import os
   10:31:20  import subprocess
   10:31:20  import sys
   10:31:20 Command exited with non-zero status 1
   10:31:20 887.19user 27.98system 4:03.75elapsed 375%CPU (0avgtext+0avgdata 522104maxresident)k
   10:31:20 5120inputs+304outputs (1major+1439421minor)pagefaults 0swaps
   10:31:20 ERROR: InvocationError for command /usr/bin/time scripts/run_pylint.sh (exited with code 1)
   10:31:20 py37-lint run-test-post: commands[0] | /home/jenkins/jenkins-slave/workspace/beam_PreCommit_PythonLint_Commit/src/sdks/python/test-suites/tox/py37/build/srcs/sdks/python/scripts/run_tox_cleanup.sh
   10:31:20 ___________________________________ summary ____________________________________
   10:31:20 ERROR:   py37-lint: commands failed
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [beam] tweise commented on a change in pull request #11399: Interpolate publish credentials as expected for Maven settings.xml

Posted by GitBox <gi...@apache.org>.
tweise commented on a change in pull request #11399: Interpolate publish credentials as expected for Maven settings.xml
URL: https://github.com/apache/beam/pull/11399#discussion_r407529366
 
 

 ##########
 File path: buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
 ##########
 @@ -600,9 +600,10 @@ class BeamModulePlugin implements Plugin<Project> {
                   ? 'apache.releases.https' : 'apache.snapshots.https')
           def m2SettingCreds = new XmlSlurper().parse(settingsXml).servers.server.find { server -> serverId.equals(server.id.text()) }
           if (m2SettingCreds) {
+            def GroovyShell shell = new GroovyShell(new Binding([env:System.getenv()]))
             credentials {
-              username m2SettingCreds.username.text()
-              password m2SettingCreds.password.text()
+              username shell.evaluate('"' + m2SettingCreds.username.text() +'"')
+              password shell.evaluate('"' + m2SettingCreds.password.text() +'"')
 
 Review comment:
   It doesn't change semantics but expands environment variables, when present.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [beam] tweise merged pull request #11399: Interpolate publish credentials as expected for Maven settings.xml

Posted by GitBox <gi...@apache.org>.
tweise merged pull request #11399: Interpolate publish credentials as expected for Maven settings.xml
URL: https://github.com/apache/beam/pull/11399
 
 
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [beam] tweise commented on issue #11399: Interpolate publish credentials as expected for Maven settings.xml

Posted by GitBox <gi...@apache.org>.
tweise commented on issue #11399: Interpolate publish credentials as expected for Maven settings.xml
URL: https://github.com/apache/beam/pull/11399#issuecomment-613725645
 
 
   > Please apply your change to
   > 
   > https://github.com/apache/beam/blob/4a7eb329734131e1ef90419f405986de94a30846/buildSrc/src/main/groovy/org/apache/beam/gradle/VendorJavaPlugin.groovy#L215
   
   @lukecwik Done!

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [beam] tweise commented on issue #11399: Interpolate publish credentials as expected for Maven settings.xml

Posted by GitBox <gi...@apache.org>.
tweise commented on issue #11399: Interpolate publish credentials as expected for Maven settings.xml
URL: https://github.com/apache/beam/pull/11399#issuecomment-612929859
 
 
   Unrelated failure:
   ```
   07:43:02 > Task :beam-test-infra-metrics:composeUp FAILED
   07:43:02 
   07:43:02 FAILURE: Build failed with an exception.
   07:43:02 
   07:43:02 * What went wrong:
   07:43:02 Execution failed for task ':beam-test-infra-metrics:composeUp'.
   07:43:02 > Exit-code 255 when calling docker-compose, stdout: postgresql uses an image, skipping
   07:43:02   prometheus uses an image, skipping
   07:43:02   pushgateway uses an image, skipping
   07:43:02   alertmanager uses an image, skipping
   07:43:02   Building grafana
   07:43:02   [17276] Failed to execute script docker-compose
   07:43:02   Traceback (most recent call last):
   07:43:02     File "bin/docker-compose", line 6, in <module>
   07:43:02     File "compose/cli/main.py", line 71, in main
   07:43:02     File "compose/cli/main.py", line 127, in perform_command
   07:43:02     File "compose/cli/main.py", line 287, in build
   07:43:02     File "compose/project.py", line 386, in build
   07:43:02     File "compose/project.py", line 368, in build_service
   07:43:02     File "compose/service.py", line 1084, in build
   07:43:02     File "site-packages/docker/api/build.py", line 260, in build
   07:43:02     File "site-packages/docker/api/build.py", line 307, in _set_auth_headers
   07:43:02     File "site-packages/docker/auth.py", line 310, in get_all_credentials
   07:43:02     File "site-packages/docker/auth.py", line 262, in _resolve_authconfig_credstore
   07:43:02     File "site-packages/docker/auth.py", line 287, in _get_store_instance
   07:43:02     File "site-packages/dockerpycreds/store.py", line 25, in __init__
   07:43:02   dockerpycreds.errors.InitializationError: docker-credential-gcloud not installed or not available in PATH
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [beam] iemejia commented on issue #11399: Interpolate publish credentials as expected for Maven settings.xml

Posted by GitBox <gi...@apache.org>.
iemejia commented on issue #11399: Interpolate publish credentials as expected for Maven settings.xml
URL: https://github.com/apache/beam/pull/11399#issuecomment-613250393
 
 
   Run CommunityMetrics PreCommit

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [beam] lukecwik commented on a change in pull request #11399: Interpolate publish credentials as expected for Maven settings.xml

Posted by GitBox <gi...@apache.org>.
lukecwik commented on a change in pull request #11399: Interpolate publish credentials as expected for Maven settings.xml
URL: https://github.com/apache/beam/pull/11399#discussion_r407545725
 
 

 ##########
 File path: buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
 ##########
 @@ -600,9 +600,10 @@ class BeamModulePlugin implements Plugin<Project> {
                   ? 'apache.releases.https' : 'apache.snapshots.https')
           def m2SettingCreds = new XmlSlurper().parse(settingsXml).servers.server.find { server -> serverId.equals(server.id.text()) }
           if (m2SettingCreds) {
+            def GroovyShell shell = new GroovyShell(new Binding([env:System.getenv()]))
             credentials {
-              username m2SettingCreds.username.text()
-              password m2SettingCreds.password.text()
+              username shell.evaluate('"' + m2SettingCreds.username.text() +'"')
+              password shell.evaluate('"' + m2SettingCreds.password.text() +'"')
 
 Review comment:
   What about considering using a plugin to do this, there seems to be a few promising ones:
   https://github.com/datlowe/gradle-maven-publish-auth
   https://github.com/sebersole/gradle-maven-publish-auth
   (might be more as well)
   
   Also, if finding an existing plugin to do this doesn't work out, what about integrating with the maven settings builder?
   https://github.com/apache/maven/blob/a2b800de32cdb9adc1e64a43a0fc32e3ba878103/maven-core/src/main/java/org/apache/maven/settings/MavenSettingsBuilder.java#L42

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [beam] mxm commented on a change in pull request #11399: Interpolate publish credentials as expected for Maven settings.xml

Posted by GitBox <gi...@apache.org>.
mxm commented on a change in pull request #11399: Interpolate publish credentials as expected for Maven settings.xml
URL: https://github.com/apache/beam/pull/11399#discussion_r407534388
 
 

 ##########
 File path: buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
 ##########
 @@ -600,9 +600,10 @@ class BeamModulePlugin implements Plugin<Project> {
                   ? 'apache.releases.https' : 'apache.snapshots.https')
           def m2SettingCreds = new XmlSlurper().parse(settingsXml).servers.server.find { server -> serverId.equals(server.id.text()) }
           if (m2SettingCreds) {
+            def GroovyShell shell = new GroovyShell(new Binding([env:System.getenv()]))
             credentials {
-              username m2SettingCreds.username.text()
-              password m2SettingCreds.password.text()
+              username shell.evaluate('"' + m2SettingCreds.username.text() +'"')
+              password shell.evaluate('"' + m2SettingCreds.password.text() +'"')
 
 Review comment:
   At the least I have to make sure for my password not to contain `$}{` or any Groovy keywords. I think this also allows arbitrary groovy code to be injected into the build code. Could we introduce a flag in the xml settings to indicate whether we have an environment variable or a plain password?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [beam] tweise commented on issue #11399: Interpolate publish credentials as expected for Maven settings.xml

Posted by GitBox <gi...@apache.org>.
tweise commented on issue #11399: Interpolate publish credentials as expected for Maven settings.xml
URL: https://github.com/apache/beam/pull/11399#issuecomment-614278012
 
 
   Run Python2_PVR_Flink PreCommit

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [beam] tweise commented on issue #11399: Interpolate publish credentials as expected for Maven settings.xml

Posted by GitBox <gi...@apache.org>.
tweise commented on issue #11399: Interpolate publish credentials as expected for Maven settings.xml
URL: https://github.com/apache/beam/pull/11399#issuecomment-613747240
 
 
   Run Java PreCommit

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [beam] mxm commented on a change in pull request #11399: Interpolate publish credentials as expected for Maven settings.xml

Posted by GitBox <gi...@apache.org>.
mxm commented on a change in pull request #11399: Interpolate publish credentials as expected for Maven settings.xml
URL: https://github.com/apache/beam/pull/11399#discussion_r407527196
 
 

 ##########
 File path: buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
 ##########
 @@ -600,9 +600,10 @@ class BeamModulePlugin implements Plugin<Project> {
                   ? 'apache.releases.https' : 'apache.snapshots.https')
           def m2SettingCreds = new XmlSlurper().parse(settingsXml).servers.server.find { server -> serverId.equals(server.id.text()) }
           if (m2SettingCreds) {
+            def GroovyShell shell = new GroovyShell(new Binding([env:System.getenv()]))
             credentials {
-              username m2SettingCreds.username.text()
-              password m2SettingCreds.password.text()
+              username shell.evaluate('"' + m2SettingCreds.username.text() +'"')
+              password shell.evaluate('"' + m2SettingCreds.password.text() +'"')
 
 Review comment:
   Does this not change the semantics from using the username/password found in the settings to interpreting them as environment variables names and loading them from the environment? If so, shouldn't this be configurable?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [beam] lukecwik commented on a change in pull request #11399: Interpolate publish credentials as expected for Maven settings.xml

Posted by GitBox <gi...@apache.org>.
lukecwik commented on a change in pull request #11399: Interpolate publish credentials as expected for Maven settings.xml
URL: https://github.com/apache/beam/pull/11399#discussion_r407651324
 
 

 ##########
 File path: buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
 ##########
 @@ -600,9 +600,10 @@ class BeamModulePlugin implements Plugin<Project> {
                   ? 'apache.releases.https' : 'apache.snapshots.https')
           def m2SettingCreds = new XmlSlurper().parse(settingsXml).servers.server.find { server -> serverId.equals(server.id.text()) }
           if (m2SettingCreds) {
+            def GroovyShell shell = new GroovyShell(new Binding([env:System.getenv()]))
             credentials {
-              username m2SettingCreds.username.text()
-              password m2SettingCreds.password.text()
+              username shell.evaluate('"' + m2SettingCreds.username.text() +'"')
+              password shell.evaluate('"' + m2SettingCreds.password.text() +'"')
 
 Review comment:
   I see, followed up with one plugin author: https://github.com/sebersole/gradle-maven-publish-auth/issues/16#issuecomment-613040172

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [beam] iemejia commented on issue #11399: Interpolate publish credentials as expected for Maven settings.xml

Posted by GitBox <gi...@apache.org>.
iemejia commented on issue #11399: Interpolate publish credentials as expected for Maven settings.xml
URL: https://github.com/apache/beam/pull/11399#issuecomment-613362078
 
 
   Failing test seems related to ongoing infra issue for ref [BEAM-7405](https://issues.apache.org/jira/browse/BEAM-7405)

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [beam] tweise commented on issue #11399: Interpolate publish credentials as expected for Maven settings.xml

Posted by GitBox <gi...@apache.org>.
tweise commented on issue #11399: Interpolate publish credentials as expected for Maven settings.xml
URL: https://github.com/apache/beam/pull/11399#issuecomment-613747057
 
 
   Run Python2_PVR_Flink PreCommit

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services