Skip to content
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

Revert "fix(core): conditionally hide expression evaluation warning messages (#9771)" (backport #10021) #10025

Merged
merged 1 commit into from
Aug 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading