jenkinsci / jenkinsci/gitlab-plugin
Environment variables not expanded for build name in "Publish build status to Gitlab commit"
- Dominant language
- Java
- Stars
- 1.4k
- Forks
- 615
- Avg merge
- 4h 32m
- Merged PRs (30d)
- 10
Description
## Issue
### Context
- **Gitlab plugin version**: 1.4.3
- **Gitlab version**: 8.13.1
- **Jenkins version**: 2.30
### Problem description
The **Publish build status to Gitlab commit** post-build feature doesn't seem to be expanding environment variables correctly. In this case, I'm triggering a jenkins build using a java regex, and then parsing the string to get the Jenkins build name to trigger. I then use the [EnvInject](https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin) plugin to set the environment variable "TestTriggerName". This method works for the **Add note with build status on Gitlab merge request** post-build feature, where I define a custom message for success/fail/abort that includes the TestTriggerName variable. for the **Add note with build status on Gitlab merge request** feature, ${TestTriggerName} is correctly expanded and posted to gitlab; however in the **Publish build status to Gitlab commit** feature, the build name doesn't expand correctly. Listing the variable for the build name in jenkins:

produces the variable as literal on the gitlab side:

I would have expected the TestTriggerName variable to be expanded as the build note was in this case.
Contributor guide
Assessment
This issue has not been assessed yet.