Skip to content

Commit

Permalink
[RHOAIENG-14662] Remove deprecated pipeline v1 types
Browse files Browse the repository at this point in the history
  • Loading branch information
jpuzz0 committed Oct 23, 2024
1 parent 9d7dcab commit 9987f08
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 863 deletions.
35 changes: 1 addition & 34 deletions frontend/src/__mocks__/mockPipelineKF.ts
Original file line number Diff line number Diff line change
@@ -1,44 +1,11 @@
/* eslint-disable camelcase */
import {
PipelineKF,
PipelineKFv2,
RelationshipKF,
ResourceTypeKF,
} from '~/concepts/pipelines/kfTypes';
import { PipelineKFv2 } from '~/concepts/pipelines/kfTypes';

type MockResourceConfigType = {
name?: string;
id?: string;
};

/**
* @deprecated use buildMockPipelineV2 instead
*/
export const mockPipelineKF = ({
name = 'test-pipeline',
id = 'test-pipeline',
}: MockResourceConfigType): PipelineKF => ({
id,
created_at: '2023-11-23T17:16:37Z',
name,
description:
'[source code](https://github.com/opendatahub-io/data-science-pipelines/tree/master/samples/flip-coin) A conditional pipeline to flip coins based on a random number generator.',
default_version: {
id,
name,
created_at: '2023-11-23T17:16:37Z',
resource_references: [
{
key: {
type: ResourceTypeKF.PIPELINE,
id: name,
},
relationship: RelationshipKF.OWNER,
},
],
},
});

export const mockPipelineKFv2 = ({
name = 'test-pipeline',
id = 'test-pipeline',
Expand Down
242 changes: 0 additions & 242 deletions frontend/src/__mocks__/mockPipelineVersionsProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,205 +4,13 @@ import {
ArtifactType,
InputDefinitionParameterType,
PipelineKFCallCommon,
PipelineVersionKF,
PipelineVersionKFv2,
RelationshipKF,
ResourceTypeKF,
} from '~/concepts/pipelines/kfTypes';

export type BuildMockPipelinveVersionsType = PipelineKFCallCommon<{
pipeline_versions: (PipelineVersionKFv2 | ArgoWorkflowPipelineVersion)[];
}>;

/**
* @deprecated Use `mockPipelineVersionsListV2` instead.
*/
export const mockPipelineVersionsList: PipelineVersionKF[] = [
{
id: 'ad1b7153-d2fd-4e5e-ae12-30c824b19b03',
name: 'flip coin_version_at_2023-12-01T01:42:09.321Z',
created_at: '2023-12-01T01:42:15Z',
resource_references: [
{
key: {
type: ResourceTypeKF.PIPELINE,
id: '63a09bff-9261-43b9-a2a8-5f2158c5522e',
},
relationship: RelationshipKF.OWNER,
},
],
},
{
id: '1c0dd0b3-dcdf-4a5d-a4f1-9fda4e20aba6',
name: 'flip coin_version_at_2023-12-01T01:42:00.825Z',
created_at: '2023-12-01T01:42:06Z',
resource_references: [
{
key: {
type: ResourceTypeKF.PIPELINE,
id: '63a09bff-9261-43b9-a2a8-5f2158c5522e',
},
relationship: RelationshipKF.OWNER,
},
],
},
{
id: '94a67a78-be66-4b4a-88e7-1c0fdc3f2867',
name: 'flip coin_version_at_2023-12-01T01:41:31.560Z',
created_at: '2023-12-01T01:41:41Z',
resource_references: [
{
key: {
type: ResourceTypeKF.PIPELINE,
id: '63a09bff-9261-43b9-a2a8-5f2158c5522e',
},
relationship: RelationshipKF.OWNER,
},
],
},
{
id: '9c34cd40-7195-4030-b540-ef0779b30ce7',
name: 'flip coin_version_at_2023-12-01T01:41:23.391Z',
created_at: '2023-12-01T01:41:29Z',
resource_references: [
{
key: {
type: ResourceTypeKF.PIPELINE,
id: '63a09bff-9261-43b9-a2a8-5f2158c5522e',
},
relationship: RelationshipKF.OWNER,
},
],
},
{
id: 'eaa80f52-a6f9-4ba0-9fd7-bf067f339c5f',
name: 'flip coin_version_at_2023-12-01T01:41:14.845Z',
created_at: '2023-12-01T01:41:20Z',
resource_references: [
{
key: {
type: ResourceTypeKF.PIPELINE,
id: '63a09bff-9261-43b9-a2a8-5f2158c5522e',
},
relationship: RelationshipKF.OWNER,
},
],
},
{
id: '27bbb3e2-4a29-4701-9150-ebaabff63b97',
name: 'flip coin_version_at_2023-12-01T01:41:06.333Z',
created_at: '2023-12-01T01:41:12Z',
resource_references: [
{
key: {
type: ResourceTypeKF.PIPELINE,
id: '63a09bff-9261-43b9-a2a8-5f2158c5522e',
},
relationship: RelationshipKF.OWNER,
},
],
},
{
id: '6c3f2843-de1a-408c-8bd2-d68c1073b71c',
name: 'flip coin_version_at_2023-12-01T01:40:56.240Z',
created_at: '2023-12-01T01:41:03Z',
resource_references: [
{
key: {
type: ResourceTypeKF.PIPELINE,
id: '63a09bff-9261-43b9-a2a8-5f2158c5522e',
},
relationship: RelationshipKF.OWNER,
},
],
},
{
id: 'd2d51128-87b4-41c0-a519-d00237367b09',
name: 'flip coin_version_at_2023-12-01T01:40:43.847Z',
created_at: '2023-12-01T01:40:53Z',
resource_references: [
{
key: {
type: ResourceTypeKF.PIPELINE,
id: '63a09bff-9261-43b9-a2a8-5f2158c5522e',
},
relationship: RelationshipKF.OWNER,
},
],
},
{
id: '5a2013ef-067c-4221-925f-8cbff134189d',
name: 'flip coin_version_at_2023-12-01T01:40:28.425Z',
created_at: '2023-12-01T01:40:41Z',
resource_references: [
{
key: {
type: ResourceTypeKF.PIPELINE,
id: '63a09bff-9261-43b9-a2a8-5f2158c5522e',
},
relationship: RelationshipKF.OWNER,
},
],
},
{
id: '31222a28-9b8f-4553-b6d3-54b106a3e5f9',
name: 'flip coin_version_at_2023-12-01T01:36:34.957Zhdsfjkasdhflkdshfkldshfkladsfhlkadshfksdadsafadsf',
created_at: '2023-12-01T01:36:48Z',
resource_references: [
{
key: {
type: ResourceTypeKF.PIPELINE,
id: '63a09bff-9261-43b9-a2a8-5f2158c5522e',
},
relationship: RelationshipKF.OWNER,
},
],
description: 'dsafdsjkfsahfklsadhflkdsahfkldsfhlasdkhfksldahflkas',
},
{
id: '2f177ef7-6403-4933-acc0-714f556c8835',
name: 'flip coin_version_at_2023-12-01T00:45:29.894Zsdafjkdsalfjdsklfadlskgnakdg',
created_at: '2023-12-01T00:45:46Z',
resource_references: [
{
key: {
type: ResourceTypeKF.PIPELINE,
id: '63a09bff-9261-43b9-a2a8-5f2158c5522e',
},
relationship: RelationshipKF.OWNER,
},
],
},
{
id: '38fe6c54-69fd-4011-9ab4-55bcfdf1e1cd',
name: 'flip coin_version_at_2023-11-29T14:43:43.608Z',
created_at: '2023-11-29T14:44:00Z',
resource_references: [
{
key: {
type: ResourceTypeKF.PIPELINE,
id: '63a09bff-9261-43b9-a2a8-5f2158c5522e',
},
relationship: RelationshipKF.OWNER,
},
],
},
{
id: '63a09bff-9261-43b9-a2a8-5f2158c5522e',
name: 'flip coin',
created_at: '2023-10-03T15:37:54Z',
resource_references: [
{
key: {
type: ResourceTypeKF.PIPELINE,
id: '63a09bff-9261-43b9-a2a8-5f2158c5522e',
},
relationship: RelationshipKF.OWNER,
},
],
},
];

export const mockPipelineVersionsListV2: PipelineVersionKFv2[] = [
{
pipeline_id: 'f9ccf7d7-ceb6-41f2-a1a1-35f0ddef0921',
Expand Down Expand Up @@ -433,22 +241,6 @@ export const mockPipelineVersionsListV2: PipelineVersionKFv2[] = [
},
];

export const buildMockPipelineVersion = (
pipelineVersion?: Partial<PipelineVersionKF>,
): PipelineVersionKF => ({
id: '8ce2d041-3eb9-41a0-828c-45209fdf1c20',
name: 'version-1',
created_at: '2023-12-07T16:08:01Z',
resource_references: [
{
key: { type: ResourceTypeKF.PIPELINE, id: 'b2ff4cbf-f7f5-4c8a-b454-906bd9b00510' },
relationship: RelationshipKF.OWNER,
},
],
description: 'test',
...pipelineVersion,
});

export const buildMockPipelineVersionV2 = (
pipelineVersion?: Partial<PipelineVersionKFv2>,
): PipelineVersionKFv2 => {
Expand Down Expand Up @@ -723,20 +515,6 @@ export const buildMockPipelineVersionV2 = (
};
};

export const buildMockPipelineVersions = (
versions: PipelineVersionKF[] = mockPipelineVersionsList,
totalSize?: number,
nextPageToken?: string,
): {
total_size?: number | undefined;
next_page_token?: string | undefined;
versions: PipelineVersionKF[];
} => ({
versions,
total_size: totalSize || versions.length,
next_page_token: nextPageToken,
});

export const buildMockPipelineVersionsV2 = (
pipeline_versions: (
| PipelineVersionKFv2
Expand All @@ -750,26 +528,6 @@ export const buildMockPipelineVersionsV2 = (
next_page_token: nextPageToken,
});

export const mockPipelineVersionsListPage1 = buildMockPipelineVersions(
mockPipelineVersionsList.slice(0, 10),
mockPipelineVersionsList.length,
'next-page-token',
);

export const mockPipelineVersionsListPage2 = buildMockPipelineVersions(
mockPipelineVersionsList.slice(10),
mockPipelineVersionsList.length,
);

export const mockPipelineVersionsListSearch = (
search: string,
): ReturnType<typeof buildMockPipelineVersions> => {
const filteredVersions = mockPipelineVersionsList
.filter((version) => version.name.startsWith(search))
.slice(0, 10);
return buildMockPipelineVersions(filteredVersions, filteredVersions.length);
};

type MockArgoWorkflowPipelineVersionType = {
pipelineId?: string;
pipelineVersionId?: string;
Expand Down
Loading

0 comments on commit 9987f08

Please sign in to comment.