-
Notifications
You must be signed in to change notification settings - Fork 267
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
Git resource logs are not surfaced so Pipeline fails with no logs #200
Comments
/assign @carlos-logro |
After investigating the reason behind the logs not being shown, I found out that some of the steps are being filtered in the loadTaskRuns = (pipelineRun, taskRunNames) => {
let runs = taskRunNames.map(taskRunName =>
getTaskRun(store.getState(), { name: taskRunName })
);
const {
status: { taskRuns: taskRunDetails }
} = pipelineRun;
runs = runs.map(taskRun => {
const taskName = taskRun.spec.taskRef.name;
const task = selectedTask(taskName, this.props.tasks);
const taskRunName = taskRun.metadata.name;
const { reason, status: succeeded } = getStatus(taskRun);
const { pipelineTaskName } = taskRunDetails[taskRunName];
const steps = stepsStatus(task.spec.steps, taskRun.status.steps);
return {
id: taskRun.metadata.uid,
pipelineTaskName,
pod: taskRun.status.podName,
reason,
steps,
succeeded,
taskName,
taskRunName
};
});
return runs;
}; The filtering part is done with the help of the stepsStatus util fn: export function stepsStatus(taskSteps, taskRunStepsStatus = []) {
const steps = taskSteps.map(step => {
const stepStatus =
taskRunStepsStatus.find(status => status.name === step.name) || {};
let status;
let reason;
if (stepStatus.terminated) {
status = 'terminated';
({ reason } = stepStatus.terminated);
} else if (stepStatus.running) {
status = 'running';
} else if (stepStatus.waiting) {
status = 'waiting';
}
return {
...step,
reason,
status,
stepStatus,
stepName: step.name,
id: step.name
};
});
return steps;
} Apparently the filtered steps were the ones containing the errors logs so to show all the steps I just made this simple edit to the util fn: export function stepsStatus(taskSteps, taskRunStepsStatus = []) {
// const steps = taskSteps.map(step => {
const steps = taskRunStepsStatus.map(step => {
// const stepStatus =
// taskRunStepsStatus.find(status => status.name === step.name) || {};
const stepStatus = step;
let status;
let reason;
if (stepStatus.terminated) {
status = 'terminated';
({ reason } = stepStatus.terminated);
} else if (stepStatus.running) {
status = 'running';
} else if (stepStatus.waiting) {
status = 'waiting';
}
return {
...step,
reason,
status,
stepStatus,
stepName: step.name,
id: step.name
};
});
return steps;
} @AlanGreene, as you can see now all the steps are shown but the log message is too raw to be readable, also in this particular case, the selected step name is too long & lastly, the steps after the fail one have an 'OK' state but they actually never ran so I think we should add a state that is neither 'OK' nor |
The As far as I remember the reason for using the |
I propose we keep the logic it has right now but double check the taskRunSteps array to see if one of the elements has an error & if that so then include in the task tree if not then omit it like its been doing. what do you guys think?? |
/assign |
Expected Behavior
If there is a problem in accessing the Git repo that has been defined in the Git
PipelineResource
(this is reported in one of the init containers that runs before any defined tasks for mounting resources) this should be surfaced in thePipelineRun
details/logs to show what went wrong e.g. credentials weren't valid or the repo doesn't existActual Behavior
What is actually shown is a strange combination of a
PipelineRun
whose task reports as succeeding but with no logs and a failed overall viewSteps to Reproduce the Problem
PipelineRun
with associatedPipelineResource
but use an invalid repo or have lacking credentials to access the repoPipelineRun
page and observe the aboveThe text was updated successfully, but these errors were encountered: