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: backfill index on execution task logs #725

Merged
merged 5 commits into from
Mar 16, 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.13",
"version": "0.0.14",
"description": "Flyteconsole main app module",
"main": "./dist/index.js",
"module": "./lib/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ export const getGroupedLogs = (
// if there is no log with active url, just create an item with externalId,
// for user to understand which array items are in this state
const newLogs =
item.logs.length > 0 ? item.logs : [{ name: item.externalId }];
item.logs.length > 0
? item.logs.map(l => ({ ...l, index: item.index }))
: [{ name: item.externalId, index: item.index }];
logsByPhase.set(
phase,
currentValue ? [...currentValue, ...newLogs] : [...newLogs],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const TaskNameList = ({

return (
<>
{logs.map((log, taskIndex) => {
{logs.map((log, _taskIndex) => {
const taskLogName = getTaskLogName(
taskExecution.id.taskId.name,
log.name ?? '',
Expand All @@ -57,7 +57,11 @@ export const TaskNameList = ({
)?.cacheStatus;

const handleClick = () => {
onTaskSelected({ ...taskExecution, taskIndex });
// Use the resource's index instead of the log index
onTaskSelected({
...taskExecution,
taskIndex: (log as any).index || 0,
});
};

return (
Expand Down