From f6a5b666078313632a065321c81932d958360dce Mon Sep 17 00:00:00 2001 From: StanleyJochman Date: Tue, 14 Jan 2025 15:32:39 +0100 Subject: [PATCH] fix(KONFLUX-6398): fixes swapped pid and taskRunID --- src/shared/components/pipeline-run-logs/logs/logs-utils.ts | 2 +- src/utils/__tests__/tekton-results.spec.ts | 2 +- src/utils/tekton-results.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/shared/components/pipeline-run-logs/logs/logs-utils.ts b/src/shared/components/pipeline-run-logs/logs/logs-utils.ts index 1d437e44..46cc8783 100644 --- a/src/shared/components/pipeline-run-logs/logs/logs-utils.ts +++ b/src/shared/components/pipeline-run-logs/logs/logs-utils.ts @@ -154,8 +154,8 @@ export const getDownloadAllLogsCallback = ( allLogs += await getTaskRunLog( workspace, namespace, - pipelineRunUID, taskRun?.metadata?.uid, + pipelineRunUID, ).then((log) => `${tasks[currTask].name.toUpperCase()}\n\n${log}\n\n`); } } diff --git a/src/utils/__tests__/tekton-results.spec.ts b/src/utils/__tests__/tekton-results.spec.ts index 327b1151..762fdabf 100644 --- a/src/utils/__tests__/tekton-results.spec.ts +++ b/src/utils/__tests__/tekton-results.spec.ts @@ -580,7 +580,7 @@ describe('tekton-results', () => { it('should return the latest component build task run', async () => { commonFetchJSONMock.mockReturnValueOnce(mockLogsRecordsList); commonFetchTextMock.mockReturnValueOnce(Promise.resolve(mockLogResponse)); - expect(await getTaskRunLog('test-ws', 'test-ns', 'pipelinerun-uid', 'test-id')).toEqual( + expect(await getTaskRunLog('test-ws', 'test-ns', 'test-id', 'pipelinerun-uid')).toEqual( 'sample log', ); expect(commonFetchTextMock.mock.calls).toEqual([ diff --git a/src/utils/tekton-results.ts b/src/utils/tekton-results.ts index 8b957715..83c3811c 100644 --- a/src/utils/tekton-results.ts +++ b/src/utils/tekton-results.ts @@ -346,8 +346,8 @@ export const getTaskRuns = ( export const getTaskRunLog = ( workspace: string, namespace: string, - pid: string, taskRunID: string, + pid: string, ): Promise => commonFetchText( `${getTRUrlPrefix(workspace)}/${namespace}/results/${pid}/logs/${taskRunID}`,