Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added [GitLabTag] service #6389

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Added pretty message for repo not found
  • Loading branch information
guille-ideotec committed Apr 16, 2021
commit 0f308eea0b60eb847ac7c41a882ab87c0d6c50f0
3 changes: 3 additions & 0 deletions services/gitlab/gitlab-tag.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ module.exports = class GitlabTag extends BaseJsonService {
return this._requestJson({
schema,
url: `https://gitlab.com/api/v4/projects/${user}%2F${repo}/repository/tags`,
errorMessages: {
404: 'repo not found',
},
})
}

Expand Down
4 changes: 4 additions & 0 deletions services/gitlab/gitlab-tag.tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ t.create('Tag (latest by date)')
.get('/fdroid/fdroidclient.json')
.expectBadge({ label: 'tag', message: Joi.string(), color: 'blue' })

t.create('Tag (repo not found)')
.get('/fdroid/nonexistant.json')
.expectBadge({ label: 'tag', message: 'repo not found' })

t.create('Tag (no tags)')
.get('/fdroid/fdroiddata.json')
.expectBadge({ label: 'tag', message: 'no tags found' })