removed all references to the removed SCM-specific location types

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-02-17 14:48:29 +01:00
parent 4d32ee5dac
commit 209fd128e6
16 changed files with 41 additions and 143 deletions
@@ -57,7 +57,7 @@ describe('DefaultApiExplorerPage', () => {
] as Entity[],
}),
getLocationByRef: () =>
Promise.resolve({ id: 'id', type: 'github', target: 'url' }),
Promise.resolve({ id: 'id', type: 'url', target: 'url' }),
getEntityByName: async entityName => {
return {
apiVersion: 'backstage.io/v1alpha1',
@@ -35,11 +35,11 @@ const entity = {
const location: Record<string, LocationSpec> = {
x: {
type: 'github',
type: 'url',
target: 'https://github.com/a/b/blob/master/x.yaml',
},
y: {
type: 'github',
type: 'url',
target: 'https://github.com/a/b/blob/master/y.yaml',
},
z: {
@@ -180,7 +180,7 @@ describe('DefaultCatalogRulesEnforcer', () => {
rules: [{ allow: ['user'] }],
locations: [
{
type: 'github',
type: 'url',
target: 'https://github.com/a/b/blob/master/x.yaml',
rules: [
{
@@ -204,7 +204,7 @@ describe('DefaultCatalogRulesEnforcer', () => {
const enforcer = DefaultCatalogRulesEnforcer.fromConfig(
new ConfigReader({
catalog: {
rules: [{ allow: ['Group'], locations: [{ type: 'github' }] }],
rules: [{ allow: ['Group'], locations: [{ type: 'url' }] }],
},
}),
);
@@ -27,7 +27,7 @@ const mockCodeOwnersText = () => `
describe('CodeOwnersProcessor', () => {
const mockLocation = ({
basePath = '',
type = 'github',
type = 'url',
} = {}): LocationSpec => ({
type,
target: `https://github.com/backstage/backstage/blob/master/${basePath}catalog-info.yaml`,
@@ -27,15 +27,7 @@ import { CatalogProcessor } from './types';
const ALLOWED_KINDS = ['API', 'Component', 'Domain', 'Resource', 'System'];
const ALLOWED_LOCATION_TYPES = [
'url',
'azure/api',
'bitbucket/api',
'github',
'github/api',
'gitlab',
'gitlab/api',
];
const ALLOWED_LOCATION_TYPES = ['url'];
export class CodeOwnersProcessor implements CatalogProcessor {
private readonly integrations: ScmIntegrationRegistry;
@@ -154,7 +154,7 @@ describe('PlaceholderProcessor', () => {
spec: { data: { $text: '../file.txt' } },
},
{
type: 'github',
type: 'url',
target:
'https://github.com/backstage/backstage/a/b/catalog-info.yaml',
},
@@ -190,7 +190,7 @@ describe('PlaceholderProcessor', () => {
spec: { data: { $json: './file.json' } },
},
{
type: 'github',
type: 'url',
target:
'https://github.com/backstage/backstage/a/b/catalog-info.yaml',
},
@@ -224,7 +224,7 @@ describe('PlaceholderProcessor', () => {
spec: { data: { $yaml: '../file.yaml' } },
},
{
type: 'github',
type: 'url',
target:
'https://github.com/backstage/backstage/a/b/catalog-info.yaml',
},
@@ -262,7 +262,7 @@ describe('PlaceholderProcessor', () => {
},
},
{
type: 'github',
type: 'url',
target:
'https://github.com/backstage/backstage/a/b/catalog-info.yaml',
},
@@ -300,7 +300,7 @@ describe('PlaceholderProcessor', () => {
},
},
{
type: 'github',
type: 'url',
target: './a/b/catalog-info.yaml',
},
),
@@ -340,7 +340,7 @@ describe('PlaceholderProcessor', () => {
},
},
{
type: 'github',
type: 'url',
target: './a/b/catalog-info.yaml',
},
),
@@ -101,7 +101,7 @@ describe('DefaultCatalogPage', () => {
] as Entity[],
}),
getLocationByRef: () =>
Promise.resolve({ id: 'id', type: 'github', target: 'url' }),
Promise.resolve({ id: 'id', type: 'url', target: 'url' }),
getEntityByName: async entityName => {
return {
apiVersion: 'backstage.io/v1alpha1',
+1 -1
View File
@@ -28,7 +28,7 @@ const getBaseUrl = (
}
const location = parseLocationRef(host);
if (location.type !== 'github' && location.type !== 'url') {
if (location.type !== 'url') {
return 'https://api.github.com';
}
@@ -254,7 +254,7 @@ describe('github-deployments', () => {
entity.entity.metadata.annotations = {
'github.com/project-slug': 'org/repo',
'backstage.io/source-location':
'github:https://my-github-1.com/org/repo/tree/master/',
'url:https://my-github-1.com/org/repo/tree/master/',
};
});
@@ -276,7 +276,7 @@ describe('github-deployments', () => {
entity.entity.metadata.annotations = {
'github.com/project-slug': 'org/repo',
'backstage.io/managed-by-location':
'github:https://my-github-2.com/org/repo/blob/master/catalog-info.yaml',
'url:https://my-github-2.com/org/repo/blob/master/catalog-info.yaml',
};
});
@@ -298,7 +298,7 @@ describe('github-deployments', () => {
entity.entity.metadata.annotations = {
'github.com/project-slug': 'org/repo',
'backstage.io/managed-by-location':
'github:https://my-github-3.com/org/repo/blob/master/catalog-info.yaml',
'url:https://my-github-3.com/org/repo/blob/master/catalog-info.yaml',
};
});
@@ -323,7 +323,7 @@ describe('github-deployments', () => {
entity.entity.metadata.annotations = {
'github.com/project-slug': 'org/repo',
'backstage.io/managed-by-location':
'github:https://my-github-unknown.com/org/repo/blob/master/catalog-info.yaml',
'url:https://my-github-unknown.com/org/repo/blob/master/catalog-info.yaml',
};
});