Use route patterns in [snap-ci nsp gratipay githubmanifest codacy cauditor bithound] (#3327)
Ref #3329
This commit is contained in:
@@ -6,7 +6,7 @@ module.exports = deprecatedService({
|
||||
category: 'dependencies',
|
||||
route: {
|
||||
base: 'bithound',
|
||||
format: '(?:code/|dependencies/|devDependencies/)?(?:.+?)',
|
||||
pattern: ':various*',
|
||||
},
|
||||
label: 'bithound',
|
||||
dateAdded: new Date('2018-07-08'),
|
||||
|
||||
@@ -6,7 +6,7 @@ module.exports = deprecatedService({
|
||||
category: 'other',
|
||||
route: {
|
||||
base: 'cauditor',
|
||||
format: '(?:mi|ccn|npath|hi|i|ca|ce|dit)/(?:[^/]+)/(?:[^/]+)/(?:.+)',
|
||||
pattern: ':various*',
|
||||
},
|
||||
label: 'cauditor',
|
||||
dateAdded: new Date('2018-02-15'),
|
||||
|
||||
@@ -21,8 +21,7 @@ module.exports = class CodacyCoverage extends BaseSvgScrapingService {
|
||||
static get route() {
|
||||
return {
|
||||
base: 'codacy/coverage',
|
||||
format: '(?!grade/)([^/]+)(?:/(.+))?',
|
||||
capture: ['projectId', 'branch'],
|
||||
pattern: ':projectId/:branch*',
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,8 +14,7 @@ module.exports = class CodacyGrade extends BaseSvgScrapingService {
|
||||
static get route() {
|
||||
return {
|
||||
base: 'codacy/grade',
|
||||
format: '(?:grade/)?(?!coverage/)([^/]+)(?:/(.+))?',
|
||||
capture: ['projectId', 'branch'],
|
||||
pattern: ':projectId/:branch*',
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,21 +4,21 @@ const t = (module.exports = require('../tester').createServiceTester())
|
||||
const { codacyGrade } = require('./codacy-helpers')
|
||||
|
||||
t.create('Code quality')
|
||||
.get('/grade/e27821fb6289410b8f58338c7e0bc686.json')
|
||||
.get('/e27821fb6289410b8f58338c7e0bc686.json')
|
||||
.expectBadge({
|
||||
label: 'code quality',
|
||||
message: codacyGrade,
|
||||
})
|
||||
|
||||
t.create('Code quality on branch')
|
||||
.get('/grade/e27821fb6289410b8f58338c7e0bc686/master.json')
|
||||
.get('/e27821fb6289410b8f58338c7e0bc686/master.json')
|
||||
.expectBadge({
|
||||
label: 'code quality',
|
||||
message: codacyGrade,
|
||||
})
|
||||
|
||||
t.create('Code quality (package not found)')
|
||||
.get('/grade/00000000000000000000000000000000/master.json')
|
||||
.get('/00000000000000000000000000000000/master.json')
|
||||
.expectBadge({
|
||||
label: 'code quality',
|
||||
message: 'project or branch not found',
|
||||
|
||||
@@ -83,8 +83,7 @@ class DynamicGithubManifest extends ConditionalGithubAuthService {
|
||||
static get route() {
|
||||
return {
|
||||
base: 'github/manifest-json',
|
||||
format: '(?!v)([^/]+)/([^/]+)/([^/]+)/?([^/]+)?',
|
||||
capture: ['key', 'user', 'repo', 'branch'],
|
||||
pattern: ':key([^v/][^/]*)/:user/:repo/:branch*',
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,14 +12,14 @@ module.exports = [
|
||||
deprecatedService({
|
||||
route: {
|
||||
base: 'gittip',
|
||||
pattern: ':various?',
|
||||
pattern: ':various*',
|
||||
},
|
||||
...commonAttrs,
|
||||
}),
|
||||
deprecatedService({
|
||||
route: {
|
||||
base: 'gratipay',
|
||||
pattern: ':various?',
|
||||
pattern: ':various*',
|
||||
},
|
||||
...commonAttrs,
|
||||
}),
|
||||
|
||||
@@ -5,7 +5,7 @@ const { deprecatedService } = require('..')
|
||||
module.exports = deprecatedService({
|
||||
route: {
|
||||
base: 'nsp/npm',
|
||||
format: '(?:.+)',
|
||||
pattern: ':various*',
|
||||
},
|
||||
label: 'nsp',
|
||||
category: 'other',
|
||||
|
||||
@@ -12,14 +12,14 @@ module.exports = [
|
||||
deprecatedService({
|
||||
route: {
|
||||
base: 'snap',
|
||||
format: '(?:[^/]+/[^/]+)(?:/(?:.+))',
|
||||
pattern: ':various*',
|
||||
},
|
||||
...commonAttrs,
|
||||
}),
|
||||
deprecatedService({
|
||||
route: {
|
||||
base: 'snap-ci',
|
||||
format: '(?:[^/]+/[^/]+)(?:/(?:.+))',
|
||||
pattern: ':various*',
|
||||
},
|
||||
...commonAttrs,
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user