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

git-plugin on workflow job with job-parameter does not trigger build

      Git plugin writes no-change if the parameter point to build parameter '${branch_name}' in GitSCM class line: 620:

      final EnvVars environment = project instanceof AbstractProject ? GitUtils.getPollEnvironment((AbstractProject) project, workspace, launcher, listener, false) : new EnvVars();

      so the 'environment' is empty and won't be resolved.

       

          [JENKINS-44296] git-plugin on workflow job with job-parameter does not trigger build

          Mark Waite added a comment -

          Could you describe the problem you're seeing in terms that can be seen from the user interface?

          I don't understand the cases where you're seeing a problem, nor do I understand what you're proposing as a solution.

          Alternately, please create a pull request which includes tests that show the problem you're describing, and include the proposed change in the same pull request.

          Mark Waite added a comment - Could you describe the problem you're seeing in terms that can be seen from the user interface? I don't understand the cases where you're seeing a problem, nor do I understand what you're proposing as a solution. Alternately, please create a pull request which includes tests that show the problem you're describing, and include the proposed change in the same pull request.

          I have jenkins job of type 'Pipeline'.

          I add build parameter '${branch_name}', in the 'Branches to build' I write: '${branch_name}' so now when github send push notification it finally get to the class: 'GitSCM'

          in this class when it iterate on the branches it check the type of the Job: 'project instanceof AbstractProject' hence pipeline does not instance of that it get empty ENV so it does not resolve the parameter and use it as is and failed to match the branch.

          Izek Greenfied added a comment - I have jenkins job of type 'Pipeline'. I add build parameter '${branch_name}', in the 'Branches to build' I write: '${branch_name}' so now when github send push notification it finally get to the class: 'GitSCM' in this class when it iterate on the branches it check the type of the Job: 'project instanceof AbstractProject' hence pipeline does not instance of that it get empty ENV so it does not resolve the parameter and use it as is and failed to match the branch.

            Unassigned Unassigned
            igreenfi Izek Greenfied
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: