jenkinsci / jenkinsci/gitlab-plugin
updateGitlabCommitStatus sometimes fails in end-to-end test
- Dominant language
- Java
- Stars
- 1.4k
- Forks
- 615
- Avg merge
- 4h 32m
- Merged PRs (30d)
- 10
Description
# Issue
We are running an end-to-end test at GitLab, testing the Jenkins integration with plugin and sometimes we see failures where the pipeline couldn't be found at GitLab (https://gitlab.com/gitlab-org/gitlab/issues/195179).
We tweaked the test to look into the job console and check for the message "Failed to update Gitlab commit status" (https://gitlab.com/gitlab-org/gitlab/-/blob/1338b3a3e47579eb4ff4574fbea306fdb7b12e65/qa/qa/vendor/jenkins/page/last_job_console.rb#L21) but we where also wondering if the build should fail if GitLab could not be notified?
It looks like [this line](https://github.com/jenkinsci/gitlab-plugin/blob/8ce9422a0e6d2e73f839af97bb1c6a9ba29a95c0/src/main/java/com/dabsquared/gitlabjenkins/util/CommitStatusUpdater.java#L84) should log another message to the console but I wasn't able to see it even if the status was updated successfully. Is this message expected to show up in the console? Maybe it doesn't show up because of https://github.com/jenkinsci/gitlab-plugin/issues/651
### Context
- **Gitlab plugin version**: 1.5.13
- **Gitlab version**: 12.9
- **Jenkins version**: 2.190.1
- **Job type**: Freestyle
### Logs & Traces
#### Successful build job console
```
Started by GitLab push by Administrator
Running as SYSTEM
Building in workspace /jenkins_home/workspace/project_with_jenkins_919fd5d8
No credentials specified
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url http://192.168.2.100:3000/gitlab-qa-sandbox-group/qa-test-2020-03-24-15-37-27-5ad1b63107a1a348/project_with_jenkins_919fd5d8-9779b63e4d76b537.git # timeout=10
Fetching upstream changes from http://192.168.2.100:3000/gitlab-qa-sandbox-group/qa-test-2020-03-24-15-37-27-5ad1b63107a1a348/project_with_jenkins_919fd5d8-9779b63e4d76b537.git
> git --version # timeout=10
> git fetch --tags --progress -- http://192.168.2.100:3000/gitlab-qa-sandbox-group/qa-test-2020-03-24-15-37-27-5ad1b63107a1a348/project_with_jenkins_919fd5d8-9779b63e4d76b537.git +refs/heads/*:refs/remotes/origin/*
skipping resolution of commit remotes/origin/master, since it originates from another repository
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision 653529be7685d0322c6d1788cbb2f1ec6fa4b6df (refs/remotes/origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f 653529be7685d0322c6d1788cbb2f1ec6fa4b6df
Commit message: "This is a test commit"
> git rev-list --no-walk 00d8fac75c49366be66dc5c2fc30ec06f8f1c261 # timeout=10
Finished: SUCCESS
```
#### Failed update commit status
```
Started by GitLab push by Administrator
Running as SYSTEM
Building in workspace /Users/andy/.jenkins/workspace/qa-1
No credentials specified
Cloning the remote Git repository
Cloning repository http://127.0.0.1:3000/root/jenkinstest.git
> git init /Users/andy/.jenkins/workspace/qa-1 # timeout=10
Fetching upstream changes from http://127.0.0.1:3000/root/jenkinstest.git
> git --version # timeout=10
> git fetch --tags --force --progress -- http://127.0.0.1:3000/root/jenkinstest.git +refs/heads/*:refs/remotes/origin/* # timeout=10
> git config remote.origin.url http://127.0.0.1:3000/root/jenkinstest.git # timeout=10
> git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
> git config remote.origin.url http://127.0.0.1:3000/root/jenkinstest.git # timeout=10
Fetching upstream changes from http://127.0.0.1:3000/root/jenkinstest.git
> git fetch --tags --force --progress -- http://127.0.0.1:3000/root/jenkinstest.git +refs/heads/*:refs/remotes/origin/* # timeout=10
skipping resolution of commit remotes/origin/master, since it originates from another repository
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision dc58823578cb03ee940a2cacf8c5799c17015472 (refs/remotes/origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f dc58823578cb03ee940a2cacf8c5799c17015472 # timeout=10
Commit message: "Add README.md"
First time build. Skipping changelog.
Failed to update Gitlab commit status for project '20': HTTP 500 Internal Server Error
Finished: SUCCESS
```
Contributor guide
Assessment
This issue has not been assessed yet.