Docs feedback: CI_COMMIT_DESCRIPTION not populated in pipelines for merge request

Problem to solve

  • What product or feature(s) affected? Pipelines for Merge Request
  • What docs or doc section affected? Predefined environment variables reference
  • Is there a problem with a specific document, or a feature/process that's not addressed sufficiently in docs? The definition for CI_COMMIT_DESCRIPTION is "The description of the commit: the message without first line, if the title is shorter than 100 characters; full message in other case."

In pipelines for merge request when I log Gitlab predefined environment variables in a pipeline level before_script the output shows both CI_COMMIT_MESSAGE and CI_COMMIT_TITLE are populated but CI_COMMIT_DESCRIPTION is not set.

Commit b4f9998c message:

cicd-pipeline-build-bump-version

pipeline 14921743 output:

Successfully extracted cache
Executing "step_script" stage of the job script
03:59
$ touch build.env
$ echo "CI_COMMIT_BRANCH - $CI_COMMIT_BRANCH"
CI_COMMIT_BRANCH - 
$ echo "CI_COMMIT_DESCRIPTION - $CI_COMMIT_DESCRIPTION"
CI_COMMIT_DESCRIPTION - 
$ echo "CI_COMMIT_MESSAGE - $CI_COMMIT_MESSAGE"
CI_COMMIT_MESSAGE - cicd-pipeline-build-bump-version
$ echo "CI_COMMIT_REF_NAME - $CI_COMMIT_REF_NAME"
CI_COMMIT_REF_NAME - master
$ echo "CI_COMMIT_TAG - $CI_COMMIT_TAG"
CI_COMMIT_TAG - 
$ echo "CI_COMMIT_TITLE - $CI_COMMIT_TITLE"
CI_COMMIT_TITLE - cicd-pipeline-build-bump-version
$ echo "CI_MERGE_REQUEST_EVENT_TYPE - $CI_MERGE_REQUEST_EVENT_TYPE"
CI_MERGE_REQUEST_EVENT_TYPE - detached
$ echo "CI_MERGE_REQUEST_ID - $CI_MERGE_REQUEST_ID"
CI_MERGE_REQUEST_ID - 75876836
$ echo "CI_PROJECT_ID - $CI_PROJECT_ID"
CI_PROJECT_ID - 17935275
$ echo "CI_PROJECT_NAME - $CI_PROJECT_NAME"
CI_PROJECT_NAME - docker
$ echo "CI_PIPELINE_SOURCE - $CI_PIPELINE_SOURCE"
CI_PIPELINE_SOURCE - merge_request_event

In branch push event pipelines when I log Gitlab predefined environment variables in a pipeline level before_script the output shows CI_COMMIT_DESCRIPTION, CI_COMMIT_MESSAGE and CI_COMMIT_TITLE are all populated.

Commit f248968a message:

git subrepo pull (merge) bash-utils
subrepo:
  subdir:   "bash-utils"
  merged:   "b73a931"
upstream:
  origin:   "git@gitlab.com:hill-country-machine-learning.ai/prod/bash/bash-utils.git"
  branch:   "master"
  commit:   "227f827"
git-subrepo:
  version:  "0.4.1"
  origin:   "git@github.com:ingydotnet/git-subrepo.git"
  commit:   "a04d8c2"

pipeline 14934008 output:

Successfully extracted cache
Executing "step_script" stage of the job script
04:08
$ touch build.env
$ echo "CI_COMMIT_BRANCH - $CI_COMMIT_BRANCH"
CI_COMMIT_BRANCH - master
$ echo "CI_COMMIT_DESCRIPTION - $CI_COMMIT_DESCRIPTION"
CI_COMMIT_DESCRIPTION - 
git subrepo pull bash-utils
See merge request hill-country-machine-learning.ai/prod/docker/docker!22
$ echo "CI_COMMIT_MESSAGE - $CI_COMMIT_MESSAGE"
CI_COMMIT_MESSAGE - Merge branch 'master' into 'master'
git subrepo pull bash-utils
See merge request hill-country-machine-learning.ai/prod/docker/docker!22
$ echo "CI_COMMIT_REF_NAME - $CI_COMMIT_REF_NAME"
CI_COMMIT_REF_NAME - master
$ echo "CI_COMMIT_TAG - $CI_COMMIT_TAG"
CI_COMMIT_TAG - 
$ echo "CI_COMMIT_TITLE - $CI_COMMIT_TITLE"
CI_COMMIT_TITLE - Merge branch 'master' into 'master'
$ echo "CI_MERGE_REQUEST_EVENT_TYPE - $CI_MERGE_REQUEST_EVENT_TYPE"
CI_MERGE_REQUEST_EVENT_TYPE - 
$ echo "CI_MERGE_REQUEST_ID - $CI_MERGE_REQUEST_ID"
CI_MERGE_REQUEST_ID - 
$ echo "CI_PROJECT_ID - $CI_PROJECT_ID"
CI_PROJECT_ID - 17935275
$ echo "CI_PROJECT_NAME - $CI_PROJECT_NAME"
CI_PROJECT_NAME - docker
$ echo "CI_PIPELINE_SOURCE - $CI_PIPELINE_SOURCE"
CI_PIPELINE_SOURCE - push
  • Any other ideas or requests? Does the commit message need to be in a specific format in order for CI_COMMIT_DESCRIPTION to be parsed?

Further details

This issue is not blocking me. I created this issue to help improve the documentation and because I want to understand if there are specific pipelines or conditions when CI_COMMIT_DESCRIPTION is not populated or if I need to structure commit messages in a specific format for idempotent results.

Proposal

Add details to CI_COMMIT_DESCRIPTION detailing when the value is not populated.

Who can address the issue

Gitlab documentation experts.

Other links/references