• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • git-plugin
    • None

      We discoverd that parameters of one Pipeline job affect the parameters of other jobs. This means that in a job you have multiple parameters with the same name. A part of the parameters is from the current job the rest is defined in another (independent) job. (Both jobs should run simultaneously (but independent from each other) on the same Repository/PullRequest)

      Is this normal? Can I configure that parameters are only valid for one specific Job.

      Example: Two jobs have the Parameter "BranchSpecifier". The Parameter in Job A is set to "develop" and in Job B to "master". What is happening is that both Jobs now have two times the Parameter "BranchSpecifier" – once with value 'develop' and once 'master'.
      --> This is valid for all Parameters of both jobs (in both directions)

       

      Note: Job B in this example was created by copying Job A.
      Also the mentioned parameter in the example is used in the Job config as specifier for the branch the job will use to check out the Pipeline scripts from our Pipeline repo. This way we can trigger the job using pipeline scripts  from another branch (for tests).

      The effect of this bug is that both jobs will check out  the same branch and nt the one specified in the parameter.

          [JENKINS-45472] Job parameters appear in multiple jobs

          Mateusz Tarnawa added a comment - - edited

          Hi danielbeck - I've commented in the PR. Unfortunately this doesn't fully work.

           

          markewaite - unfortunately skipping sha1 doesn't cut it . We use Bitbucket Webhook which requires sha1 to be present if the build is being triggered from the PR level. We skipped sha1 passing for build on commits, but that prevents us from rebuilding PRs.

          Mateusz Tarnawa added a comment - - edited Hi danielbeck - I've commented in the PR. Unfortunately this doesn't fully work.   markewaite - unfortunately skipping sha1 doesn't cut it . We use Bitbucket Webhook which requires sha1 to be present if the build is being triggered from the PR level. We skipped sha1 passing for build on commits, but that prevents us from rebuilding PRs.

          Daniel Beck added a comment -

          mtarnawa Well, it resolves half the issue, sort of, and you confirmed that

          the second job will likely also get the first job's parameters

          since Git Plugin accumulates parameter values in the same list.

          Daniel Beck added a comment - mtarnawa Well, it resolves half the issue, sort of, and you confirmed that the second job will likely also get the first job's parameters since Git Plugin accumulates parameter values in the same list.

          Mateusz Tarnawa added a comment - - edited

          Thanks, got it. Should I raise a separate bug for the first problem you mentioned in the PR?

          It accumulates all builds' parameters as the list doesn't get cleared between build triggers.

          Mateusz Tarnawa added a comment - - edited Thanks, got it. Should I raise a separate bug for the first problem you mentioned in the PR? It accumulates all builds' parameters as the list doesn't get cleared between build triggers.

          Daniel Beck added a comment -

          I think this issue is appropriate for that behavior.

          My change to core just sanitizes some questionable behavior, but a fix in Git Plugin is needed anyway.

          If anything, my core PR could use a separate issue, but as it's just a form of robustness hardening, that's not strictly needed. I can just point here for motivation.

          Daniel Beck added a comment - I think this issue is appropriate for that behavior. My change to core just sanitizes some questionable behavior, but a fix in Git Plugin is needed anyway. If anything, my core PR could use a separate issue, but as it's just a form of robustness hardening, that's not strictly needed. I can just point here for motivation.

          Code changed in jenkins
          User: Daniel Beck
          Path:
          core/src/main/java/hudson/model/ParametersAction.java
          http://jenkins-ci.org/commit/jenkins/e044675e15c2303a7a3c9a391f0c08b2ac97dc78
          Log:
          JENKINS-45472 Copy the list in case it's reused elsewhere

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: core/src/main/java/hudson/model/ParametersAction.java http://jenkins-ci.org/commit/jenkins/e044675e15c2303a7a3c9a391f0c08b2ac97dc78 Log: JENKINS-45472 Copy the list in case it's reused elsewhere

          Code changed in jenkins
          User: Daniel Beck
          Path:
          test/src/test/java/hudson/model/ParametersAction2Test.java
          http://jenkins-ci.org/commit/jenkins/9c939c4eb421f2ab08f27bfef10c1754d5295ab7
          Log:
          JENKINS-45472 Add test

          Without the fix, test fails in line 308 with:

          org.junit.ComparisonFailure:
          Expected :for p2
          Actual :for p1

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: test/src/test/java/hudson/model/ParametersAction2Test.java http://jenkins-ci.org/commit/jenkins/9c939c4eb421f2ab08f27bfef10c1754d5295ab7 Log: JENKINS-45472 Add test Without the fix, test fails in line 308 with: org.junit.ComparisonFailure: Expected :for p2 Actual :for p1

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          core/src/main/java/hudson/model/ParametersAction.java
          test/src/test/java/hudson/model/ParametersAction2Test.java
          http://jenkins-ci.org/commit/jenkins/fbaa059cf0a842a107858cc39f8df5e8795858a7
          Log:
          Merge pull request #3028 from daniel-beck/JENKINS-45472

          JENKINS-45472 Copy the list in case it's reused elsewhere

          Compare: https://github.com/jenkinsci/jenkins/compare/f2ac41e975cb...fbaa059cf0a8

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/model/ParametersAction.java test/src/test/java/hudson/model/ParametersAction2Test.java http://jenkins-ci.org/commit/jenkins/fbaa059cf0a842a107858cc39f8df5e8795858a7 Log: Merge pull request #3028 from daniel-beck/ JENKINS-45472 JENKINS-45472 Copy the list in case it's reused elsewhere Compare: https://github.com/jenkinsci/jenkins/compare/f2ac41e975cb...fbaa059cf0a8

          Daniel Beck added a comment -

          Not fixed by the core change referenced above, needs a fix in Git Plugin.

          Daniel Beck added a comment - Not fixed by the core change referenced above, needs a fix in Git Plugin.

          danielbeck markewaite

          Sorry to follow-up, but is this issue somewhere in the pipeline for any upcoming Jenkins/GitPlugin release? Thanks.

          Mateusz Tarnawa added a comment - danielbeck markewaite Sorry to follow-up, but is this issue somewhere in the pipeline for any upcoming Jenkins/GitPlugin release? Thanks.

          Mark Waite added a comment -

          This is not planned for any upcoming git plugin release.  My weekends and evenings have been focused on JENKINS-45447 and JENKINS-47169.  You're welcome to submit a pull request to confirm the problem with tests and to propose a fix for the problem.

          Mark Waite added a comment - This is not planned for any upcoming git plugin release.  My weekends and evenings have been focused on JENKINS-45447 and JENKINS-47169 .  You're welcome to submit a pull request to confirm the problem with tests and to propose a fix for the problem.

            Unassigned Unassigned
            ditschi Christian Ditscher
            Votes:
            4 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated: