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

Git parameter plugin is not retrieving revision number

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • git-parameter-plugin
    • OS: CentOS 6.7
      Jenkins version: 2.89.4
      Git parameter plugin: 0.9.2

      Hi, 

      Trying to make some functional tests with git parameter plugin, I realised that when configuring "Revision" as input parameter, the list appears as it was empty. I don't have this problem when defining branch or tag as input parameters. 

      In the image below you can see the issue I'm reporting:

      However, I've seen that in this list there is content, because I'm able to click on any item on it and, when launching the job, it indicates me the revision I'm working with, and it is different depending on the row of the list I clicked. In summary, the issue is that Jenkins doesn't show the revisions in the list, but they are really there. 

      Investigating this strange behaviour I've seen this message in Jenkins lo

      This message is returned in java class RevisionInfoFactory.java, whose source code is here: https://github.com/jenkinsci/git-parameter-plugin/blob/master/src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/RevisionInfoFactory.java

      Analysing the code I assume that  __ authorLine variable. In this case, it seems clear that the pattern that Jenkins Git parameter plugin is obtaining from Git doesn't match with the one defined here in  RevisionInfoFactory.java:

      public static final Pattern AUTHOR_LINE_PATTERN = Pattern.compile("author (.* <.@.>) (
      d{10}) (\\+-
      d{4})");

       

      Have you found any similar issue before? Is there a plan to resolve this?

       

      Regards

          [JENKINS-51476] Git parameter plugin is not retrieving revision number

          Hi,

          You have configured JGit in our job as 'Git executable'

          JGit returns a different date format then native Git

          JGit (JGitAPIImpl) raw

          commit ee650d9b5dbc39ec1bdfc6608f49db94ce8d7be4
          tree bec018f8e55ce4a83fe4fb5592ffafaf5732d9d1
          parent b9a246e842a5478fe01b52eb93e0e23cdb79f616
          author klimas7 <klimas7@gmail.com> 2018-04-16T21:35:17+0200
          committer klimas7 <klimas7@gmail.com> 2018-04-16T21:35:17+0200
          
          Version 0.9.2 - Typo"
          
          :100644 100644 a01738c8f727254fdcf9d03fcb0965567104a31e 7000020bf612f451539eb83beccfdef898fecdb3 M\tREADME.textile
          

          Git (CliGitAPIImpl) raw

          commit ee650d9b5dbc39ec1bdfc6608f49db94ce8d7be4
          tree bec018f8e55ce4a83fe4fb5592ffafaf5732d9d1
          parent b9a246e842a5478fe01b52eb93e0e23cdb79f616
          author klimas7 <klimas7@gmail.com> 1523907317 +0200
          committer klimas7 <klimas7@gmail.com> 1523907317 +0200
          
          Version 0.9.2 - Typo"
          
          :100644 100644 a01738c8f727254fdcf9d03fcb0965567104a31e 7000020bf612f451539eb83beccfdef898fecdb3 M\tREADME.textile
          

          Thanks for reported issue.

          Regards

          Bogusław

           

           

          Boguslaw Klimas added a comment - Hi, You have configured JGit in our job as 'Git executable' JGit returns a different date format then native Git JGit (JGitAPIImpl) raw commit ee650d9b5dbc39ec1bdfc6608f49db94ce8d7be4 tree bec018f8e55ce4a83fe4fb5592ffafaf5732d9d1 parent b9a246e842a5478fe01b52eb93e0e23cdb79f616 author klimas7 <klimas7@gmail.com> 2018-04-16T21:35:17+0200 committer klimas7 <klimas7@gmail.com> 2018-04-16T21:35:17+0200 Version 0.9.2 - Typo" :100644 100644 a01738c8f727254fdcf9d03fcb0965567104a31e 7000020bf612f451539eb83beccfdef898fecdb3 M\tREADME.textile Git (CliGitAPIImpl) raw commit ee650d9b5dbc39ec1bdfc6608f49db94ce8d7be4 tree bec018f8e55ce4a83fe4fb5592ffafaf5732d9d1 parent b9a246e842a5478fe01b52eb93e0e23cdb79f616 author klimas7 <klimas7@gmail.com> 1523907317 +0200 committer klimas7 <klimas7@gmail.com> 1523907317 +0200 Version 0.9.2 - Typo" :100644 100644 a01738c8f727254fdcf9d03fcb0965567104a31e 7000020bf612f451539eb83beccfdef898fecdb3 M\tREADME.textile Thanks for reported issue. Regards BogusÅ‚aw    

          Code changed in jenkins
          User: klimas7
          Path:
          src/test/java/net/uaznia/lukanus/hudson/plugins/gitparameter/RevisionInfoFactoryTest.java
          http://jenkins-ci.org/commit/git-parameter-plugin/a324ac6988ee0fb76fdaaa5f92db2326793f9b70
          Log:
          JENKINS-51476: JGit retrieving revision number

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: klimas7 Path: src/test/java/net/uaznia/lukanus/hudson/plugins/gitparameter/RevisionInfoFactoryTest.java http://jenkins-ci.org/commit/git-parameter-plugin/a324ac6988ee0fb76fdaaa5f92db2326793f9b70 Log: JENKINS-51476 : JGit retrieving revision number

          Code changed in jenkins
          User: klimas7
          Path:
          src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/RevisionInfoFactory.java
          src/test/java/net/uaznia/lukanus/hudson/plugins/gitparameter/RevisionInfoFactoryTest.java
          http://jenkins-ci.org/commit/git-parameter-plugin/339825733729199a0c22c35d597fb8d837f0b59e
          Log:
          JENKINS-51476: JGit retrieving revision number

          Compare: https://github.com/jenkinsci/git-parameter-plugin/compare/a324ac6988ee^...339825733729
          *NOTE:* This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

          Functionality will be removed from GitHub.com on January 31st, 2019.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: klimas7 Path: src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/RevisionInfoFactory.java src/test/java/net/uaznia/lukanus/hudson/plugins/gitparameter/RevisionInfoFactoryTest.java http://jenkins-ci.org/commit/git-parameter-plugin/339825733729199a0c22c35d597fb8d837f0b59e Log: JENKINS-51476 : JGit retrieving revision number Compare: https://github.com/jenkinsci/git-parameter-plugin/compare/a324ac6988ee ^...339825733729 * NOTE: * This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/ Functionality will be removed from GitHub.com on January 31st, 2019.

          Code changed in jenkins
          User: klimas7
          Path:
          src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/RevisionInfoFactory.java
          http://jenkins-ci.org/commit/git-parameter-plugin/d840a835fd28c77b3e8b7b7e4430b98df77fdbb9
          Log:
          JENKINS-51476: JGit retrieving revision number, fix zone

          *NOTE:* This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

          Functionality will be removed from GitHub.com on January 31st, 2019.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: klimas7 Path: src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/RevisionInfoFactory.java http://jenkins-ci.org/commit/git-parameter-plugin/d840a835fd28c77b3e8b7b7e4430b98df77fdbb9 Log: JENKINS-51476 : JGit retrieving revision number, fix zone * NOTE: * This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/ Functionality will be removed from GitHub.com on January 31st, 2019.

          Code changed in jenkins
          User: Boguslaw Klimas
          Path:
          src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/RevisionInfoFactory.java
          src/test/java/net/uaznia/lukanus/hudson/plugins/gitparameter/RevisionInfoFactoryTest.java
          http://jenkins-ci.org/commit/git-parameter-plugin/2369bfe8e101c3129e3c61966c5e721054f4a91f
          Log:
          Merge pull request #64 from jenkinsci/bugfix/JENKINS-51476

          Bugfix/jenkins 51476

          Compare: https://github.com/jenkinsci/git-parameter-plugin/compare/ee650d9b5dbc...2369bfe8e101
          *NOTE:* This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

          Functionality will be removed from GitHub.com on January 31st, 2019.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Boguslaw Klimas Path: src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/RevisionInfoFactory.java src/test/java/net/uaznia/lukanus/hudson/plugins/gitparameter/RevisionInfoFactoryTest.java http://jenkins-ci.org/commit/git-parameter-plugin/2369bfe8e101c3129e3c61966c5e721054f4a91f Log: Merge pull request #64 from jenkinsci/bugfix/ JENKINS-51476 Bugfix/jenkins 51476 Compare: https://github.com/jenkinsci/git-parameter-plugin/compare/ee650d9b5dbc...2369bfe8e101 * NOTE: * This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/ Functionality will be removed from GitHub.com on January 31st, 2019.

          Release version 0.9.3

          Boguslaw Klimas added a comment - Release version 0.9.3

            klimas7 Boguslaw Klimas
            chortels Carlos Hortelano
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: