refactor gitlab,gitter,hackage,hexpm service files (#5575)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
This commit is contained in:
@@ -39,64 +39,56 @@ Also make sure you have set up code covrage parsing as described <a href="https:
|
||||
`
|
||||
|
||||
module.exports = class GitlabCoverage extends BaseSvgScrapingService {
|
||||
static get category() {
|
||||
return 'coverage'
|
||||
static category = 'coverage'
|
||||
|
||||
static route = {
|
||||
base: 'gitlab/coverage',
|
||||
pattern: ':user/:repo/:branch',
|
||||
queryParamSchema,
|
||||
}
|
||||
|
||||
static get route() {
|
||||
return {
|
||||
base: 'gitlab/coverage',
|
||||
pattern: ':user/:repo/:branch',
|
||||
queryParamSchema,
|
||||
}
|
||||
}
|
||||
static examples = [
|
||||
{
|
||||
title: 'Gitlab code coverage',
|
||||
namedParams: {
|
||||
user: 'gitlab-org',
|
||||
repo: 'gitlab-runner',
|
||||
branch: 'master',
|
||||
},
|
||||
staticPreview: this.render({ coverage: 67 }),
|
||||
documentation,
|
||||
},
|
||||
{
|
||||
title: 'Gitlab code coverage (specific job)',
|
||||
namedParams: {
|
||||
user: 'gitlab-org',
|
||||
repo: 'gitlab-runner',
|
||||
branch: 'master',
|
||||
},
|
||||
queryParams: { job_name: 'test coverage report' },
|
||||
staticPreview: this.render({ coverage: 96 }),
|
||||
documentation,
|
||||
},
|
||||
{
|
||||
title: 'Gitlab code coverage (self-hosted)',
|
||||
namedParams: { user: 'GNOME', repo: 'libhandy', branch: 'master' },
|
||||
queryParams: { gitlab_url: 'https://gitlab.gnome.org' },
|
||||
staticPreview: this.render({ coverage: 93 }),
|
||||
documentation,
|
||||
},
|
||||
{
|
||||
title: 'Gitlab code coverage (self-hosted, specific job)',
|
||||
namedParams: { user: 'GNOME', repo: 'libhandy', branch: 'master' },
|
||||
queryParams: {
|
||||
gitlab_url: 'https://gitlab.gnome.org',
|
||||
job_name: 'unit-test',
|
||||
},
|
||||
staticPreview: this.render({ coverage: 93 }),
|
||||
documentation,
|
||||
},
|
||||
]
|
||||
|
||||
static get examples() {
|
||||
return [
|
||||
{
|
||||
title: 'Gitlab code coverage',
|
||||
namedParams: {
|
||||
user: 'gitlab-org',
|
||||
repo: 'gitlab-runner',
|
||||
branch: 'master',
|
||||
},
|
||||
staticPreview: this.render({ coverage: 67 }),
|
||||
documentation,
|
||||
},
|
||||
{
|
||||
title: 'Gitlab code coverage (specific job)',
|
||||
namedParams: {
|
||||
user: 'gitlab-org',
|
||||
repo: 'gitlab-runner',
|
||||
branch: 'master',
|
||||
},
|
||||
queryParams: { job_name: 'test coverage report' },
|
||||
staticPreview: this.render({ coverage: 96 }),
|
||||
documentation,
|
||||
},
|
||||
{
|
||||
title: 'Gitlab code coverage (self-hosted)',
|
||||
namedParams: { user: 'GNOME', repo: 'libhandy', branch: 'master' },
|
||||
queryParams: { gitlab_url: 'https://gitlab.gnome.org' },
|
||||
staticPreview: this.render({ coverage: 93 }),
|
||||
documentation,
|
||||
},
|
||||
{
|
||||
title: 'Gitlab code coverage (self-hosted, specific job)',
|
||||
namedParams: { user: 'GNOME', repo: 'libhandy', branch: 'master' },
|
||||
queryParams: {
|
||||
gitlab_url: 'https://gitlab.gnome.org',
|
||||
job_name: 'unit-test',
|
||||
},
|
||||
staticPreview: this.render({ coverage: 93 }),
|
||||
documentation,
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
static get defaultBadgeData() {
|
||||
return { label: 'coverage' }
|
||||
}
|
||||
static defaultBadgeData = { label: 'coverage' }
|
||||
|
||||
static render({ coverage }) {
|
||||
return {
|
||||
|
||||
@@ -35,39 +35,33 @@ const documentation = `
|
||||
`
|
||||
|
||||
class GitlabPipelineStatus extends BaseSvgScrapingService {
|
||||
static get category() {
|
||||
return 'build'
|
||||
static category = 'build'
|
||||
|
||||
static route = {
|
||||
base: 'gitlab/pipeline',
|
||||
pattern: ':user/:repo/:branch+',
|
||||
queryParamSchema,
|
||||
}
|
||||
|
||||
static get route() {
|
||||
return {
|
||||
base: 'gitlab/pipeline',
|
||||
pattern: ':user/:repo/:branch+',
|
||||
queryParamSchema,
|
||||
}
|
||||
}
|
||||
|
||||
static get examples() {
|
||||
return [
|
||||
{
|
||||
title: 'Gitlab pipeline status',
|
||||
namedParams: {
|
||||
user: 'gitlab-org',
|
||||
repo: 'gitlab',
|
||||
branch: 'master',
|
||||
},
|
||||
staticPreview: this.render({ status: 'passed' }),
|
||||
documentation,
|
||||
static examples = [
|
||||
{
|
||||
title: 'Gitlab pipeline status',
|
||||
namedParams: {
|
||||
user: 'gitlab-org',
|
||||
repo: 'gitlab',
|
||||
branch: 'master',
|
||||
},
|
||||
{
|
||||
title: 'Gitlab pipeline status (self-hosted)',
|
||||
namedParams: { user: 'GNOME', repo: 'pango', branch: 'master' },
|
||||
queryParams: { gitlab_url: 'https://gitlab.gnome.org' },
|
||||
staticPreview: this.render({ status: 'passed' }),
|
||||
documentation,
|
||||
},
|
||||
]
|
||||
}
|
||||
staticPreview: this.render({ status: 'passed' }),
|
||||
documentation,
|
||||
},
|
||||
{
|
||||
title: 'Gitlab pipeline status (self-hosted)',
|
||||
namedParams: { user: 'GNOME', repo: 'pango', branch: 'master' },
|
||||
queryParams: { gitlab_url: 'https://gitlab.gnome.org' },
|
||||
staticPreview: this.render({ status: 'passed' }),
|
||||
documentation,
|
||||
},
|
||||
]
|
||||
|
||||
static render({ status }) {
|
||||
return renderBuildStatusBadge({ status })
|
||||
|
||||
Reference in New Issue
Block a user