Skip to content

Add missing `CI_COMMIT_BEFORE_SHA` predefined variable

What does this MR do?

This merge request adds a missing CI_COMMIT_BEFORE_SHA predefined variable.

This predefined variable has a very interesting story:

  1. It holds a previous commit that was present on a branch before a push request.
  2. This was broken for a some time, see https://gitlab.com/gitlab-org/gitlab-ce/issues/3210
  3. We fixed that in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/15805
  4. Someone removed this variable because it was broken (couldn't find a merge request)
  5. Contributor removed it from documentation because it was broken in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/2118
  6. We never removed CI_BUILD_BEFORE_SHA but CI_COMMIT_BEFORE_SHA was either removed, or we forgot to add it when we were renaming variables in 9.0
  7. Someone noticed that CI_COMMIT_BEFORE_SHA is missing
  8. I created this merge request to resolve this technical debt once and for all.

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes gitlab-org/gitlab-ce#43365

Edited by Grzegorz Bizon

Merge request reports