FEAT: simplify pipeline run jobs handling and normalize run ID usage

This commit is contained in:
iruy-fr
2026-06-23 11:54:59 -03:00
parent 63efff6adf
commit 17363e74f4
3 changed files with 18 additions and 141 deletions
@@ -782,10 +782,10 @@ export class PlatformApiController {
@User() user: RequestUser,
) {
const normalizedPipelineId = this.normalizePipelineId(pipelineId);
const decodedRunId = this.decodePathParam(runId);
const normalizedRunId = this.normalizePipelineId(runId);
return this.platformApiService.proxy(
'GET',
`/pipeline/${normalizedPipelineId}/pipeline_run/${decodedRunId}`,
`/pipeline/${normalizedPipelineId}/pipeline_run/${normalizedRunId}`,
user,
);
}
@@ -798,10 +798,10 @@ export class PlatformApiController {
@User() user: RequestUser,
@Query() query: Record<string, string>,
) {
const decodedRunId = this.decodePathParam(runId);
const normalizedRunId = this.normalizePipelineId(runId);
return this.platformApiService.proxy(
'GET',
`/pipeline/pipeline_run/${decodedRunId}/logs`,
`/pipeline/pipeline_run/${normalizedRunId}/logs`,
user,
undefined,
query,
@@ -817,7 +817,7 @@ export class PlatformApiController {
@User() user: RequestUser,
) {
const normalizedPipelineId = this.normalizePipelineId(pipelineId);
const decodedRunId = this.decodePathParam(runId);
const normalizedRunId = this.normalizePipelineId(runId);
const status = await this.platformApiService.proxy(
'GET',
@@ -831,7 +831,7 @@ export class PlatformApiController {
return this.platformApiService.proxy(
'POST',
`/pipeline/${normalizedPipelineId}/pipeline_run/${decodedRunId}/cancel`,
`/pipeline/${normalizedPipelineId}/pipeline_run/${normalizedRunId}/cancel`,
user,
);
}
@@ -863,23 +863,11 @@ export class PlatformApiController {
const normalizedPipelineId = this.normalizePipelineId(pipelineId);
const decodedRunId = this.decodePathParam(runId);
try {
return await this.platformApiService.proxy(
'GET',
`/pipeline/${normalizedPipelineId}/pipeline_run/${decodedRunId}/jobs`,
user,
);
} catch (error) {
if (error instanceof HttpException && error.getStatus() === 404) {
this.logger.warn('Platform API pipeline run jobs not found; returning empty jobs list', {
pipelineId: normalizedPipelineId,
runId: decodedRunId,
});
return { jobs: [] };
}
throw error;
}
return this.platformApiService.proxy(
'GET',
`/pipeline/${normalizedPipelineId}/pipeline_run/${decodedRunId}/jobs`,
user,
);
}
// ==================== JOBS - COLUMN EDITING ROUTES ====================