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

          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 made changes -
          Attachment New: fix.diff [ 21836 ]
          wernight made changes -
          Link New: This issue is related to JENKINS-16813 [ JENKINS-16813 ]

          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.
          Daniel Beck made changes -
          Attachment New: copyartifact-1.25-patch.diff [ 23211 ]
          Jesse Glick made changes -
          Link New: This issue depends on JENKINS-16956 [ JENKINS-16956 ]

          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 made changes -
          Link New: This issue is blocking JENKINS-8657 [ JENKINS-8657 ]

          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.

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

              Created:
              Updated:
              Resolved: