deprecate parseEntityName
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
import { resolvePackagePath } from '@backstage/backend-common';
|
||||
import { NotFoundError } from '@backstage/errors';
|
||||
import { parseEntityName, stringifyEntityRef } from '@backstage/catalog-model';
|
||||
import { parseEntityRef, stringifyEntityRef } from '@backstage/catalog-model';
|
||||
import { Knex } from 'knex';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { aggregateCoverage } from './CoverageUtils';
|
||||
@@ -103,7 +103,7 @@ export class CodeCoverageDatabase implements CodeCoverageStore {
|
||||
.map(r => JSON.parse(r.coverage))
|
||||
.map(c => aggregateCoverage(c));
|
||||
|
||||
const entityName = parseEntityName(entity);
|
||||
const entityName = parseEntityRef(entity);
|
||||
|
||||
return {
|
||||
entity: {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { parseEntityName } from '@backstage/catalog-model';
|
||||
import { parseEntityRef } from '@backstage/catalog-model';
|
||||
import { entityRouteRef } from '@backstage/plugin-catalog-react';
|
||||
import { Box } from '@material-ui/core';
|
||||
import LanguageIcon from '@material-ui/icons/Language';
|
||||
@@ -57,7 +57,7 @@ export const TaskPageLinks = ({ output }: TaskPageLinksProps) => {
|
||||
.filter(({ url, entityRef }) => url || entityRef)
|
||||
.map(({ url, entityRef, title, icon }) => {
|
||||
if (entityRef) {
|
||||
const entityName = parseEntityName(entityRef);
|
||||
const entityName = parseEntityRef(entityRef);
|
||||
const target = entityRoute(entityName);
|
||||
return { title, icon, url: target };
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import { rsort } from 'semver';
|
||||
import { groupBy, omit } from 'lodash';
|
||||
import { DateTime } from 'luxon';
|
||||
import { Logger } from 'winston';
|
||||
import { parseEntityName, stringifyEntityRef } from '@backstage/catalog-model';
|
||||
import { parseEntityRef, stringifyEntityRef } from '@backstage/catalog-model';
|
||||
import { isMaxItems, isTtl } from '../fact/factRetrievers/utils';
|
||||
|
||||
type Transaction = Knex.Transaction;
|
||||
@@ -161,7 +161,7 @@ export class TechInsightsDatabase implements TechInsightsStore {
|
||||
|
||||
return groupBy(
|
||||
results.map(it => {
|
||||
const { namespace, kind, name } = parseEntityName(it.entity);
|
||||
const { namespace, kind, name } = parseEntityRef(it.entity);
|
||||
const timestamp =
|
||||
typeof it.timestamp === 'string'
|
||||
? DateTime.fromISO(it.timestamp)
|
||||
@@ -253,7 +253,7 @@ export class TechInsightsDatabase implements TechInsightsStore {
|
||||
|
||||
private dbFactRowsToTechInsightFacts(rows: RawDbFactRow[]) {
|
||||
return rows.reduce((acc, it) => {
|
||||
const { namespace, kind, name } = parseEntityName(it.entity);
|
||||
const { namespace, kind, name } = parseEntityRef(it.entity);
|
||||
const timestamp =
|
||||
typeof it.timestamp === 'string'
|
||||
? DateTime.fromISO(it.timestamp)
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { EntityName, parseEntityName } from '@backstage/catalog-model';
|
||||
import { EntityName, parseEntityRef } from '@backstage/catalog-model';
|
||||
import { InputError } from '@backstage/errors';
|
||||
import express from 'express';
|
||||
import Router from 'express-promise-router';
|
||||
@@ -55,7 +55,7 @@ export async function createRouter(
|
||||
let entity: EntityName | undefined = undefined;
|
||||
if (entityRef) {
|
||||
try {
|
||||
entity = parseEntityName(entityRef);
|
||||
entity = parseEntityRef(entityRef);
|
||||
} catch (error) {
|
||||
throw new InputError(`Invalid entity ref, ${error}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user