Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-12926

Wrong commits are checked out using Gatekeeper auto-merging

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not a bug
    • Low
    • None
    • 4.4.1
    • Plan Branches

    Description

      This problem is related to automatic branch management and git fetch/merge/commit.

      When a new commit is detected in a plan branch, Bamboo queues it for a build. What exactly remembered by Bamboo to checkout - branch name (as it is configured and supposed to be) or explicit commit in this branch?

      The problem is following (as illustrated on the attached image, timeline is up to down):

      • You have few branch plans configured as Gatekeepers for an integration branch (let's call it next).
      • Developer A pushes his changes into personal branch, Bamboo checkouts next (X), merges A's changes into it, and starts building it (X+A).
      • While it is building, Developer B does the same for his branch, and build B is queued.
      • After the plan A completes, Bamboo pushes updated integration branch (next) to Gitolite server (X+A to Y, fast forward).
      • Bamboo takes queued build B and checkouts integration branch (next) to do the same.

      The problem is that on that step Bamboo 4.4.0 checkouts not NEW state of the integration branch with just pushed changes (Y on the image to build Y+B), but that commit in the next which was last when the build B was queued (X). As result, it attempts to push back non fast-forward updates (X+B), and since they are disabled on Gitolite, the push fails. In fact, this makes impossible to use this feature because too many pushes fail if you have active committers.

      As I understand, it should checkout next by the branch name to its current state with just pushed updates, not an older commit (we configure branch by name, not a single commit). Then there will be no such problem since all commits into the integration branch will be fast-forward.

      In short, it should be:
      X+A -> Y (fast forward)
      Y+B -> Z (fast forward)
      And only Bamboo updates next branch, that guarantees FF only updates.

      Currently it is:
      X+A -> Y (fast forward)
      X+B -> Z (non fast forward, FAILS)
      X is chosen because it was last when B was detected and build queued. But we should merge with next branch (its HEAD), not with some commit in the past.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              f31f51273d0f Oleg Semyonov
              Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: