* add file_url param
Add file_url param to allow pulling from non-github sources
* add test for file_url param
Add test using file_url variant of OSS Lifecycle badge using Netflix OSSTracker repo
* remove old pattern from main service
Remove all references and code for the old /{user}/{repo} and /{user}/{repo}/{branch} functionality.
This will be replaced by a redirect service.
Also updated all tests to use the new file_url method
* add osslifecycle redirector
add a redirector for the original osslifecycle pattern
* tweaks to docs and handle function
Tweak the Description to remove reference to GitHub as now works with any repository,
and updated handle function to remove reference to unused variables.
27 lines
748 B
JavaScript
27 lines
748 B
JavaScript
import queryString from 'querystring'
|
|
import { ServiceTester } from '../tester.js'
|
|
|
|
export const t = new ServiceTester({
|
|
id: 'osslifecycleRedirect',
|
|
title: 'OSSLifecycleRedirect',
|
|
pathPrefix: '/osslifecycle',
|
|
})
|
|
|
|
t.create('oss lifecycle redirect')
|
|
.get('/netflix/osstracker.svg')
|
|
.expectRedirect(
|
|
`/osslifecycle.svg?${queryString.stringify({
|
|
file_url:
|
|
'https://raw.githubusercontent.com/netflix/osstracker/HEAD/OSSMETADATA',
|
|
})}`,
|
|
)
|
|
|
|
t.create('oss lifecycle redirect (branch)')
|
|
.get('/netflix/osstracker/documentation.svg')
|
|
.expectRedirect(
|
|
`/osslifecycle.svg?${queryString.stringify({
|
|
file_url:
|
|
'https://raw.githubusercontent.com/netflix/osstracker/documentation/OSSMETADATA',
|
|
})}`,
|
|
)
|