mirror of
https://github.com/dadosfera/maestro.git
synced 2026-10-13 09:19:09 +00:00
FEAT: simplify pipeline run jobs handling and normalize run ID usage
This commit is contained in:
@@ -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 ====================
|
||||
|
||||
Reference in New Issue
Block a user