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)" (#10021) (#10025)

This reverts commit 7e3dd50.

(cherry picked from commit 62033d0)

Co-authored-by: Matt Gogerly <[email protected]>
  • Loading branch information
mergify[bot] and mattgogerly authored Aug 30, 2023
1 parent 3e0f88f commit 4bdf381
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 @@ -71,33 +71,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 4bdf381

Please sign in to comment.