gitlab-plugin icon indicating copy to clipboard operation
gitlab-plugin copied to clipboard

`gitlabBuilds` not sending pending status to GitLab

Open geraintwhite opened this issue 5 years ago • 6 comments

Context

  • Gitlab plugin version: 1.5.13
  • Gitlab version: 12.6.3
  • Jenkins version: 2.204.2
  • Job type: Multibranch pipeline

Jenkinsfile

#!groovy

properties([
    disableConcurrentBuilds(),
    gitLabConnection('xxxxxx'),
    buildDiscarder(logRotator(artifactNumToKeepStr: '1'))
])

gitlabBuilds(builds: ['Configure', 'Test', 'Package', 'Deploy', 'Report']) {
  node('xxxxxx') {
    catchError {
      stage('Configure') {
        gitlabCommitStatus('Configure') {
          ...
        }
      }

      stage('Test') {
        gitlabCommitStatus('Test') {
          ...
        }
      }

      stage('Package') {
        gitlabCommitStatus('Package') {
          ...
        }
      }

      stage('Deploy') {
        gitlabCommitStatus('Deploy') {
          ...
        }
      }

      stage('Report') {
        gitlabCommitStatus('Report') {
          ...
        }
      }
    }

    step([
      $class: 'Mailer',
      notifyEveryUnstableBuild: true,
      recipients: emailextrecipients([[$class: 'CulpritsRecipientProvider']])
    ])
  }
}

Problem description

Using the gitlabBuilds property does not set the state of the stages on GitLab to pending as per this section in the README.

The first time GitLab gets informed of the build is the first gitlabCommitStatus (the 'Configure' stage in the Jenkinsfile above).

geraintwhite avatar Feb 25 '20 16:02 geraintwhite

Jenkins logs:

