Refactor [requires scrutinizer securityheaders shippable] services (#5643)
* Refactor readthedocs reddit redmine repology services * Refactor requires scrutinizer security-headers shippable services Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
This commit is contained in:
@@ -19,14 +19,10 @@ const schema = Joi.object({
|
||||
}).required()
|
||||
|
||||
class ScrutinizerBuildBase extends ScrutinizerBase {
|
||||
static get category() {
|
||||
return 'build'
|
||||
}
|
||||
static category = 'build'
|
||||
|
||||
static get defaultBadgeData() {
|
||||
return {
|
||||
label: 'build',
|
||||
}
|
||||
static defaultBadgeData = {
|
||||
label: 'build',
|
||||
}
|
||||
|
||||
async makeBadge({ vcs, slug, branch }) {
|
||||
@@ -39,28 +35,24 @@ class ScrutinizerBuildBase extends ScrutinizerBase {
|
||||
}
|
||||
|
||||
class ScrutinizerBuild extends ScrutinizerBuildBase {
|
||||
static get route() {
|
||||
return {
|
||||
base: 'scrutinizer/build',
|
||||
pattern: ':vcs(g|b)/:user/:repo/:branch*',
|
||||
}
|
||||
static route = {
|
||||
base: 'scrutinizer/build',
|
||||
pattern: ':vcs(g|b)/:user/:repo/:branch*',
|
||||
}
|
||||
|
||||
static get examples() {
|
||||
return [
|
||||
{
|
||||
title: 'Scrutinizer build (GitHub/Bitbucket)',
|
||||
pattern: ':vcs(g|b)/:user/:repo/:branch?',
|
||||
namedParams: {
|
||||
vcs: 'g',
|
||||
user: 'filp',
|
||||
repo: 'whoops',
|
||||
branch: 'master',
|
||||
},
|
||||
staticPreview: renderBuildStatusBadge({ status: 'passing' }),
|
||||
static examples = [
|
||||
{
|
||||
title: 'Scrutinizer build (GitHub/Bitbucket)',
|
||||
pattern: ':vcs(g|b)/:user/:repo/:branch?',
|
||||
namedParams: {
|
||||
vcs: 'g',
|
||||
user: 'filp',
|
||||
repo: 'whoops',
|
||||
branch: 'master',
|
||||
},
|
||||
]
|
||||
}
|
||||
staticPreview: renderBuildStatusBadge({ status: 'passing' }),
|
||||
},
|
||||
]
|
||||
|
||||
async handle({ vcs, user, repo, branch }) {
|
||||
return this.makeBadge({
|
||||
@@ -72,32 +64,28 @@ class ScrutinizerBuild extends ScrutinizerBuildBase {
|
||||
}
|
||||
|
||||
class ScrutinizerGitLabBuild extends ScrutinizerBuildBase {
|
||||
static get route() {
|
||||
return {
|
||||
base: 'scrutinizer/build/gl',
|
||||
pattern: ':instance/:user/:repo/:branch*',
|
||||
}
|
||||
static route = {
|
||||
base: 'scrutinizer/build/gl',
|
||||
pattern: ':instance/:user/:repo/:branch*',
|
||||
}
|
||||
|
||||
static get examples() {
|
||||
// There are no known anonymous accessible Scrutinizer reports available for GitLab repos.
|
||||
// The example used is valid, but the project will not be accessible if Shields users try to use it.
|
||||
// https://gitlab.propertywindow.nl/propertywindow/client
|
||||
// https://scrutinizer-ci.com/gl/propertywindow/propertywindow/client/badges/quality-score.png?b=master&s=dfae6992a48184cc2333b4c349cec0447f0d67c2
|
||||
return [
|
||||
{
|
||||
title: 'Scrutinizer build (GitLab)',
|
||||
pattern: ':instance/:user/:repo/:branch?',
|
||||
namedParams: {
|
||||
instance: 'propertywindow',
|
||||
user: 'propertywindow',
|
||||
repo: 'client',
|
||||
branch: 'master',
|
||||
},
|
||||
staticPreview: renderBuildStatusBadge({ status: 'passing' }),
|
||||
// There are no known anonymous accessible Scrutinizer reports available for GitLab repos.
|
||||
// The example used is valid, but the project will not be accessible if Shields users try to use it.
|
||||
// https://gitlab.propertywindow.nl/propertywindow/client
|
||||
// https://scrutinizer-ci.com/gl/propertywindow/propertywindow/client/badges/quality-score.png?b=master&s=dfae6992a48184cc2333b4c349cec0447f0d67c2
|
||||
static examples = [
|
||||
{
|
||||
title: 'Scrutinizer build (GitLab)',
|
||||
pattern: ':instance/:user/:repo/:branch?',
|
||||
namedParams: {
|
||||
instance: 'propertywindow',
|
||||
user: 'propertywindow',
|
||||
repo: 'client',
|
||||
branch: 'master',
|
||||
},
|
||||
]
|
||||
}
|
||||
staticPreview: renderBuildStatusBadge({ status: 'passing' }),
|
||||
},
|
||||
]
|
||||
|
||||
async handle({ instance, user, repo, branch }) {
|
||||
return this.makeBadge({
|
||||
@@ -109,11 +97,9 @@ class ScrutinizerGitLabBuild extends ScrutinizerBuildBase {
|
||||
}
|
||||
|
||||
class ScrutinizerPlainGitBuild extends ScrutinizerBuildBase {
|
||||
static get route() {
|
||||
return {
|
||||
base: 'scrutinizer/build/gp',
|
||||
pattern: ':slug/:branch*',
|
||||
}
|
||||
static route = {
|
||||
base: 'scrutinizer/build/gp',
|
||||
pattern: ':slug/:branch*',
|
||||
}
|
||||
|
||||
async handle({ slug, branch }) {
|
||||
|
||||
@@ -32,14 +32,10 @@ const schema = Joi.object({
|
||||
const scale = colorScale([40, 61], ['red', 'yellow', 'brightgreen'])
|
||||
|
||||
class ScrutinizerCoverageBase extends ScrutinizerBase {
|
||||
static get category() {
|
||||
return 'coverage'
|
||||
}
|
||||
static category = 'coverage'
|
||||
|
||||
static get defaultBadgeData() {
|
||||
return {
|
||||
label: 'coverage',
|
||||
}
|
||||
static defaultBadgeData = {
|
||||
label: 'coverage',
|
||||
}
|
||||
|
||||
static render({ coverage }) {
|
||||
@@ -71,28 +67,24 @@ class ScrutinizerCoverageBase extends ScrutinizerBase {
|
||||
}
|
||||
|
||||
class ScrutinizerCoverage extends ScrutinizerCoverageBase {
|
||||
static get route() {
|
||||
return {
|
||||
base: 'scrutinizer/coverage',
|
||||
pattern: ':vcs(g|b)/:user/:repo/:branch*',
|
||||
}
|
||||
static route = {
|
||||
base: 'scrutinizer/coverage',
|
||||
pattern: ':vcs(g|b)/:user/:repo/:branch*',
|
||||
}
|
||||
|
||||
static get examples() {
|
||||
return [
|
||||
{
|
||||
title: 'Scrutinizer coverage (GitHub/BitBucket)',
|
||||
pattern: ':vcs(g|b)/:user/:repo/:branch?',
|
||||
namedParams: {
|
||||
vcs: 'g',
|
||||
user: 'filp',
|
||||
repo: 'whoops',
|
||||
branch: 'master',
|
||||
},
|
||||
staticPreview: this.render({ coverage: 86 }),
|
||||
static examples = [
|
||||
{
|
||||
title: 'Scrutinizer coverage (GitHub/BitBucket)',
|
||||
pattern: ':vcs(g|b)/:user/:repo/:branch?',
|
||||
namedParams: {
|
||||
vcs: 'g',
|
||||
user: 'filp',
|
||||
repo: 'whoops',
|
||||
branch: 'master',
|
||||
},
|
||||
]
|
||||
}
|
||||
staticPreview: this.render({ coverage: 86 }),
|
||||
},
|
||||
]
|
||||
|
||||
async handle({ vcs, user, repo, branch }) {
|
||||
return this.makeBadge({
|
||||
@@ -104,32 +96,28 @@ class ScrutinizerCoverage extends ScrutinizerCoverageBase {
|
||||
}
|
||||
|
||||
class ScrutinizerCoverageGitLab extends ScrutinizerCoverageBase {
|
||||
static get route() {
|
||||
return {
|
||||
base: 'scrutinizer/coverage/gl',
|
||||
pattern: ':instance/:user/:repo/:branch*',
|
||||
}
|
||||
static route = {
|
||||
base: 'scrutinizer/coverage/gl',
|
||||
pattern: ':instance/:user/:repo/:branch*',
|
||||
}
|
||||
|
||||
static get examples() {
|
||||
// There are no known anonymous accessible Scrutinizer reports available for GitLab repos.
|
||||
// The example used is valid, but the project will not be accessible if Shields users try to use it.
|
||||
// https://gitlab.propertywindow.nl/propertywindow/client
|
||||
// https://scrutinizer-ci.com/gl/propertywindow/propertywindow/client/badges/quality-score.png?b=master&s=dfae6992a48184cc2333b4c349cec0447f0d67c2
|
||||
return [
|
||||
{
|
||||
title: 'Scrutinizer coverage (GitLab)',
|
||||
pattern: ':instance/:user/:repo/:branch?',
|
||||
namedParams: {
|
||||
instance: 'propertywindow',
|
||||
user: 'propertywindow',
|
||||
repo: 'client',
|
||||
branch: 'master',
|
||||
},
|
||||
staticPreview: this.render({ coverage: 94 }),
|
||||
// There are no known anonymous accessible Scrutinizer reports available for GitLab repos.
|
||||
// The example used is valid, but the project will not be accessible if Shields users try to use it.
|
||||
// https://gitlab.propertywindow.nl/propertywindow/client
|
||||
// https://scrutinizer-ci.com/gl/propertywindow/propertywindow/client/badges/quality-score.png?b=master&s=dfae6992a48184cc2333b4c349cec0447f0d67c2
|
||||
static examples = [
|
||||
{
|
||||
title: 'Scrutinizer coverage (GitLab)',
|
||||
pattern: ':instance/:user/:repo/:branch?',
|
||||
namedParams: {
|
||||
instance: 'propertywindow',
|
||||
user: 'propertywindow',
|
||||
repo: 'client',
|
||||
branch: 'master',
|
||||
},
|
||||
]
|
||||
}
|
||||
staticPreview: this.render({ coverage: 94 }),
|
||||
},
|
||||
]
|
||||
|
||||
async handle({ instance, user, repo, branch }) {
|
||||
return this.makeBadge({
|
||||
@@ -141,11 +129,9 @@ class ScrutinizerCoverageGitLab extends ScrutinizerCoverageBase {
|
||||
}
|
||||
|
||||
class ScrutinizerCoveragePlainGit extends ScrutinizerCoverageBase {
|
||||
static get route() {
|
||||
return {
|
||||
base: 'scrutinizer/coverage/gp',
|
||||
pattern: ':slug/:branch*',
|
||||
}
|
||||
static route = {
|
||||
base: 'scrutinizer/coverage/gp',
|
||||
pattern: ':slug/:branch*',
|
||||
}
|
||||
|
||||
async handle({ slug, branch }) {
|
||||
|
||||
@@ -30,14 +30,10 @@ const scale = colorScale(
|
||||
)
|
||||
|
||||
class ScrutinizerQualityBase extends ScrutinizerBase {
|
||||
static get category() {
|
||||
return 'analysis'
|
||||
}
|
||||
static category = 'analysis'
|
||||
|
||||
static get defaultBadgeData() {
|
||||
return {
|
||||
label: 'code quality',
|
||||
}
|
||||
static defaultBadgeData = {
|
||||
label: 'code quality',
|
||||
}
|
||||
|
||||
static render({ score }) {
|
||||
@@ -59,28 +55,24 @@ class ScrutinizerQualityBase extends ScrutinizerBase {
|
||||
}
|
||||
|
||||
class ScrutinizerQuality extends ScrutinizerQualityBase {
|
||||
static get route() {
|
||||
return {
|
||||
base: 'scrutinizer/quality',
|
||||
pattern: ':vcs(g|b)/:user/:repo/:branch*',
|
||||
}
|
||||
static route = {
|
||||
base: 'scrutinizer/quality',
|
||||
pattern: ':vcs(g|b)/:user/:repo/:branch*',
|
||||
}
|
||||
|
||||
static get examples() {
|
||||
return [
|
||||
{
|
||||
title: 'Scrutinizer code quality (GitHub/Bitbucket)',
|
||||
pattern: ':vcs(g|b)/:user/:repo/:branch?',
|
||||
namedParams: {
|
||||
vcs: 'g',
|
||||
user: 'filp',
|
||||
repo: 'whoops',
|
||||
branch: 'master',
|
||||
},
|
||||
staticPreview: this.render({ score: 8.26 }),
|
||||
static examples = [
|
||||
{
|
||||
title: 'Scrutinizer code quality (GitHub/Bitbucket)',
|
||||
pattern: ':vcs(g|b)/:user/:repo/:branch?',
|
||||
namedParams: {
|
||||
vcs: 'g',
|
||||
user: 'filp',
|
||||
repo: 'whoops',
|
||||
branch: 'master',
|
||||
},
|
||||
]
|
||||
}
|
||||
staticPreview: this.render({ score: 8.26 }),
|
||||
},
|
||||
]
|
||||
|
||||
async handle({ vcs, user, repo, branch }) {
|
||||
return this.makeBadge({
|
||||
@@ -92,32 +84,28 @@ class ScrutinizerQuality extends ScrutinizerQualityBase {
|
||||
}
|
||||
|
||||
class ScrutinizerQualityGitLab extends ScrutinizerQualityBase {
|
||||
static get route() {
|
||||
return {
|
||||
base: 'scrutinizer/quality/gl',
|
||||
pattern: ':instance/:user/:repo/:branch*',
|
||||
}
|
||||
static route = {
|
||||
base: 'scrutinizer/quality/gl',
|
||||
pattern: ':instance/:user/:repo/:branch*',
|
||||
}
|
||||
|
||||
static get examples() {
|
||||
// There are no known anonymous accessible Scrutinizer reports available for GitLab repos.
|
||||
// The example used is valid, but the project will not be accessible if Shields users try to use it.
|
||||
// https://gitlab.propertywindow.nl/propertywindow/client
|
||||
// https://scrutinizer-ci.com/gl/propertywindow/propertywindow/client/badges/quality-score.png?b=master&s=dfae6992a48184cc2333b4c349cec0447f0d67c2
|
||||
return [
|
||||
{
|
||||
title: 'Scrutinizer coverage (GitLab)',
|
||||
pattern: ':instance/:user/:repo/:branch?',
|
||||
namedParams: {
|
||||
instance: 'propertywindow',
|
||||
user: 'propertywindow',
|
||||
repo: 'client',
|
||||
branch: 'master',
|
||||
},
|
||||
staticPreview: this.render({ score: 10.0 }),
|
||||
// There are no known anonymous accessible Scrutinizer reports available for GitLab repos.
|
||||
// The example used is valid, but the project will not be accessible if Shields users try to use it.
|
||||
// https://gitlab.propertywindow.nl/propertywindow/client
|
||||
// https://scrutinizer-ci.com/gl/propertywindow/propertywindow/client/badges/quality-score.png?b=master&s=dfae6992a48184cc2333b4c349cec0447f0d67c2
|
||||
static examples = [
|
||||
{
|
||||
title: 'Scrutinizer coverage (GitLab)',
|
||||
pattern: ':instance/:user/:repo/:branch?',
|
||||
namedParams: {
|
||||
instance: 'propertywindow',
|
||||
user: 'propertywindow',
|
||||
repo: 'client',
|
||||
branch: 'master',
|
||||
},
|
||||
]
|
||||
}
|
||||
staticPreview: this.render({ score: 10.0 }),
|
||||
},
|
||||
]
|
||||
|
||||
async handle({ instance, user, repo, branch }) {
|
||||
return this.makeBadge({
|
||||
@@ -129,11 +117,9 @@ class ScrutinizerQualityGitLab extends ScrutinizerQualityBase {
|
||||
}
|
||||
|
||||
class ScrutinizerQualityPlainGit extends ScrutinizerQualityBase {
|
||||
static get route() {
|
||||
return {
|
||||
base: 'scrutinizer/quality/gp',
|
||||
pattern: ':slug/:branch*',
|
||||
}
|
||||
static route = {
|
||||
base: 'scrutinizer/quality/gp',
|
||||
pattern: ':slug/:branch*',
|
||||
}
|
||||
|
||||
async handle({ slug, branch }) {
|
||||
|
||||
Reference in New Issue
Block a user