Skip to content

Frontend: Rename commit target branch to avoid confusion

Release notes

Problem to solve

The branch you're committing to in the pipeline editor is called "target branch". Let's say you're committing to a branch new-feature. It would be considered the source branch, and main would actually be considered the target branch.

image

Further details

Click to expand

The following discussion from !79032 (merged) should be addressed:

  • @zcuddy started a discussion: (+1 comment)

    nitpick (super-non-blocking): We could utilize the same variable name sourceBranch rather than renaming it to commitBranch to take advantage of the shorthand. This is more of a style preference, I just noticed since we were reassigning the value twice.

    const sourceBranch = targetBranch;
    const params = openMergeRequest
      ? {
          type: COMMIT_SUCCESS_WITH_REDIRECT,
          params: {
            sourceBranch,
            targetBranch: this.currentBranch,
          },
        }
      : { type: COMMIT_SUCCESS };

The source branch of the MR is the target branch of the commit, and the target branch of the MR is the current branch the user is on. This is very confusing and should be changed in the UI and in the code

Proposal

Rename the "target branch" in the pipeline editor commit form to just "branch" to avoid confusion.

Intended users

Metrics

N/A

This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.

Edited by Nadia Sotnikova