chore: make the required changes to get the build to pass, and implement review feedback
Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
---
|
||||
'@backstage/catalog-model': patch
|
||||
'@backstage/catalog-model': minor
|
||||
---
|
||||
|
||||
Introduced DefaultParentEntityPolicy to set a default group entity parent.
|
||||
Introduced `GroupDefaultParentEntityPolicy` to set a default group entity parent.
|
||||
|
||||
@@ -108,13 +108,6 @@ export class DefaultNamespaceEntityPolicy implements EntityPolicy {
|
||||
enforce(entity: Entity): Promise<Entity>;
|
||||
}
|
||||
|
||||
// @public
|
||||
export class DefaultParentEntityPolicy implements EntityPolicy {
|
||||
constructor(parent: string);
|
||||
// (undocumented)
|
||||
enforce(entity: Entity): Promise<Entity>;
|
||||
}
|
||||
|
||||
// @public
|
||||
interface DomainEntityV1alpha1 extends Entity {
|
||||
// (undocumented)
|
||||
@@ -237,6 +230,13 @@ export function getEntitySourceLocation(entity: Entity): {
|
||||
target: string;
|
||||
};
|
||||
|
||||
// @public
|
||||
export class GroupDefaultParentEntityPolicy implements EntityPolicy {
|
||||
constructor(parentEntityRef: string);
|
||||
// (undocumented)
|
||||
enforce(entity: Entity): Promise<Entity>;
|
||||
}
|
||||
|
||||
// @public
|
||||
interface GroupEntityV1alpha1 extends Entity {
|
||||
// (undocumented)
|
||||
|
||||
+5
-5
@@ -15,11 +15,11 @@
|
||||
*/
|
||||
|
||||
import { UserEntity, GroupEntity } from '../../kinds';
|
||||
import { DefaultParentEntityPolicy } from './DefaultParentEntityPolicy';
|
||||
import { GroupDefaultParentEntityPolicy } from './GroupDefaultParentEntityPolicy';
|
||||
|
||||
describe('DefaultParentEntityPolicy', () => {
|
||||
describe('GroupDefaultParentEntityPolicy', () => {
|
||||
it('should ignore non-group entities', async () => {
|
||||
const p = new DefaultParentEntityPolicy('name');
|
||||
const p = new GroupDefaultParentEntityPolicy('name');
|
||||
const u: UserEntity = {
|
||||
apiVersion: 'backstage.io/v1alpha1',
|
||||
kind: 'User',
|
||||
@@ -36,7 +36,7 @@ describe('DefaultParentEntityPolicy', () => {
|
||||
});
|
||||
|
||||
it('should parent group entities', async () => {
|
||||
const p = new DefaultParentEntityPolicy('name');
|
||||
const p = new GroupDefaultParentEntityPolicy('name');
|
||||
const g: GroupEntity = {
|
||||
apiVersion: 'backstage.io/v1alpha1',
|
||||
kind: 'Group',
|
||||
@@ -53,7 +53,7 @@ describe('DefaultParentEntityPolicy', () => {
|
||||
});
|
||||
|
||||
it('should not replace existing parents', async () => {
|
||||
const p = new DefaultParentEntityPolicy('namespace/name');
|
||||
const p = new GroupDefaultParentEntityPolicy('namespace/name');
|
||||
const g: GroupEntity = {
|
||||
apiVersion: 'backstage.io/v1alpha1',
|
||||
kind: 'Group',
|
||||
+1
-1
@@ -28,7 +28,7 @@ import { parseEntityRef, stringifyEntityRef } from '../ref';
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export class DefaultParentEntityPolicy implements EntityPolicy {
|
||||
export class GroupDefaultParentEntityPolicy implements EntityPolicy {
|
||||
private readonly parentRef: string;
|
||||
|
||||
constructor(parentEntityRef: string) {
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
export { DefaultNamespaceEntityPolicy } from './DefaultNamespaceEntityPolicy';
|
||||
export { DefaultParentEntityPolicy } from './DefaultParentEntityPolicy';
|
||||
export { GroupDefaultParentEntityPolicy } from './GroupDefaultParentEntityPolicy';
|
||||
export { FieldFormatEntityPolicy } from './FieldFormatEntityPolicy';
|
||||
export { NoForeignRootFieldsEntityPolicy } from './NoForeignRootFieldsEntityPolicy';
|
||||
export { SchemaValidEntityPolicy } from './SchemaValidEntityPolicy';
|
||||
|
||||
Reference in New Issue
Block a user