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]"

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Component/s: branch-api-plugin, pipeline
    • Labels:
      None
    • Environment:
      Jenkins 2.60.2
      Pipeline: Multibranch 2.16
    • Similar Issues:

      Description

      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 

       

        Attachments

          Activity

          Hide
          stephenconnolly Stephen Connolly added a comment -

          Sam Gleske 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

          Show
          stephenconnolly Stephen Connolly added a comment - Sam Gleske 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
          Hide
          godskalk Ø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!

          Show
          godskalk Ø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!
          Hide
          stephenconnolly Stephen Connolly added a comment -

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

          Show
          stephenconnolly Stephen Connolly added a comment - I'm going to mark https://github.com/jenkinsci/git-plugin/pull/545 as resolving this issue
          Hide
          scm_issue_link 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

          Show
          scm_issue_link 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
          Hide
          markewaite Mark Waite added a comment -

          Included in git plugin 3.6.1

          Show
          markewaite Mark Waite added a comment - Included in git plugin 3.6.1

            People

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

              Dates

              • Created:
                Updated:
                Resolved: