Elasticsearch Indexer messes with messages of signed commits

Summary

The commit messages of signed commits are not indexed correctly or consistently.

Steps to reproduce

Push a signed commit. Check the elastic search index for this commit.

What is the current bug behavior?

The commit.message field in Elastic search now contains most but not all of the PGP signature and the actual message.

What is the expected correct behavior?

Either the commit.message fields shall contain the complete signature or (maybe even better) no signature at all and just the commit message.

Relevant logs and/or screenshots

Output of git show --pretty=raw:

commit 189812aac2cab272cd3867fed5a1ced65be9dc4e
tree fa7c0d725fa399289fd41541ca0e762582ba6de5
parent a7659abfd3aa1f000bd2b98091d154fbe3916cbb
author John Doe <john@example.com> 1550147511 +0100
committer John Doe <john@example.com> 1550147511 +0100
gpgsig -----BEGIN PGP SIGNATURE-----
 
 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 [...]
 -----END PGP SIGNATURE-----

    My commit message!

Content of commit.message field:

"message": " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n [...]\n -----END PGP SIGNATURE-----\n\nMy commit message!\n"

Output of checks

(If you are reporting a bug on GitLab.com, write: This bug happens on GitLab.com)

Results of GitLab environment info

Expand for output related to GitLab environment info
System information
System:		Debian 9.7
Proxy:		no
Current User:	git
Using RVM:	no
Ruby Version:	2.5.3p105
Gem Version:	2.7.6
Bundler Version:1.16.6
Rake Version:	12.3.2
Redis Version:	3.2.12
Git Version:	2.18.1
Sidekiq Version:5.2.3
Go Version:	unknown

GitLab information Version: 11.7.0-ee Revision: c02f0d4 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql DB Version: 9.6.11 URL: https://git.example.com HTTP Clone URL: https://git.example.com/some-group/some-project.git SSH Clone URL: git@git.example.com:some-group/some-project.git Elasticsearch: yes Geo: no Using LDAP: yes Using Omniauth: yes Omniauth Providers:

GitLab Shell Version: 8.4.4 Repository storage paths:

  • default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git

Results of GitLab application Check

Expand for output related to the GitLab application check
Assignee Loading
Time tracking Loading