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

The top value is better to be chosen by default of to have such option

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      It would be good to have an option or setting the most top of results to be chosen by default.

        Attachments

        1. by timer_console.PNG
          by timer_console.PNG
          39 kB
        2. by timer.PNG
          by timer.PNG
          32 kB
        3. manually.PNG
          manually.PNG
          5 kB
        4. plugin_config.PNG
          plugin_config.PNG
          9 kB
        5. plugin version.PNG
          plugin version.PNG
          6 kB
        6. screenshot-1.png
          screenshot-1.png
          26 kB
        7. screenshot-2.png
          screenshot-2.png
          95 kB
        8. screenshot-3.png
          screenshot-3.png
          101 kB

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: klimas7
          Path:
          src/main/resources/net/uaznia/lukanus/hudson/plugins/gitparameter/GitParameterDefinition/index.jelly
          src/main/resources/net/uaznia/lukanus/hudson/plugins/gitparameter/javascript/git-parameter.js
          http://jenkins-ci.org/commit/git-parameter-plugin/e22af51f12d726cbbf26c3ccb297345dddd1dcf8
          Log:
          JENKINS-31939

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: klimas7 Path: src/main/resources/net/uaznia/lukanus/hudson/plugins/gitparameter/GitParameterDefinition/index.jelly src/main/resources/net/uaznia/lukanus/hudson/plugins/gitparameter/javascript/git-parameter.js http://jenkins-ci.org/commit/git-parameter-plugin/e22af51f12d726cbbf26c3ccb297345dddd1dcf8 Log: JENKINS-31939
          Hide
          slavik334 Viachaslau Kabak added a comment -

          tested
          it get the most top right value if job is started manually
          but gets wrong value if started by timer and GIT parameter has a filter set
          it ignores filter and gets top value

          Show
          slavik334 Viachaslau Kabak added a comment - tested it get the most top right value if job is started manually but gets wrong value if started by timer and GIT parameter has a filter set it ignores filter and gets top value
          Hide
          daldoyle Dan Doyle added a comment -

          We upgraded a few things and this unknowingly broke behavior in our build infrastructure. We were using a Branch selector in a few projects as an optional field to control later behavior, but now it is always set and there does not appear to be a way to deselect it when doing a manual build through the UI.

          It would be really nice if there was a setting to control this behavior. For now we have downgraded to 0.4.0 to fix our issue.

          Show
          daldoyle Dan Doyle added a comment - We upgraded a few things and this unknowingly broke behavior in our build infrastructure. We were using a Branch selector in a few projects as an optional field to control later behavior, but now it is always set and there does not appear to be a way to deselect it when doing a manual build through the UI. It would be really nice if there was a setting to control this behavior. For now we have downgraded to 0.4.0 to fix our issue.
          Hide
          klimas7 Boguslaw Klimas added a comment - - edited

          Hi,
          @Dan Doyle Viachaslau Kabak
          This change was not fully thought through, but in next release I will add configuration parameter
          "Selected value" which will have value: "none, top, default" (default will by 'none') and help description. "Which value is selected, after loaded parameters". I think this good resolving, do you agree with me?

          @Viachaslau Kabak
          Selecting values is realized in java script on browser. When you run job by timer plugin returned default value or blank when you not set default value, because Jenkins invoke method

          @Override
              public ParameterValue getDefaultParameterValue()
          
          Show
          klimas7 Boguslaw Klimas added a comment - - edited Hi, @ Dan Doyle Viachaslau Kabak This change was not fully thought through, but in next release I will add configuration parameter "Selected value" which will have value: "none, top, default" (default will by 'none') and help description. "Which value is selected, after loaded parameters". I think this good resolving, do you agree with me? @ Viachaslau Kabak Selecting values is realized in java script on browser. When you run job by timer plugin returned default value or blank when you not set default value, because Jenkins invoke method @Override public ParameterValue getDefaultParameterValue()
          Hide
          daldoyle Dan Doyle added a comment -

          That sounds good to me! Thanks for the quick response.

          Show
          daldoyle Dan Doyle added a comment - That sounds good to me! Thanks for the quick response.
          Hide
          smelchior Seb M added a comment -

          has this issue been fixed in the most recent version? We also rely on the fact that the selector is not selecting anything by default. I cannot find the parameter you mentioned anywhere.
          Thanks !

          Show
          smelchior Seb M added a comment - has this issue been fixed in the most recent version? We also rely on the fact that the selector is not selecting anything by default. I cannot find the parameter you mentioned anywhere. Thanks !
          Hide
          klimas7 Boguslaw Klimas added a comment -

          Hi Seb M,
          I have not had to enough time to add this change to courent release (0.6.0), but currently I created pull request for this (https://github.com/jenkinsci/git-parameter-plugin/pull/27).
          I think in Tuesday I merged this and I will deliver new versions (0.6.1)

          Regards
          Boguslaw

          Show
          klimas7 Boguslaw Klimas added a comment - Hi Seb M , I have not had to enough time to add this change to courent release (0.6.0), but currently I created pull request for this ( https://github.com/jenkinsci/git-parameter-plugin/pull/27 ). I think in Tuesday I merged this and I will deliver new versions (0.6.1) Regards Boguslaw
          Hide
          klimas7 Boguslaw Klimas added a comment -

          version 0.6.1

          Show
          klimas7 Boguslaw Klimas added a comment - version 0.6.1
          Hide
          slavik334 Viachaslau Kabak added a comment -

          Hi,
          it works on manual job start. The top value is selected.
          but if job started by schedule - it does not show the parameter in parameters
          jenkins version is 1.651.3

          Show
          slavik334 Viachaslau Kabak added a comment - Hi, it works on manual job start. The top value is selected. but if job started by schedule - it does not show the parameter in parameters jenkins version is 1.651.3
          Hide
          slavik334 Viachaslau Kabak added a comment -

          Hi I meant not plugin parameter but jenkins parameter
          if I use plugin and set name as GIT_TAG and start job by schedule - there is no this parameter in job parameters list

          Show
          slavik334 Viachaslau Kabak added a comment - Hi I meant not plugin parameter but jenkins parameter if I use plugin and set name as GIT_TAG and start job by schedule - there is no this parameter in job parameters list
          Hide
          klimas7 Boguslaw Klimas added a comment -

          Hi Viachaslau Kabak
          Can you look at this change https://github.com/jenkinsci/git-parameter-plugin/pull/29
          I think, this is it what you need Do you confirm?

          Show
          klimas7 Boguslaw Klimas added a comment - Hi Viachaslau Kabak Can you look at this change https://github.com/jenkinsci/git-parameter-plugin/pull/29 I think, this is it what you need Do you confirm?
          Hide
          slavik334 Viachaslau Kabak added a comment -

          hi,
          seems that yes
          but it does not work by schedule, only by manual job start(

          Show
          slavik334 Viachaslau Kabak added a comment - hi, seems that yes but it does not work by schedule, only by manual job start(
          Hide
          klimas7 Boguslaw Klimas added a comment -

          You checked this?
          After merged and released plugin
          When you set 'Default Value' empty and 'Selected Value' TOP by default plugin return top value when you run by schedule.

          Console log:

          Started by timer
          Building on master in workspace /var/lib/jenkins/jobs/Learn_github/workspace
           > git rev-parse --is-inside-work-tree # timeout=10
          Fetching changes from the remote Git repository
           > git config remote.origin.url https://github.com/klimas7/Learn.git # timeout=10
          Fetching upstream changes from https://github.com/klimas7/Learn.git
           > git --version # timeout=10
           > git -c core.askpass=true fetch --tags --progress https://github.com/klimas7/Learn.git +refs/heads/*:refs/remotes/origin/*
           > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
           > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
          Checking out Revision 9294d3fcc582801a506df9459d563a065ee0a915 (refs/remotes/origin/master)
           > git config core.sparsecheckout # timeout=10
           > git checkout -f 9294d3fcc582801a506df9459d563a065ee0a915
           > git rev-list 9294d3fcc582801a506df9459d563a065ee0a915 # timeout=10
          [workspace] $ /bin/sh -xe /tmp/hudson999147160500963325.sh
          + echo branch: Tag_1.0
          branch: Tag_1.0
          Finished: SUCCESS
          
          Show
          klimas7 Boguslaw Klimas added a comment - You checked this? After merged and released plugin When you set 'Default Value' empty and 'Selected Value' TOP by default plugin return top value when you run by schedule. Console log: Started by timer Building on master in workspace / var /lib/jenkins/jobs/Learn_github/workspace > git rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository > git config remote.origin.url https: //github.com/klimas7/Learn.git # timeout=10 Fetching upstream changes from https: //github.com/klimas7/Learn.git > git --version # timeout=10 > git -c core.askpass= true fetch --tags --progress https: //github.com/klimas7/Learn.git +refs/heads/*:refs/remotes/origin/* > git rev-parse refs/remotes/origin/master^{commit} # timeout=10 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10 Checking out Revision 9294d3fcc582801a506df9459d563a065ee0a915 (refs/remotes/origin/master) > git config core.sparsecheckout # timeout=10 > git checkout -f 9294d3fcc582801a506df9459d563a065ee0a915 > git rev-list 9294d3fcc582801a506df9459d563a065ee0a915 # timeout=10 [workspace] $ /bin/sh -xe /tmp/hudson999147160500963325.sh + echo branch: Tag_1.0 branch: Tag_1.0 Finished: SUCCESS
          Hide
          slavik334 Viachaslau Kabak added a comment -

          what jenkins version are you using?

          Show
          slavik334 Viachaslau Kabak added a comment - what jenkins version are you using?
          Hide
          klimas7 Boguslaw Klimas added a comment - - edited

          2.14 - according to me, this is independent of the version

          Show
          klimas7 Boguslaw Klimas added a comment - - edited 2.14 - according to me, this is independent of the version
          Hide
          klimas7 Boguslaw Klimas added a comment - - edited

          Do you check it on version 0.6.1 whether built a plugin from source (branch https://github.com/jenkinsci/git-parameter-plugin/tree/feature/JENKINS-31939)?

          Show
          klimas7 Boguslaw Klimas added a comment - - edited Do you check it on version 0.6.1 whether built a plugin from source (branch https://github.com/jenkinsci/git-parameter-plugin/tree/feature/JENKINS-31939)?
          Hide
          slavik334 Viachaslau Kabak added a comment -

          I have added my screenshots with plugin version and with 2 types of job run:
          1) by timer
          2) manually

          Show
          slavik334 Viachaslau Kabak added a comment - I have added my screenshots with plugin version and with 2 types of job run: 1) by timer 2) manually
          Hide
          klimas7 Boguslaw Klimas added a comment -

          It does not work from you because these changes have not yet been merged.
          I made only pull request, so you can see whether such a change is right for you. At version 0.6.1 will not work, as you want.
          If you want to use it you must wait to release 0.6.2 or compile plugin from source.

          Show
          klimas7 Boguslaw Klimas added a comment - It does not work from you because these changes have not yet been merged. I made only pull request, so you can see whether such a change is right for you. At version 0.6.1 will not work, as you want. If you want to use it you must wait to release 0.6.2 or compile plugin from source.
          Hide
          slavik334 Viachaslau Kabak added a comment -

          thanks)
          will wait for 0.6.2

          Show
          slavik334 Viachaslau Kabak added a comment - thanks) will wait for 0.6.2
          Hide
          klimas7 Boguslaw Klimas added a comment -

          release 0.6.2

          Show
          klimas7 Boguslaw Klimas added a comment - release 0.6.2

            People

            Assignee:
            klimas7 Boguslaw Klimas
            Reporter:
            slavik334 Viachaslau Kabak
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: