[JIRA] Created: (HUDSON-5911) URLSCM does not allow parameters in the URL

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[JIRA] Created: (HUDSON-5911) URLSCM does not allow parameters in the URL

Hudson issues mailing list
URLSCM does not allow parameters in the URL
-------------------------------------------

                 Key: HUDSON-5911
                 URL: http://issues.hudson-ci.org/browse/HUDSON-5911
             Project: Hudson
          Issue Type: Improvement
          Components: urlscm
    Affects Versions: current
         Environment: URLSCM 1.5
            Reporter: slide_o_mix
            Assignee: mdonohue
            Priority: Minor


Putting parameters, e.g. ${BUILD} into the URL for the URL SCM plugin in the job configuration doesn't work. It does not replace the value. For parameterized builds, this is a nice feature because you may want to grab from a different URL based on a parameter.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.hudson-ci.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[JIRA] Commented: (HUDSON-5911) URLSCM does not allow parameters in the URL

Hudson issues mailing list

    [ http://issues.hudson-ci.org/browse/HUDSON-5911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=136715#action_136715 ]

slide_o_mix commented on HUDSON-5911:
-------------------------------------

This patch allows putting variables into the URL. The only issue is that the AJAX validation of the URL on the job config screen does not work when a variable is there.

Index: URLSCM.java
===================================================================
--- URLSCM.java (revision 28513)
+++ URLSCM.java (working copy)
@@ -1,6 +1,7 @@
 package hudson.plugins.URLSCM;

 import hudson.Extension;
+import hudson.Util;
 import static hudson.Util.fixEmpty;
 import hudson.FilePath;
 import hudson.Launcher;
@@ -15,6 +16,7 @@
 import hudson.scm.SCM;
 import hudson.scm.SCMDescriptor;
 import hudson.util.FormValidation;
+import hudson.util.VariableResolver;

 import java.io.File;
 import java.io.IOException;
@@ -61,7 +63,7 @@
         URLDateAction dates = new URLDateAction(build);

         for(URLTuple tuple : urls) {
-            String urlString = tuple.getUrl();
+           String urlString = substitute(build, tuple.getUrl());
             InputStream is = null;
             OutputStream os = null;
             try {
@@ -139,6 +141,10 @@
         return change;
     }

+    private String substitute(AbstractBuild build, String input) {
+       return Util.replaceMacro(input,build.getBuildVariableResolver());
+    }
+
     public static final class URLTuple {
         private String urlString;
         public URLTuple(String s) {

> URLSCM does not allow parameters in the URL
> -------------------------------------------
>
>                 Key: HUDSON-5911
>                 URL: http://issues.hudson-ci.org/browse/HUDSON-5911
>             Project: Hudson
>          Issue Type: Improvement
>          Components: urlscm
>    Affects Versions: current
>         Environment: URLSCM 1.5
>            Reporter: slide_o_mix
>            Assignee: mdonohue
>            Priority: Minor
>
> Putting parameters, e.g. ${BUILD} into the URL for the URL SCM plugin in the job configuration doesn't work. It does not replace the value. For parameterized builds, this is a nice feature because you may want to grab from a different URL based on a parameter.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.hudson-ci.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[JIRA] Issue Comment Edited: (HUDSON-5911) URLSCM does not allow parameters in the URL

Hudson issues mailing list
In reply to this post by Hudson issues mailing list

    [ http://issues.hudson-ci.org/browse/HUDSON-5911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=136715#action_136715 ]

slide_o_mix edited comment on HUDSON-5911 at 3/11/10 10:32 AM:
---------------------------------------------------------------

This patch allows putting variables into the URL. The only issue is that the AJAX validation of the URL on the job config screen does not work when a variable is there.

{noformat}
Index: URLSCM.java
===================================================================
--- URLSCM.java (revision 28513)
+++ URLSCM.java (working copy)
@@ -1,6 +1,7 @@
 package hudson.plugins.URLSCM;

 import hudson.Extension;
+import hudson.Util;
 import static hudson.Util.fixEmpty;
 import hudson.FilePath;
 import hudson.Launcher;
@@ -15,6 +16,7 @@
 import hudson.scm.SCM;
 import hudson.scm.SCMDescriptor;
 import hudson.util.FormValidation;
+import hudson.util.VariableResolver;

 import java.io.File;
 import java.io.IOException;
@@ -61,7 +63,7 @@
         URLDateAction dates = new URLDateAction(build);

         for(URLTuple tuple : urls) {
-            String urlString = tuple.getUrl();
+           String urlString = substitute(build, tuple.getUrl());
             InputStream is = null;
             OutputStream os = null;
             try {
@@ -139,6 +141,10 @@
         return change;
     }

+    private String substitute(AbstractBuild build, String input) {
+       return Util.replaceMacro(input,build.getBuildVariableResolver());
+    }
+
     public static final class URLTuple {
         private String urlString;
         public URLTuple(String s) {
{noformat}

      was (Author: slide_o_mix):
    This patch allows putting variables into the URL. The only issue is that the AJAX validation of the URL on the job config screen does not work when a variable is there.

Index: URLSCM.java
===================================================================
--- URLSCM.java (revision 28513)
+++ URLSCM.java (working copy)
@@ -1,6 +1,7 @@
 package hudson.plugins.URLSCM;

 import hudson.Extension;
+import hudson.Util;
 import static hudson.Util.fixEmpty;
 import hudson.FilePath;
 import hudson.Launcher;
@@ -15,6 +16,7 @@
 import hudson.scm.SCM;
 import hudson.scm.SCMDescriptor;
 import hudson.util.FormValidation;
+import hudson.util.VariableResolver;

 import java.io.File;
 import java.io.IOException;
@@ -61,7 +63,7 @@
         URLDateAction dates = new URLDateAction(build);

         for(URLTuple tuple : urls) {
-            String urlString = tuple.getUrl();
+           String urlString = substitute(build, tuple.getUrl());
             InputStream is = null;
             OutputStream os = null;
             try {
@@ -139,6 +141,10 @@
         return change;
     }

+    private String substitute(AbstractBuild build, String input) {
+       return Util.replaceMacro(input,build.getBuildVariableResolver());
+    }
+
     public static final class URLTuple {
         private String urlString;
         public URLTuple(String s) {
 

> URLSCM does not allow parameters in the URL
> -------------------------------------------
>
>                 Key: HUDSON-5911
>                 URL: http://issues.hudson-ci.org/browse/HUDSON-5911
>             Project: Hudson
>          Issue Type: Improvement
>          Components: urlscm
>    Affects Versions: current
>         Environment: URLSCM 1.5
>            Reporter: slide_o_mix
>            Assignee: mdonohue
>            Priority: Minor
>
> Putting parameters, e.g. ${BUILD} into the URL for the URL SCM plugin in the job configuration doesn't work. It does not replace the value. For parameterized builds, this is a nice feature because you may want to grab from a different URL based on a parameter.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.hudson-ci.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[JIRA] Commented: (HUDSON-5911) URLSCM does not allow parameters in the URL

Hudson issues mailing list
In reply to this post by Hudson issues mailing list

    [ http://issues.hudson-ci.org/browse/HUDSON-5911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=139311#action_139311 ]

pgweiss commented on HUDSON-5911:
---------------------------------

Is that the only issue?  How will polling work?  Will you require that the parameter in question has a default value so that you can poll?

> URLSCM does not allow parameters in the URL
> -------------------------------------------
>
>                 Key: HUDSON-5911
>                 URL: http://issues.hudson-ci.org/browse/HUDSON-5911
>             Project: Hudson
>          Issue Type: Improvement
>          Components: urlscm
>    Affects Versions: current
>         Environment: URLSCM 1.5
>            Reporter: slide_o_mix
>            Assignee: mdonohue
>            Priority: Minor
>
> Putting parameters, e.g. ${BUILD} into the URL for the URL SCM plugin in the job configuration doesn't work. It does not replace the value. For parameterized builds, this is a nice feature because you may want to grab from a different URL based on a parameter.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.hudson-ci.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[JIRA] Commented: (HUDSON-5911) URLSCM does not allow parameters in the URL

Hudson issues mailing list
In reply to this post by Hudson issues mailing list

    [ http://issues.hudson-ci.org/browse/HUDSON-5911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=139313#action_139313 ]

slide_o_mix commented on HUDSON-5911:
-------------------------------------

That's a good point, it would require a default value so that polling could be done. I guess my usage model is a bit different, so that had not entered into the picture for me.

> URLSCM does not allow parameters in the URL
> -------------------------------------------
>
>                 Key: HUDSON-5911
>                 URL: http://issues.hudson-ci.org/browse/HUDSON-5911
>             Project: Hudson
>          Issue Type: Improvement
>          Components: urlscm
>    Affects Versions: current
>         Environment: URLSCM 1.5
>            Reporter: slide_o_mix
>            Assignee: mdonohue
>            Priority: Minor
>
> Putting parameters, e.g. ${BUILD} into the URL for the URL SCM plugin in the job configuration doesn't work. It does not replace the value. For parameterized builds, this is a nice feature because you may want to grab from a different URL based on a parameter.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.hudson-ci.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]