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

Change UI for Advanced Clone Behaviours so that "Do not fetch tags [ ]" becomes "fetch tags [x]"

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • branch-api-plugin, pipeline
    • None
    • Jenkins 2.60.2
      Pipeline: Multibranch 2.16

      New description

      People get very confused when presented with an option that is described in a Negative. As a result, when people see "Do not fetch tags [ ]" it is very easy to get confused and fail to conclude that this is means "Fetch tags [x]"

      Consequently, people get confused as to how to fetch tags with Git Branch Source.

      We should remove configuration options that present in a negative description. This issue will rename "Do not fetch tags" to "Fetch tags". The default will still have the same semantic value, i.e. if you add Advanced Clone Behaviours and change nothing, tags will be fetched, but it will make this more obvious to users.

      Original description

      The default behavior changed so that pipelines for all branches no longer fetch tags by default and there's no option to turn this back on. I just need to add an Advanced Clone Behaviours with Do not fetch tags deselected to turn fetching them back on:

      Remainder of original description:

      Our pipeline relies on the tags being there when it starts.

      Expected:

      [Pipeline]
      [Pipeline] stage 
      [Pipeline] { (Declarative: Checkout SCM) 
      [Pipeline] checkout 
      Cloning the remote Git repository 
      Cloning repository git@github.com:... 
       > git init /var/lib/jenkins/workspace/... # timeout=10 
      Fetching upstream changes from git@github.com:... 
       > git --version # timeout=10 
      using GIT_ASKPASS to set credentials GitHub Source 
       > git fetch --tags --progress git@github.com:... +refs/heads/:refs/remotes/origin/** 
       > git config remote.origin.url git@github.com:... # timeout=10 
       > git config --add remote.origin.fetch +refs/heads/:refs/remotes/origin/ # timeout=10 
       > git config remote.origin.url git@github.com:... # timeout=10 
      Fetching upstream changes from git@github.com:... 
      using GIT_ASKPASS to set credentials GitHub Source 
       > git fetch --tags --progress git@github.com:... +refs/heads/:refs/remotes/origin/** 
      Checking out Revision 84cfb2d926a9304aa81e20ca60418d5c94313c5e (new-branch) 
       > git config core.sparsecheckout # timeout=10 
       > git checkout -f 84cfb2d926a9304aa81e20ca60418d5c94313c5e

      Actual: 

      [Pipeline]
      [Pipeline] stage 
      [Pipeline] { (Declarative: Checkout SCM) 
      [Pipeline] checkout 
      Cloning the remote Git repository 
      Cloning with configured refspecs honoured and without tags 
      Cloning repository git@github.com:... 
       > git init /var/lib/jenkins/workspace/... # timeout=10 
      Fetching upstream changes from git@github.com:... 
       > git --version # timeout=10 
      using GIT_ASKPASS to set credentials GitHub Source 
       > git fetch --no-tags --progress git@github.com:... +refs/heads/:refs/remotes/origin/** 
       > git config remote.origin.url git@github.com:... # timeout=10 
       > git config --add remote.origin.fetch +refs/heads/:refs/remotes/origin/ # timeout=10 
       > git config remote.origin.url git@github.com:... # timeout=10 
      Fetching without tags 
      Fetching upstream changes from git@github.com:... 
      using GIT_ASKPASS to set credentials GitHub Source 
       > git fetch --no-tags --progress git@github.com:... +refs/heads/:refs/remotes/origin/** 
      Checking out Revision 84cfb2d926a9304aa81e20ca60418d5c94313c5e (new-branch) 
      Commit message: "Something" 
       > git config core.sparsecheckout # timeout=10 
       > git checkout -f 84cfb2d926a9304aa81e20ca60418d5c94313c5e 

       

          [JENKINS-45822] Change UI for Advanced Clone Behaviours so that "Do not fetch tags [ ]" becomes "fetch tags [x]"

          So we will have to activate the "Advanced Clone Behaviours" on every jobs we have ?

          I think this is a regression, because the default behavior changed.

          Antoine Leveugle added a comment - So we will have to activate the "Advanced Clone Behaviours" on every jobs we have ? I think this is a regression, because the default behavior changed.

          denouche agreed.

          Omer van Kloeten added a comment - denouche agreed.

          denouche agreed as well

          Antoine Le Maire added a comment - denouche agreed as well

          This is a "needs of the many outweigh the needs of the few" change.

          The majority of users do not need the tag refs or any branch refs other than the branch being checked out. There are two solutions:

          • Make the majority of users turn a switch on to support the minority who do need tag refs or other branch refs
          • Make the minority of users turn a switch on to support the minority who do need tag refs or other branch refs

          Now I am not saying those in the minority are wrong, there are legitimate and valid reasons why you may need tags or other refspecs in your checkout, but forcing the majority to have longer checkouts in order to support the minority requirements is not a good plan.

          For that reason the advertised change in git 3.4.0 altered the behaviour.

          If you want to call it a regression, that's fine... it's still not going to be changed... better to call it a "breaking change for a minority of users".

          If you want to complain about being unintuitive... I'm with you, I argued for refactoring the "Advanced Clone Behaviours" extension (which comes from the side of the git plugin that I am not responsible for) but there was too much fear at the time of changing that... better to have a separate JIRA specifically to make the "Advanced Clone Behaviours" more intuitive... I will support that.

          But this issue is closed. Functions as designed.

          Stephen Connolly added a comment - This is a "needs of the many outweigh the needs of the few" change. The majority of users do not need the tag refs or any branch refs other than the branch being checked out. There are two solutions: Make the majority of users turn a switch on to support the minority who do need tag refs or other branch refs Make the minority of users turn a switch on to support the minority who do need tag refs or other branch refs Now I am not saying those in the minority are wrong, there are legitimate and valid reasons why you may need tags or other refspecs in your checkout, but forcing the majority to have longer checkouts in order to support the minority requirements is not a good plan. For that reason the advertised change in git 3.4.0 altered the behaviour. If you want to call it a regression, that's fine... it's still not going to be changed... better to call it a "breaking change for a minority of users". If you want to complain about being unintuitive... I'm with you, I argued for refactoring the "Advanced Clone Behaviours" extension (which comes from the side of the git plugin that I am not responsible for) but there was too much fear at the time of changing that... better to have a separate JIRA specifically to make the "Advanced Clone Behaviours" more intuitive... I will support that. But this issue is closed. Functions as designed.

          Sam Gleske added a comment -

          Another option is to add a refspec with:

          +refs/tags/*:refs/tags/*
          

          Sam Gleske added a comment - Another option is to add a refspec with: +refs/tags/*:refs/tags/*

          sag47 that will still have git fetch -no-tags to get rid of that you need advanced clone behaviours (though it would seem reasonable to suppress the -no-tags if there is the refspec to fetch tags

          Stephen Connolly added a comment - sag47 that will still have git fetch - no-tags to get rid of that you need advanced clone behaviours (though it would seem reasonable to suppress the -no-tags if there is the refspec to fetch tags

          Øyvind R added a comment - - edited

          Ok, so the behaviour is as as expected, but there is still a defect here:

          If fetching tags is off by default then the checkbox for "Do not fetch tags" should be checked by default when you open the advanced clone behaviours settings!

          The fact that this was not checked when I opened the setting made me assume something else was the matter, which made me search the web, which made me come here. It does not make sense that the settings change simply because you open the settings.

          Edit: Sorry for reopening the issue, I didn't know I was even allowed to do that!

          Øyvind R added a comment - - edited Ok, so the behaviour is as as expected, but there is still a defect here: If fetching tags is off by default then the checkbox for "Do not fetch tags" should be checked by default when you open the advanced clone behaviours settings! The fact that this was not checked when I opened the setting made me assume something else was the matter, which made me search the web, which made me come here. It does not make sense that the settings change simply because you open the settings. Edit: Sorry for reopening the issue, I didn't know I was even allowed to do that!

          I'm going to mark https://github.com/jenkinsci/git-plugin/pull/545 as resolving this issue

          Stephen Connolly added a comment - I'm going to mark https://github.com/jenkinsci/git-plugin/pull/545 as resolving this issue

          Code changed in jenkins
          User: Mark Waite
          Path:
          src/main/resources/hudson/plugins/git/extensions/impl/CloneOption/config.groovy
          src/main/resources/hudson/plugins/git/extensions/impl/CloneOption/help-noTags.html
          http://jenkins-ci.org/commit/git-plugin/0bd775152251c2b06eb23ce81de9853a6931c0b2
          Log:
          Merge pull request #545 from stephenc/no-double-negative-config

          [FIXED JENKINS-45822] Swap semantics of 'Do not fetch tags' to 'Fetch tags'

          Compare: https://github.com/jenkinsci/git-plugin/compare/d4703a462ef6...0bd775152251

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Mark Waite Path: src/main/resources/hudson/plugins/git/extensions/impl/CloneOption/config.groovy src/main/resources/hudson/plugins/git/extensions/impl/CloneOption/help-noTags.html http://jenkins-ci.org/commit/git-plugin/0bd775152251c2b06eb23ce81de9853a6931c0b2 Log: Merge pull request #545 from stephenc/no-double-negative-config [FIXED JENKINS-45822] Swap semantics of 'Do not fetch tags' to 'Fetch tags' Compare: https://github.com/jenkinsci/git-plugin/compare/d4703a462ef6...0bd775152251

          Mark Waite added a comment -

          Included in git plugin 3.6.1

          Mark Waite added a comment - Included in git plugin 3.6.1

            stephenconnolly Stephen Connolly
            omervk Omer van Kloeten
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: