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

Error when trying to integrate to non-existing integration branch (Praqma case 13015)

      If you specify an integration branch that doesn't exist on the remote, the plugin fails, with the following error:

      Failed to commit merged changes. Error message below
       (nothing to squash)Already up-to-date.
      HEAD detached at xxxxxxx
      nothing to commit, working directory clean
      

      This is because it does a git checkout -B <integration_branch>
      If the specified integration branch doesn't have a matching branch on the remote, git checkout will happily create a new local branch pointing to the current HEAD without complaining. This is normal and expected git behaviour, but in this case has the obvious side-effect that the resulting merge is empty, as it will be merging from HEAD (the ready branch) to a new branch pointing to the same commit as HEAD.

      As it doesn't really make sense to integrate to a non-existing integration branch, situations like this should be considered configuration errors. The plugin should somehow check that the integration branch exists.

          [JENKINS-28370] Error when trying to integrate to non-existing integration branch (Praqma case 13015)

          Mads Nielsen created issue -
          Jan Krag made changes -
          Summary Original: Error when trying to push to integrate to non-existant integration branch New: Error when trying to integrate to non-existant integration branch
          Jan Krag made changes -
          Description Original: We need to check that the integration branch exists somehow. New: If you specify an integration branch that doesn't exist on the remote, the plugin fails, with the following error:

          {code}
          Failed to commit merged changes. Error message below
           (nothing to squash)Already up-to-date.
          HEAD detached at xxxxxxx
          nothing to commit, working directory clean
          {code}

          This is because it does a {{git checkout -B <integration_branch>}}
          If the specified integration branch doesn't have a matching branch on the remote, git checkout will happily create a new local branch pointing to the current HEAD without complaining. This is normal and expected git behaviour, but in this case has the obvious side-effect that the resulting merge is empty, as it will be merging from HEAD (the ready branch) to a new branch pointing to the same commit as HEAD.

          As it doesn't really make sense to integrate to a non-existing integration branch, situations like this should be considered configuration errors. The plugin should somehow check that the integration branch exists.
          Jan Krag made changes -
          Summary Original: Error when trying to integrate to non-existant integration branch New: Error when trying to integrate to non-existing integration branch Case 13015
          Bue Petersen made changes -
          Summary Original: Error when trying to integrate to non-existing integration branch Case 13015 New: Error when trying to integrate to non-existing integration branch (Praqma case 13015)
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 163208 ] New: JNJira + In-Review [ 181134 ]

            praqma Praqma Support
            madsnielsen Mads Nielsen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: