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

Setting the strategy for discovery to "Merging the PR with the current target branch revision" with git-lfs sources fails.

      With git-lfs sources, when a multipipeline job is triggered by a PR, it attempts to merge git-lfs files even though they are unchanged, and the PR build fails.  The lfs files in question are .png, and are never modified. 

      The only workaround has been to set the job to build only the current pull request revision, which means that the PR will not be built against any valid changes made to the main branch while the PR is in development. That's not ideal.

          [JENKINS-68344] Setting the strategy for discovery to "Merging the PR with the current target branch revision" with git-lfs sources fails.

          Mark Waite added a comment - - edited

          Please provide either the config.xml file that defines the multibranch Pipeline job or a precise description of the job definition. There are many different ways to define a multibranch Pipeline, with Git, with GitHub, with Bitbucket, with Gitea, with modern SCM, with classic SCM, etc. I'm pretty sure that I'm using a multibranch Pipeline job with git lfs and not seeing an issue.

          Mark Waite added a comment - - edited Please provide either the config.xml file that defines the multibranch Pipeline job or a precise description of the job definition. There are many different ways to define a multibranch Pipeline, with Git, with GitHub, with Bitbucket, with Gitea, with modern SCM, with classic SCM, etc. I'm pretty sure that I'm using a multibranch Pipeline job with git lfs and not seeing an issue.

          Susan Feldman added a comment - - edited

          This is enterprise github. 

          The config (slightly redacted) as it was (where the behaviors were set to what we've been using in our non-git-lfs jobs) is below, but this is how the jobs were configured:

          Discover branches: Exclude branches that are also filed as PRs:
          Discover pull requests from origin: Merging the pull request with the current target branch revision.
          Forks aren't pertinent in our SCM scheme.

          To get the pull requests to build at all where git-lfs sources were involved, I needed to set the last one (discover pull requests from origin) as "The current pull request revision".

              • The xml below ***

          This XML file does not appear to have any style information associated with it. The document tree is shown below.
          <org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject plugin="workflow-multibranch@2.26">
          <actions/>
          <description>xxxxxxx</description>
          <properties>
          <org.jenkinsci.plugins.docker.workflow.declarative.FolderConfig plugin="docker-workflow@1.26">
          <dockerLabel/>
          <registry plugin="docker-commons@1.17"/>
          </org.jenkinsci.plugins.docker.workflow.declarative.FolderConfig>
          <com.cloudbees.hudson.plugins.folder.properties.EnvVarsFolderProperty plugin="cloudbees-folders-plus@3.25">
          <properties>SKIPMAC=1 SKIPCENTOS=1 </properties>
          </com.cloudbees.hudson.plugins.folder.properties.EnvVarsFolderProperty>
          <org.jenkinsci.plugins.configfiles.folder.FolderConfigFileProperty plugin="config-file-provider@3.8.1">
          <configs class="sorted-set">
          <comparator class="org.jenkinsci.plugins.configfiles.ConfigByIdComparator"/>
          </configs>
          </org.jenkinsci.plugins.configfiles.folder.FolderConfigFileProperty>
          </properties>
          <folderViews class="jenkins.branch.MultiBranchProjectViewHolder" plugin="branch-api@2.7.0">
          <owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../.."/>
          </folderViews>
          <healthMetrics/>
          <icon class="jenkins.branch.MetadataActionFolderIcon" plugin="branch-api@2.7.0">
          <owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../.."/>
          </icon>
          <orphanedItemStrategy class="com.cloudbees.hudson.plugins.folder.computed.DefaultOrphanedItemStrategy" plugin="cloudbees-folder@6.16">
          <pruneDeadBranches>true</pruneDeadBranches>
          <daysToKeep>-1</daysToKeep>
          <numToKeep>-1</numToKeep>
          </orphanedItemStrategy>
          <triggers/>
          <disabled>false</disabled>
          <sources class="jenkins.branch.MultiBranchProject$BranchSourceList" plugin="branch-api@2.7.0">
          <data>
          <jenkins.branch.BranchSource>
          <source class="org.jenkinsci.plugins.github_branch_source.GitHubSCMSource" plugin="github-branch-source@2.11.3">
          <id>xxxxxxxxxx</id>
          <apiUri>https://github.xxx.com/api/v3</apiUri>
          <credentialsId>xxxxxxx</credentialsId>
          <repoOwner>xxxxxxx</repoOwner>
          <repository>xxxxxxx</repository>
          <repositoryUrl>https://github.xxx.com/xxxxxxx/xxxxxx.git</repositoryUrl>
          <traits>
          <org.jenkinsci.plugins.github_branch_source.BranchDiscoveryTrait>
          <strategyId>1</strategyId>
          </org.jenkinsci.plugins.github_branch_source.BranchDiscoveryTrait>
          <org.jenkinsci.plugins.github_branch_source.OriginPullRequestDiscoveryTrait>
          <strategyId>2</strategyId>
          </org.jenkinsci.plugins.github_branch_source.OriginPullRequestDiscoveryTrait>
          <org.jenkinsci.plugins.github_branch_source.ForkPullRequestDiscoveryTrait>
          <strategyId>2</strategyId>
          <trust class="org.jenkinsci.plugins.github_branch_source.ForkPullRequestDiscoveryTrait$TrustPermission"/>
          </org.jenkinsci.plugins.github_branch_source.ForkPullRequestDiscoveryTrait>
          <jenkins.plugins.git.traits.CleanBeforeCheckoutTrait plugin="git@4.9.0">
          <extension class="hudson.plugins.git.extensions.impl.CleanBeforeCheckout">
          <deleteUntrackedNestedRepositories>true</deleteUntrackedNestedRepositories>
          </extension>
          </jenkins.plugins.git.traits.CleanBeforeCheckoutTrait>
          <jenkins.plugins.git.traits.GitLFSPullTrait plugin="git@4.9.0">
          <extension class="hudson.plugins.git.extensions.impl.GitLFSPull"/>
          </jenkins.plugins.git.traits.GitLFSPullTrait>
          </traits>
          </source>
          <strategy class="jenkins.branch.DefaultBranchPropertyStrategy">
          <properties class="java.util.Arrays$ArrayList">
          <a class="jenkins.branch.BranchProperty-array">
          <com.adobe.jenkins.github_prcomment_build.TriggerPRCommentBranchProperty plugin="github-pr-comment-build@61.v49f749d31d98">
          <commentBody>!verify</commentBody>
          </com.adobe.jenkins.github_prcomment_build.TriggerPRCommentBranchProperty>
          <com.adobe.jenkins.github_prcomment_build.TriggerPRUpdateBranchProperty plugin="github-pr-comment-build@61.v49f749d31d98"/>
          </a>
          </properties>
          </strategy>
          </jenkins.branch.BranchSource>
          </data>
          <owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../.."/>
          </sources>
          <factory class="org.jenkinsci.plugins.workflow.multibranch.WorkflowBranchProjectFactory">
          <owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../.."/>
          <scriptPath>build/jenkins/pipeline/jenkinsfile</scriptPath>
          </factory>
          </org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject>
           
           

          Susan Feldman added a comment - - edited This is enterprise github.  The config (slightly redacted) as it was (where the behaviors were set to what we've been using in our non-git-lfs jobs) is below, but this is how the jobs were configured: Discover branches: Exclude branches that are also filed as PRs: Discover pull requests from origin: Merging the pull request with the current target branch revision. Forks aren't pertinent in our SCM scheme. To get the pull requests to build at all where git-lfs sources were involved, I needed to set the last one (discover pull requests from origin) as "The current pull request revision". The xml below *** This XML file does not appear to have any style information associated with it. The document tree is shown below. <org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject plugin="workflow-multibranch@2.26"> <actions/> <description>xxxxxxx</description> <properties> <org.jenkinsci.plugins.docker.workflow.declarative.FolderConfig plugin="docker-workflow@1.26"> <dockerLabel/> <registry plugin="docker-commons@1.17"/> </org.jenkinsci.plugins.docker.workflow.declarative.FolderConfig> <com.cloudbees.hudson.plugins.folder.properties.EnvVarsFolderProperty plugin="cloudbees-folders-plus@3.25"> <properties>SKIPMAC=1 SKIPCENTOS=1 </properties> </com.cloudbees.hudson.plugins.folder.properties.EnvVarsFolderProperty> <org.jenkinsci.plugins.configfiles.folder.FolderConfigFileProperty plugin="config-file-provider@3.8.1"> <configs class="sorted-set"> <comparator class="org.jenkinsci.plugins.configfiles.ConfigByIdComparator"/> </configs> </org.jenkinsci.plugins.configfiles.folder.FolderConfigFileProperty> </properties> <folderViews class="jenkins.branch.MultiBranchProjectViewHolder" plugin="branch-api@2.7.0"> <owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../.."/> </folderViews> <healthMetrics/> <icon class="jenkins.branch.MetadataActionFolderIcon" plugin="branch-api@2.7.0"> <owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../.."/> </icon> <orphanedItemStrategy class="com.cloudbees.hudson.plugins.folder.computed.DefaultOrphanedItemStrategy" plugin="cloudbees-folder@6.16"> <pruneDeadBranches>true</pruneDeadBranches> <daysToKeep>-1</daysToKeep> <numToKeep>-1</numToKeep> </orphanedItemStrategy> <triggers/> <disabled>false</disabled> <sources class="jenkins.branch.MultiBranchProject$BranchSourceList" plugin="branch-api@2.7.0"> <data> <jenkins.branch.BranchSource> <source class="org.jenkinsci.plugins.github_branch_source.GitHubSCMSource" plugin="github-branch-source@2.11.3"> <id>xxxxxxxxxx</id> <apiUri> https://github.xxx.com/api/v3 </apiUri> <credentialsId>xxxxxxx</credentialsId> <repoOwner>xxxxxxx</repoOwner> <repository>xxxxxxx</repository> <repositoryUrl> https://github.xxx.com/xxxxxxx/xxxxxx.git </repositoryUrl> <traits> <org.jenkinsci.plugins.github_ branch _source.BranchDiscoveryTrait> <strategyId>1</strategyId> </org.jenkinsci.plugins.github_ branch _source.BranchDiscoveryTrait> <org.jenkinsci.plugins.github_ branch _source.OriginPullRequestDiscoveryTrait> <strategyId>2</strategyId> </org.jenkinsci.plugins.github_ branch _source.OriginPullRequestDiscoveryTrait> <org.jenkinsci.plugins.github_ branch _source.ForkPullRequestDiscoveryTrait> <strategyId>2</strategyId> <trust class="org.jenkinsci.plugins.github_branch_source.ForkPullRequestDiscoveryTrait$TrustPermission"/> </org.jenkinsci.plugins.github_ branch _source.ForkPullRequestDiscoveryTrait> <jenkins.plugins.git.traits.CleanBeforeCheckoutTrait plugin="git@4.9.0"> <extension class="hudson.plugins.git.extensions.impl.CleanBeforeCheckout"> <deleteUntrackedNestedRepositories>true</deleteUntrackedNestedRepositories> </extension> </jenkins.plugins.git.traits.CleanBeforeCheckoutTrait> <jenkins.plugins.git.traits.GitLFSPullTrait plugin="git@4.9.0"> <extension class="hudson.plugins.git.extensions.impl.GitLFSPull"/> </jenkins.plugins.git.traits.GitLFSPullTrait> </traits> </source> <strategy class="jenkins.branch.DefaultBranchPropertyStrategy"> <properties class="java.util.Arrays$ArrayList"> <a class="jenkins.branch.BranchProperty-array"> <com.adobe.jenkins.github_ pr comment _build.TriggerPRCommentBranchProperty plugin="github-pr-comment-build@61.v49f749d31d98"> <commentBody>!verify</commentBody> </com.adobe.jenkins.github_ pr comment _build.TriggerPRCommentBranchProperty> <com.adobe.jenkins.github_ pr comment _build.TriggerPRUpdateBranchProperty plugin="github-pr-comment-build@61.v49f749d31d98"/> </a> </properties> </strategy> </jenkins.branch.BranchSource> </data> <owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../.."/> </sources> <factory class="org.jenkinsci.plugins.workflow.multibranch.WorkflowBranchProjectFactory"> <owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../.."/> <scriptPath>build/jenkins/pipeline/jenkinsfile</scriptPath> </factory> </org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject>    

            Unassigned Unassigned
            sefeldman Susan Feldman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: