Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-13222

Allow job selection with fixed job names to contain variables without requiring job permissions for authenticated users

      Copy Artifacts plugin prevents copying from jobs when the job specifier ("project name") changes by evaluating variables contained in it.

      This should be changed to check whether the job name part of the expression is fixed, and only the filter dynamic, thereby making it possible to e.g. select a build with a same parameter as the current build (SourceJob/param=$param) without requiring permission on that project for all authenticated users.

          [JENKINS-13222] Allow job selection with fixed job names to contain variables without requiring job permissions for authenticated users

          Daniel Beck added a comment -

          Something like the attached patch might work for this. I've been using a patched 1.21 or so for a while successfully.

          Daniel Beck added a comment - Something like the attached patch might work for this. I've been using a patched 1.21 or so for a while successfully.

          Daniel Beck added a comment -

          Attached a patch for 1.25. Note that there might be parameter values that include forward slashes, so we need to determine where the first parameter starts. This assumes there's no job name with 'equal' character.

          A proper solution probably uses a configurable separation char, or uses a second text field for parameter filtering altogether, especially since the UI is misleading: Filtering only works for "latest successful build" AFAICT.

          Daniel Beck added a comment - Attached a patch for 1.25. Note that there might be parameter values that include forward slashes, so we need to determine where the first parameter starts. This assumes there's no job name with 'equal' character. A proper solution probably uses a configurable separation char, or uses a second text field for parameter filtering altogether, especially since the UI is misleading: Filtering only works for "latest successful build" AFAICT.

          Jesse Glick added a comment -

          The patch is not correct, since when using folders isFixedJobName("dir/${job}") should be false.

          Stuffing parameters into projectName definitely contributes to the difficulty here. This should never have been part of the same field, and certainly not using / as a separator. Anyway JENKINS-8657 seems to be foolish; better to ditch BuildFilter and make it possible to compose one BuildSelector with another. TBD whether settings in the existing format can be compatibly migrated to a saner structure.

          Jesse Glick added a comment - The patch is not correct, since when using folders isFixedJobName("dir/${job}") should be false. Stuffing parameters into projectName definitely contributes to the difficulty here. This should never have been part of the same field, and certainly not using / as a separator. Anyway JENKINS-8657 seems to be foolish; better to ditch BuildFilter and make it possible to compose one BuildSelector with another. TBD whether settings in the existing format can be compatibly migrated to a saner structure.

          Jesse Glick added a comment -

          Getting rid of BuildFilter may be tricky at this point for compatibility reasons, but should still be possible to split its configuration into a different field at least.

          Jesse Glick added a comment - Getting rid of BuildFilter may be tricky at this point for compatibility reasons, but should still be possible to split its configuration into a different field at least.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/main/java/hudson/plugins/copyartifact/CopyArtifact.java
          src/test/java/hudson/plugins/copyartifact/CopyArtifactTest.java
          http://jenkins-ci.org/commit/copyartifact-plugin/c73e406fee8c0c0959389c8bcdfd2901081c1cf6
          Log:
          [FIXED JENKINS-13222] 6243f6b laid the ground for fix; now correcting to expand variables in the parameters field (the trigger for the original bug).


          You received this message because you are subscribed to the Google Groups "Jenkins Commits" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com.
          For more options, visit https://groups.google.com/groups/opt_out.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/hudson/plugins/copyartifact/CopyArtifact.java src/test/java/hudson/plugins/copyartifact/CopyArtifactTest.java http://jenkins-ci.org/commit/copyartifact-plugin/c73e406fee8c0c0959389c8bcdfd2901081c1cf6 Log: [FIXED JENKINS-13222] 6243f6b laid the ground for fix; now correcting to expand variables in the parameters field (the trigger for the original bug). – You received this message because you are subscribed to the Google Groups "Jenkins Commits" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out .

            mindless Alan Harder
            danielbeck Daniel Beck
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: