Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: task recent runs should filter by version #759

Merged
merged 2 commits into from
May 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/console/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@flyteorg/console",
"version": "0.0.33",
"version": "0.0.34",
"description": "Flyteconsole main app module",
"main": "./dist/index.js",
"module": "./lib/index.js",
Expand Down
63 changes: 31 additions & 32 deletions packages/console/src/components/Entities/generators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,56 +16,55 @@ export const executionFilterGenerator: {
) => FilterOperation[];
} = {
[ResourceType.DATASET]: noFilters,
[ResourceType.LAUNCH_PLAN]: ({ name }, version) =>
version
[ResourceType.LAUNCH_PLAN]: ({ name }, version) => [
{
key: 'launch_plan.name',
operation: FilterOperationName.EQ,
value: name,
},
...(version
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] we can actually also use && to make it more concise

...(version && [...])

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i did it that way because there's a difference between
[1,2, ...[]] and [1,2,...undefined]

? [
{
key: 'launch_plan.name',
operation: FilterOperationName.EQ,
value: name,
},
{
key: 'launch_plan.version',
operation: FilterOperationName.EQ,
value: version,
},
]
: [
{
key: 'launch_plan.name',
operation: FilterOperationName.EQ,
value: name,
},
],
[ResourceType.TASK]: ({ name }) => [
: []),
],
[ResourceType.TASK]: ({ name }, version) => [
{
key: 'task.name',
operation: FilterOperationName.EQ,
value: name,
},
],
[ResourceType.UNSPECIFIED]: noFilters,
[ResourceType.WORKFLOW]: ({ name }, version) =>
version
...(version
? [
{
key: 'workflow.version',
operation: FilterOperationName.EQ,
value: version,
},
{
key: 'workflow.name',
operation: FilterOperationName.EQ,
value: name,
},
]
: [
: []),
],
[ResourceType.UNSPECIFIED]: noFilters,
[ResourceType.WORKFLOW]: ({ name }, version) => [
{
key: 'workflow.name',
operation: FilterOperationName.EQ,
value: name,
},
...(version
? [
{
key: 'workflow.name',
key: 'workflow.version',
operation: FilterOperationName.EQ,
value: name,
value: version,
},
],
]
: []),
],
};

const workflowListGenerator = ({ project, domain }: ResourceIdentifier) =>
Expand All @@ -75,14 +74,14 @@ const launchPlanListGenerator = ({ project, domain }: ResourceIdentifier) =>
const taskListGenerator = ({ project, domain }: ResourceIdentifier) =>
Routes.ProjectDetails.sections.tasks.makeUrl(project, domain);
const unspecifiedGenerator = ({
project,
domain,
project: _project,
domain: _domain,
}: ResourceIdentifier | Identifier) => {
throw new Error('Unspecified Resourcetype.');
};
const unimplementedGenerator = ({
project,
domain,
project: _project,
domain: _domain,
}: ResourceIdentifier | Identifier) => {
throw new Error('Method not implemented.');
};
Expand Down
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"dependencies": {
"@flyteorg/common": "^0.0.4",
"@flyteorg/console": "^0.0.33",
"@flyteorg/console": "^0.0.34",
"long": "^4.0.0",
"protobufjs": "~6.11.3",
"react-ga4": "^1.4.1",
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2020,7 +2020,7 @@ __metadata:
resolution: "@flyteconsole/client-app@workspace:website"
dependencies:
"@flyteorg/common": ^0.0.4
"@flyteorg/console": ^0.0.33
"@flyteorg/console": ^0.0.34
"@types/long": ^3.0.32
long: ^4.0.0
protobufjs: ~6.11.3
Expand Down Expand Up @@ -2059,7 +2059,7 @@ __metadata:
languageName: unknown
linkType: soft

"@flyteorg/console@^0.0.33, @flyteorg/console@workspace:packages/console":
"@flyteorg/console@^0.0.34, @flyteorg/console@workspace:packages/console":
version: 0.0.0-use.local
resolution: "@flyteorg/console@workspace:packages/console"
dependencies:
Expand Down