Feb 25, 2020 4:52:03 PM INFO com.dabsquared.gitlabjenkins.util.CommitStatusUpdater retrieveGitlabProjectIds
Retrieving gitlab project ids
Feb 25, 2020 4:52:03 PM INFO com.dabsquared.gitlabjenkins.util.CommitStatusUpdater retrieveGitlabProjectIds
Build does not contain build data.
Feb 25, 2020 4:52:03 PM INFO com.dabsquared.gitlabjenkins.util.CommitStatusUpdater retrieveGitlabProjectIds
Retrieving gitlab project ids
Feb 25, 2020 4:52:03 PM INFO com.dabsquared.gitlabjenkins.util.CommitStatusUpdater retrieveGitlabProjectIds
Build does not contain build data.
Feb 25, 2020 4:52:03 PM INFO com.dabsquared.gitlabjenkins.util.CommitStatusUpdater retrieveGitlabProjectIds
Retrieving gitlab project ids
Feb 25, 2020 4:52:03 PM INFO com.dabsquared.gitlabjenkins.util.CommitStatusUpdater retrieveGitlabProjectIds
Build does not contain build data.
Feb 25, 2020 4:52:03 PM INFO com.dabsquared.gitlabjenkins.util.CommitStatusUpdater retrieveGitlabProjectIds
Retrieving gitlab project ids
Feb 25, 2020 4:52:03 PM INFO com.dabsquared.gitlabjenkins.util.CommitStatusUpdater retrieveGitlabProjectIds
Build does not contain build data.
Feb 25, 2020 4:52:03 PM INFO com.dabsquared.gitlabjenkins.util.CommitStatusUpdater retrieveGitlabProjectIds
Retrieving gitlab project ids
Feb 25, 2020 4:52:03 PM INFO com.dabsquared.gitlabjenkins.util.CommitStatusUpdater retrieveGitlabProjectIds
Build does not contain build data.
Feb 25, 2020 4:52:39 PM INFO com.dabsquared.gitlabjenkins.util.CommitStatusUpdater retrieveGitlabProjectIds
Retrieving gitlab project ids
Feb 25, 2020 4:52:39 PM INFO com.dabsquared.gitlabjenkins.util.CommitStatusUpdater addGitLabBranchBuild
Retrieving the gitlab project id from remote url https://xxxxxx/git/xxxxxx.git
Feb 25, 2020 4:52:39 PM FINEST com.dabsquared.gitlabjenkins.gitlab.api.impl.ResteasyGitLabClientBuilder
Call GitLab:
HTTP method: GET
URL: https://xxxxxx/git/api/v4/projects/xxxxxx/repository/commits/654f974842875d183b67b0dece799d0333cb4651
Request headers: [
Accept = [application/json],
PRIVATE-TOKEN = [****FILTERED****]
]
Feb 25, 2020 4:52:39 PM FINEST com.dabsquared.gitlabjenkins.gitlab.api.impl.ResteasyGitLabClientBuilder
Got response from GitLab:
URL: https://xxxxxx/git/api/v4/projects/xxxxxx/repository/commits/654f974842875d183b67b0dece799d0333cb4651
Status: 200 OK
Response headers: [
Cache-Control = [max-age=0, private, must-revalidate],
Connection = [keep-alive],
Content-Length = [602],
Content-Type = [application/json],
Date = [Tue, 25 Feb 2020 16:50:37 GMT],
Etag = [W/"517273eff8cb73e6fd27395561e5e12e"],
Referrer-Policy = [strict-origin-when-cross-origin],
Server = [nginx],
Strict-Transport-Security = [max-age=31536000],
Vary = [Origin],
X-Content-Type-Options = [nosniff],
X-Frame-Options = [SAMEORIGIN],
X-Request-Id = [TJspTjzDQK],
X-Runtime = [0.043638]
]
Response body: {
  "id" : "654f974842875d183b67b0dece799d0333cb4651",
  "short_id" : "654f9748",
  "created_at" : "2020-02-25T16:47:46.000+00:00",
  "parent_ids" : [ "272c1f68659dc2afd40c0a83fea22bc65197e94e" ],
  "title" : "Add jenkinsci GitLab build stage",
  "message" : "Add jenkinsci GitLab build stage\n",
  "author_name" : "xxxxxx",
  "author_email" : "xxxxxx",
  "authored_date" : "2020-02-25T14:52:41.000+00:00",
  "committer_name" : "xxxxxx",
  "committer_email" : "xxxxxx",
  "committed_date" : "2020-02-25T16:47:46.000+00:00",
  "stats" : {
    "additions" : 2,
    "deletions" : 0,
    "total" : 2
  },
  "status" : null,
  "last_pipeline" : null,
  "project_id" : 60
}
Feb 25, 2020 4:52:39 PM INFO com.dabsquared.gitlabjenkins.util.CommitStatusUpdater updateCommitStatus
Updating build 'xxxxxx' to 'running'
Feb 25, 2020 4:52:39 PM FINEST com.dabsquared.gitlabjenkins.gitlab.api.impl.ResteasyGitLabClientBuilder
Call GitLab:
HTTP method: POST
URL: https://xxxxxx/git/api/v4/projects/xxxxxx/statuses/654f974842875d183b67b0dece799d0333cb4651
Request headers: [
Accept = [application/json],
Content-Type = [application/x-www-form-urlencoded],
PRIVATE-TOKEN = [****FILTERED****]
]
Feb 25, 2020 4:52:39 PM FINEST com.dabsquared.gitlabjenkins.gitlab.api.impl.ResteasyGitLabClientBuilder
Got response from GitLab:
URL: https://xxxxxx/git/api/v4/projects/xxxxxx/statuses/654f974842875d183b67b0dece799d0333cb4651
Status: 201 Created
Response headers: [
Cache-Control = [max-age=0, private, must-revalidate],
Connection = [keep-alive],
Content-Length = [632],
Content-Type = [application/json],
Date = [Tue, 25 Feb 2020 16:50:37 GMT],
Etag = [W/"ddfe99b12ae07029a07e63735d9e46a4"],
Referrer-Policy = [strict-origin-when-cross-origin],
Server = [nginx],
Strict-Transport-Security = [max-age=31536000],
Vary = [Origin],
X-Content-Type-Options = [nosniff],
X-Frame-Options = [SAMEORIGIN],
X-Request-Id = [QxrTIXzGuy8],
X-Runtime = [0.178273]
]
Response body: {
  "id" : 62299,
  "sha" : "654f974842875d183b67b0dece799d0333cb4651",
  "ref" : "add-gitlab-stage",
  "status" : "running",
  "name" : "jenkinsci",
  "target_url" : "https://xxxxxx/job/xxxxxx/job/add-gitlab-stage/1/display/redirect",
  "description" : "running",
  "created_at" : "2020-02-25T16:50:37.421Z",
  "started_at" : "2020-02-25T16:50:37.472Z",
  "finished_at" : null,
  "allow_failure" : false,
  "coverage" : null,
  "author" : {
    "id" : 32,
    "name" : "xxxxxx",
    "username" : "xxxxxx",
    "state" : "active",
    "avatar_url" : "https://secure.gravatar.com/avatar/9315e20657c6ef18a238a16eea21fe67?s=80&d=identicon",
    "web_url" : "https://xxxxxx/git/xxxxxx"
  }
}
Feb 25, 2020 4:52:39 PM INFO com.dabsquared.gitlabjenkins.util.CommitStatusUpdater retrieveGitlabProjectIds
Retrieving gitlab project ids
Feb 25, 2020 4:52:39 PM INFO com.dabsquared.gitlabjenkins.util.CommitStatusUpdater addGitLabBranchBuild
Retrieving the gitlab project id from remote url https://xxxxxx/git/xxxxxx.git
Feb 25, 2020 4:52:39 PM FINEST com.dabsquared.gitlabjenkins.gitlab.api.impl.ResteasyGitLabClientBuilder
Call GitLab:
HTTP method: GET
URL: https://xxxxxx/git/api/v4/projects/xxxxxx/repository/commits/654f974842875d183b67b0dece799d0333cb4651
Request headers: [
Accept = [application/json],
PRIVATE-TOKEN = [****FILTERED****]
]
Feb 25, 2020 4:52:39 PM FINEST com.dabsquared.gitlabjenkins.gitlab.api.impl.ResteasyGitLabClientBuilder
Got response from GitLab:
URL: https://xxxxxx/git/api/v4/projects/xxxxxx/repository/commits/654f974842875d183b67b0dece799d0333cb4651
Status: 200 OK
Response headers: [
Cache-Control = [max-age=0, private, must-revalidate],
Connection = [keep-alive],
Content-Length = [891],
Content-Type = [application/json],
Date = [Tue, 25 Feb 2020 16:50:37 GMT],
Etag = [W/"4da051f31ccef56314bc27bcc91e3eaa"],
Referrer-Policy = [strict-origin-when-cross-origin],
Server = [nginx],
Strict-Transport-Security = [max-age=31536000],
Vary = [Origin],
X-Content-Type-Options = [nosniff],
X-Frame-Options = [SAMEORIGIN],
X-Request-Id = [xqmpFKbJDU],
X-Runtime = [0.045954]
]
Response body: {
  "id" : "654f974842875d183b67b0dece799d0333cb4651",
  "short_id" : "654f9748",
  "created_at" : "2020-02-25T16:47:46.000+00:00",
  "parent_ids" : [ "272c1f68659dc2afd40c0a83fea22bc65197e94e" ],
  "title" : "Add jenkinsci GitLab build stage",
  "message" : "Add jenkinsci GitLab build stage\n",
  "author_name" : "xxxxxx",
  "author_email" : "xxxxxx",
  "authored_date" : "2020-02-25T14:52:41.000+00:00",
  "committer_name" : "xxxxxx",
  "committer_email" : "xxxxxx",
  "committed_date" : "2020-02-25T16:47:46.000+00:00",
  "stats" : {
    "additions" : 2,
    "deletions" : 0,
    "total" : 2
  },
  "status" : "running",
  "last_pipeline" : {
    "id" : 14586,
    "sha" : "654f974842875d183b67b0dece799d0333cb4651",
    "ref" : "add-gitlab-stage",
    "status" : "running",
    "created_at" : "2020-02-25T16:50:37.382Z",
    "updated_at" : "2020-02-25T16:50:37.515Z",
    "web_url" : "https://xxxxxx/git/xxxxxx/pipelines/14586"
  },
  "project_id" : 60
}
Feb 25, 2020 4:52:39 PM INFO com.dabsquared.gitlabjenkins.util.CommitStatusUpdater updateCommitStatus
Updating build 'xxxxxx' to 'running'
Feb 25, 2020 4:52:39 PM FINEST com.dabsquared.gitlabjenkins.gitlab.api.impl.ResteasyGitLabClientBuilder
Call GitLab:
HTTP method: POST
URL: https://xxxxxx/git/api/v4/projects/xxxxxx/statuses/654f974842875d183b67b0dece799d0333cb4651
Request headers: [
Accept = [application/json],
Content-Type = [application/x-www-form-urlencoded],
PRIVATE-TOKEN = [****FILTERED****]
]
Feb 25, 2020 4:52:39 PM FINEST com.dabsquared.gitlabjenkins.gitlab.api.impl.ResteasyGitLabClientBuilder
Got response from GitLab:
URL: https://xxxxxx/git/api/v4/projects/xxxxxx/statuses/654f974842875d183b67b0dece799d0333cb4651
Status: 201 Created
Response headers: [
Cache-Control = [max-age=0, private, must-revalidate],
Connection = [keep-alive],
Content-Length = [632],
Content-Type = [application/json],
Date = [Tue, 25 Feb 2020 16:50:38 GMT],
Etag = [W/"c4e3e45eb84ef7dc5119bcb032ef0396"],
Referrer-Policy = [strict-origin-when-cross-origin],
Server = [nginx],
Strict-Transport-Security = [max-age=31536000],
Vary = [Origin],
X-Content-Type-Options = [nosniff],
X-Frame-Options = [SAMEORIGIN],
X-Request-Id = [cul5nbJ9Qe6],
X-Runtime = [0.129224]
]
Response body: {
  "id" : 62300,
  "sha" : "654f974842875d183b67b0dece799d0333cb4651",
  "ref" : "add-gitlab-stage",
  "status" : "running",
  "name" : "Configure",
  "target_url" : "https://xxxxxx/job/xxxxxx/job/add-gitlab-stage/1/display/redirect",
  "description" : "running",
  "created_at" : "2020-02-25T16:50:37.949Z",
  "started_at" : "2020-02-25T16:50:38.001Z",
  "finished_at" : null,
  "allow_failure" : false,
  "coverage" : null,
  "author" : {
    "id" : 32,
    "name" : "xxxxxx",
    "username" : "xxxxxx",
    "state" : "active",
    "avatar_url" : "https://secure.gravatar.com/avatar/9315e20657c6ef18a238a16eea21fe67?s=80&d=identicon",
    "web_url" : "https://xxxxxx/git/xxxxxx"
  }
}
Feb 25, 2020 4:52:42 PM INFO com.dabsquared.gitlabjenkins.util.CommitStatusUpdater retrieveGitlabProjectIds
Retrieving gitlab project ids
Feb 25, 2020 4:52:42 PM INFO com.dabsquared.gitlabjenkins.util.CommitStatusUpdater addGitLabBranchBuild
Retrieving the gitlab project id from remote url https://xxxxxx/git/xxxxxx.git
Feb 25, 2020 4:52:42 PM FINEST com.dabsquared.gitlabjenkins.gitlab.api.impl.ResteasyGitLabClientBuilder
Call GitLab:
HTTP method: GET
URL: https://xxxxxx/git/api/v4/projects/xxxxxx/repository/commits/654f974842875d183b67b0dece799d0333cb4651
Request headers: [
Accept = [application/json],
PRIVATE-TOKEN = [****FILTERED****]
]
Feb 25, 2020 4:52:42 PM FINEST com.dabsquared.gitlabjenkins.gitlab.api.impl.ResteasyGitLabClientBuilder
Got response from GitLab:
URL: https://xxxxxx/git/api/v4/projects/xxxxxx/repository/commits/654f974842875d183b67b0dece799d0333cb4651
Status: 200 OK
Response headers: [
Cache-Control = [max-age=0, private, must-revalidate],
Connection = [keep-alive],
Content-Length = [891],
Content-Type = [application/json],
Date = [Tue, 25 Feb 2020 16:50:40 GMT],
Etag = [W/"4da051f31ccef56314bc27bcc91e3eaa"],
Referrer-Policy = [strict-origin-when-cross-origin],
Server = [nginx],
Strict-Transport-Security = [max-age=31536000],
Vary = [Origin],
X-Content-Type-Options = [nosniff],
X-Frame-Options = [SAMEORIGIN],
X-Request-Id = [KtBG5mXurh],
X-Runtime = [0.052004]
]
Response body: {
  "id" : "654f974842875d183b67b0dece799d0333cb4651",
  "short_id" : "654f9748",
  "created_at" : "2020-02-25T16:47:46.000+00:00",
  "parent_ids" : [ "272c1f68659dc2afd40c0a83fea22bc65197e94e" ],
  "title" : "Add jenkinsci GitLab build stage",
  "message" : "Add jenkinsci GitLab build stage\n",
  "author_name" : "xxxxxx",
  "author_email" : "xxxxxx",
  "authored_date" : "2020-02-25T14:52:41.000+00:00",
  "committer_name" : "xxxxxx",
  "committer_email" : "xxxxxx",
  "committed_date" : "2020-02-25T16:47:46.000+00:00",
  "stats" : {
    "additions" : 2,
    "deletions" : 0,
    "total" : 2
  },
  "status" : "running",
  "last_pipeline" : {
    "id" : 14586,
    "sha" : "654f974842875d183b67b0dece799d0333cb4651",
    "ref" : "add-gitlab-stage",
    "status" : "running",
    "created_at" : "2020-02-25T16:50:37.382Z",
    "updated_at" : "2020-02-25T16:50:37.515Z",
    "web_url" : "https://xxxxxx/git/xxxxxx/pipelines/14586"
  },
  "project_id" : 60
}
Feb 25, 2020 4:52:42 PM INFO com.dabsquared.gitlabjenkins.util.CommitStatusUpdater updateCommitStatus
Updating build 'xxxxxx' to 'success'
Feb 25, 2020 4:52:42 PM FINEST com.dabsquared.gitlabjenkins.gitlab.api.impl.ResteasyGitLabClientBuilder
Call GitLab:
HTTP method: POST
URL: https://xxxxxx/git/api/v4/projects/xxxxxx/statuses/654f974842875d183b67b0dece799d0333cb4651
Request headers: [
Accept = [application/json],
Content-Type = [application/x-www-form-urlencoded],
PRIVATE-TOKEN = [****FILTERED****]
]
Feb 25, 2020 4:52:42 PM FINEST com.dabsquared.gitlabjenkins.gitlab.api.impl.ResteasyGitLabClientBuilder
Got response from GitLab:
URL: https://xxxxxx/git/api/v4/projects/xxxxxx/statuses/654f974842875d183b67b0dece799d0333cb4651
Status: 201 Created
Response headers: [
Cache-Control = [max-age=0, private, must-revalidate],
Connection = [keep-alive],
Content-Length = [654],
Content-Type = [application/json],
Date = [Tue, 25 Feb 2020 16:50:40 GMT],
Etag = [W/"9e62bc561230df2bb7ee15422edba573"],
Referrer-Policy = [strict-origin-when-cross-origin],
Server = [nginx],
Strict-Transport-Security = [max-age=31536000],
Vary = [Origin],
X-Content-Type-Options = [nosniff],
X-Frame-Options = [SAMEORIGIN],
X-Request-Id = [bVCCeYLkMM7],
X-Runtime = [0.098756]
]
Response body: {
  "id" : 62300,
  "sha" : "654f974842875d183b67b0dece799d0333cb4651",
  "ref" : "add-gitlab-stage",
  "status" : "success",
  "name" : "Configure",
  "target_url" : "https://xxxxxx/job/xxxxxx/job/add-gitlab-stage/1/display/redirect",
  "description" : "success",
  "created_at" : "2020-02-25T16:50:37.949Z",
  "started_at" : "2020-02-25T16:50:38.001Z",
  "finished_at" : "2020-02-25T16:50:40.544Z",
  "allow_failure" : false,
  "coverage" : null,
  "author" : {
    "id" : 32,
    "name" : "xxxxxx",
    "username" : "xxxxxx",
    "state" : "active",
    "avatar_url" : "https://secure.gravatar.com/avatar/9315e20657c6ef18a238a16eea21fe67?s=80&d=identicon",
    "web_url" : "https://xxxxxx/git/xxxxxx"
  }
}
Feb 25, 2020 4:52:43 PM INFO com.dabsquared.gitlabjenkins.util.CommitStatusUpdater retrieveGitlabProjectIds
Retrieving gitlab project ids
Feb 25, 2020 4:52:43 PM INFO com.dabsquared.gitlabjenkins.util.CommitStatusUpdater addGitLabBranchBuild
Retrieving the gitlab project id from remote url https://xxxxxx/git/xxxxxx.git
Feb 25, 2020 4:52:43 PM FINEST com.dabsquared.gitlabjenkins.gitlab.api.impl.ResteasyGitLabClientBuilder
Call GitLab:
HTTP method: GET
URL: https://xxxxxx/git/api/v4/projects/xxxxxx/repository/commits/654f974842875d183b67b0dece799d0333cb4651
Request headers: [
Accept = [application/json],
PRIVATE-TOKEN = [****FILTERED****]
]
Feb 25, 2020 4:52:43 PM FINEST com.dabsquared.gitlabjenkins.gitlab.api.impl.ResteasyGitLabClientBuilder
Got response from GitLab:
URL: https://xxxxxx/git/api/v4/projects/xxxxxx/repository/commits/654f974842875d183b67b0dece799d0333cb4651
Status: 200 OK
Response headers: [
Cache-Control = [max-age=0, private, must-revalidate],
Connection = [keep-alive],
Content-Length = [891],
Content-Type = [application/json],
Date = [Tue, 25 Feb 2020 16:50:41 GMT],
Etag = [W/"4da051f31ccef56314bc27bcc91e3eaa"],
Referrer-Policy = [strict-origin-when-cross-origin],
Server = [nginx],
Strict-Transport-Security = [max-age=31536000],
Vary = [Origin],
X-Content-Type-Options = [nosniff],
X-Frame-Options = [SAMEORIGIN],
X-Request-Id = [1HU22larJ8a],
X-Runtime = [0.050784]
]
Response body: {
  "id" : "654f974842875d183b67b0dece799d0333cb4651",
  "short_id" : "654f9748",
  "created_at" : "2020-02-25T16:47:46.000+00:00",
  "parent_ids" : [ "272c1f68659dc2afd40c0a83fea22bc65197e94e" ],
  "title" : "Add jenkinsci GitLab build stage",
  "message" : "Add jenkinsci GitLab build stage\n",
  "author_name" : "xxxxxx",
  "author_email" : "xxxxxx",
  "authored_date" : "2020-02-25T14:52:41.000+00:00",
  "committer_name" : "xxxxxx",
  "committer_email" : "xxxxxx",
  "committed_date" : "2020-02-25T16:47:46.000+00:00",
  "stats" : {
    "additions" : 2,
    "deletions" : 0,
    "total" : 2
  },
  "status" : "running",
  "last_pipeline" : {
    "id" : 14586,
    "sha" : "654f974842875d183b67b0dece799d0333cb4651",
    "ref" : "add-gitlab-stage",
    "status" : "running",
    "created_at" : "2020-02-25T16:50:37.382Z",
    "updated_at" : "2020-02-25T16:50:37.515Z",
    "web_url" : "https://xxxxxx/git/xxxxxx/pipelines/14586"
  },
  "project_id" : 60
}
Feb 25, 2020 4:52:43 PM INFO com.dabsquared.gitlabjenkins.util.CommitStatusUpdater updateCommitStatus
Updating build 'xxxxxx' to 'running'
Feb 25, 2020 4:52:43 PM FINEST com.dabsquared.gitlabjenkins.gitlab.api.impl.ResteasyGitLabClientBuilder
Call GitLab:
HTTP method: POST
URL: https://xxxxxx/git/api/v4/projects/xxxxxx/statuses/654f974842875d183b67b0dece799d0333cb4651
Request headers: [
Accept = [application/json],
Content-Type = [application/x-www-form-urlencoded],
PRIVATE-TOKEN = [****FILTERED****]
]
Feb 25, 2020 4:52:43 PM FINEST com.dabsquared.gitlabjenkins.gitlab.api.impl.ResteasyGitLabClientBuilder
Got response from GitLab:
URL: https://xxxxxx/git/api/v4/projects/xxxxxx/statuses/654f974842875d183b67b0dece799d0333cb4651
Status: 201 Created
Response headers: [
Cache-Control = [max-age=0, private, must-revalidate],
Connection = [keep-alive],
Content-Length = [627],
Content-Type = [application/json],
Date = [Tue, 25 Feb 2020 16:50:41 GMT],
Etag = [W/"d1b887e72a1fbeaea7f676deff19e6fa"],
Referrer-Policy = [strict-origin-when-cross-origin],
Server = [nginx],
Strict-Transport-Security = [max-age=31536000],
Vary = [Origin],
X-Content-Type-Options = [nosniff],
X-Frame-Options = [SAMEORIGIN],
X-Request-Id = [5Q0zx1JBSv6],
X-Runtime = [0.122175]
]
Response body: {
  "id" : 62301,
  "sha" : "654f974842875d183b67b0dece799d0333cb4651",
  "ref" : "add-gitlab-stage",
  "status" : "running",
  "name" : "Test",
  "target_url" : "https://xxxxxx/job/xxxxxx/job/add-gitlab-stage/1/display/redirect",
  "description" : "running",
  "created_at" : "2020-02-25T16:50:41.679Z",
  "started_at" : "2020-02-25T16:50:41.727Z",
  "finished_at" : null,
  "allow_failure" : false,
  "coverage" : null,
  "author" : {
    "id" : 32,
    "name" : "xxxxxx",
    "username" : "xxxxxx",
    "state" : "active",
    "avatar_url" : "https://secure.gravatar.com/avatar/9315e20657c6ef18a238a16eea21fe67?s=80&d=identicon",
    "web_url" : "https://xxxxxx/git/xxxxxx"
  }
}

geraintwhite avatar Feb 25 '20 16:02 geraintwhite

What branches is this occurring on for you? Are those branches protected?

katanacrimson avatar Apr 07 '20 01:04 katanacrimson

It's any branch

geraintwhite avatar Apr 07 '20 08:04 geraintwhite

I believe it's because the plugin doesn't have SCM info until after the SCM checkout in multi-branch pipelines, whereas it should be able to send pending as soon as the pipeline starts and is waiting for a node.

geraintwhite avatar Apr 07 '20 08:04 geraintwhite

Hi, I had the same issue, but I found a fix following the documentation here. You should start gitlabBuilds just after the checkout and not before like follows

node() {
    stage('Checkout') { checkout <your-scm-config> }

    gitlabBuilds(builds: ["build", "test"]) {
        stage("build") {
          gitlabCommitStatus("build") {
              // your build steps
          }
        }

        stage("test") {
          gitlabCommitStatus("test") {
              // your test steps
          }
        }
    }
}

mkonzali avatar Feb 19 '25 11:02 mkonzali

im open to submit pr on it

iihimanshuu avatar Mar 24 '25 10:03 iihimanshuu