Skip to content

Commit

Permalink
fix: backfill index on execution task logs (#725)
Browse files Browse the repository at this point in the history
* chore: backfill index on execution task logs

Signed-off-by: Carina Ursu <carina@union.ai>

* chore: add comments

Signed-off-by: Carina Ursu <carina@union.ai>

* chore: bump version

Signed-off-by: Carina Ursu <carina@union.ai>

* chore: remove backfill

Signed-off-by: Carina Ursu <carina@union.ai>

* chore: lint

Signed-off-by: Carina Ursu <carina@union.ai>

---------

Signed-off-by: Carina Ursu <carina@union.ai>
  • Loading branch information
ursucarina authored Mar 16, 2023
1 parent 80edd63 commit 426ce41
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
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

0 comments on commit 426ce41

Please sign in to comment.