Files
shields/services/scrutinizer/scrutinizer-redirect.service.js
Caleb Cartwright 07a8d2ecbe refactor [Scrutinizer] (#3266)
* refactor(Scrutinizer): migrated to new BaseJsonService

* refactor(ScrutinizerCoverage): updated color scale to match

* refactor(Scrutinizer): switched to multiple classes to handle dif. git hosts

* refactor(Scrutinizer): finished migrating to new service arch.

* fix(Scrutinizer): fixed branch check logic

* refactor(Scrutinizer): inline transforms based on PR feedback

* refactor(ScrutinizerCoverage): change handling of no coverage scenario
2019-04-26 21:50:28 -05:00

43 lines
984 B
JavaScript

'use strict'
const { redirector } = require('..')
const commonAttrs = {
category: 'analysis',
dateAdded: new Date('2019-04-24'),
}
module.exports = [
redirector({
route: {
base: 'scrutinizer',
pattern: ':vcs(g|b)/:user/:repo/:branch*',
},
transformPath: ({ vcs, user, repo, branch }) =>
`/scrutinizer/quality/${vcs}/${user}/${repo}${
branch ? `/${branch}` : ''
}`,
...commonAttrs,
}),
redirector({
route: {
base: 'scrutinizer/gl',
pattern: ':instance/:user/:repo/:branch*',
},
transformPath: ({ instance, user, repo, branch }) =>
`/scrutinizer/quality/gl/${instance}/${user}/${repo}${
branch ? `/${branch}` : ''
}`,
...commonAttrs,
}),
redirector({
route: {
base: 'scrutinizer/gp',
pattern: ':slug/:branch*',
},
transformPath: ({ slug, branch }) =>
`/scrutinizer/quality/gp/${slug}${branch ? `/${branch}` : ''}`,
...commonAttrs,
}),
]