Skip to content

Commit

Permalink
Revert "fix(core): conditionally hide expression evaluation warning m…
Browse files Browse the repository at this point in the history
…essages (#9771)"

This reverts commit 7e3dd50.
  • Loading branch information
mattgogerly committed Aug 30, 2023
1 parent db06e88 commit 6c018b7
Showing 1 changed file with 10 additions and 24 deletions.
34 changes: 10 additions & 24 deletions packages/core/src/pipeline/details/StageFailureMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,33 +73,19 @@ export class StageFailureMessage extends React.Component<IStageFailureMessagePro
}

public render() {
const { message, messages, stage } = this.props;
const { message, messages } = this.props;
const { isFailed, failedTask, failedExecutionId, failedStageName, failedStageId } = this.state;

let stageMessages = message && !messages.length ? [message] : messages;
if (stageMessages.length > 0) {
if (isFailed || failedTask || message || messages.length) {
const exceptionTitle = isFailed ? (messages.length ? 'Exceptions' : 'Exception') : 'Warning';

// expression evaluation warnings can get really long and hide actual failure messages, source
// filter out expression evaluation failure messages if either:
// - there was a stage failure (and failed expressions don't fail the stage)
// - expression evaluation was explicitly disabled for the stage(as Orca still processes expressions and populates
// warnings when evaluation is disabled disabled)
const shouldFilterExpressionFailures =
(isFailed && !stage.context?.failOnFailedExpressions) || stage.context?.skipExpressionEvaluation;

if (shouldFilterExpressionFailures) {
stageMessages = stageMessages.filter((m) => !m.startsWith('Failed to evaluate'));

if (stageMessages.length === 0) {
// no messages to be displayed after filtering
return null;
}
}

const displayMessages = stageMessages.map((m, i) => (
<Markdown key={i} message={m || StageFailureMessages.NO_REASON_PROVIDED} className="break-word" />
));
const displayMessages =
message || !messages.length ? (
<Markdown message={message || StageFailureMessages.NO_REASON_PROVIDED} className="break-word" />
) : (
messages.map((m, i) => (
<Markdown key={i} message={m || StageFailureMessages.NO_REASON_PROVIDED} className="break-word" />
))
);

if (displayMessages) {
return (
Expand Down

0 comments on commit 6c018b7

Please sign in to comment.