diff --git a/services/gitlab/gitlab-pipeline-status.service.js b/services/gitlab/gitlab-pipeline-status.service.js index 2800341e7e..4e179e6c73 100644 --- a/services/gitlab/gitlab-pipeline-status.service.js +++ b/services/gitlab/gitlab-pipeline-status.service.js @@ -32,6 +32,9 @@ const documentation = `

Your badge should be working fine now.

+

+ NB - The badge will display 'inaccessible' if the specified repo was not found on the target Gitlab instance. +

` class GitlabPipelineStatus extends BaseSvgScrapingService { diff --git a/services/gitlab/gitlab-pipeline-status.tester.js b/services/gitlab/gitlab-pipeline-status.tester.js index 49183c38e1..0ab56554a6 100644 --- a/services/gitlab/gitlab-pipeline-status.tester.js +++ b/services/gitlab/gitlab-pipeline-status.tester.js @@ -20,11 +20,18 @@ t.create('Pipeline status (nonexistent branch)') message: 'branch not found', }) +// Gitlab will redirect users to a sign-in page +// (which we ultimately see as a 503 error) in the event +// a nonexistent, or private, repository is specified. +// Given the additional complexity that would've been required to +// present users with a more traditional and friendly 'Not Found' +// error message, we will simply display inaccessible +// https://github.com/badges/shields/pull/5538 t.create('Pipeline status (nonexistent repo)') .get('/this-repo/does-not-exist/master.json') .expectBadge({ label: 'build', - message: 'repo not found', + message: 'inaccessible', }) t.create('Pipeline status (custom gitlab URL)')