All files / modules/70-pipeline/components/PreFlightCheckModal PreFlightCheckModal.tsx

92.21% Statements 142/154
84.74% Branches 272/321
90.48% Functions 38/42
92% Lines 138/150

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643              33x 33x 33x 33x 33x   33x 33x 33x 33x   33x                 33x 33x   33x   33x 33x   33x 33x 33x     33x 82x 32x 50x 13x 37x 11x   26x     33x 30x 20x 10x 5x 5x 5x           30x                                   26x   26x 26x   26x 26x   26x 26x   26x               1x                   1x                         2x   2x                     2x                                                                     7x   7x 7x   7x     7x       7x           18x 18x                 7x 12x                       7x 6x     7x 18x                                                                                                 7x     18x                                         19x   19x 19x   19x     19x       19x         19x 12x               19x     12x                                                                         26x                                                                           26x   26x     26x 17x 9x   9x 1x   9x 3x     9x       26x                                                                       21x   21x 8x   1x 1x         1x         13x                         21x   21x                   33x                         33x                       21x 21x   21x 21x 21x 21x 3x 3x       21x 11x 7x                     7x   7x 4x   3x                 21x                   21x 11x       21x 21x 4x 3x             3x 2x             21x 17x 6x         21x 21x 21x 16x 16x   21x 18x 18x 18x     21x     21x 21x   21x                                           1x 1x            
/*
 * Copyright 2021 Harness Inc. All rights reserved.
 * Use of this source code is governed by the PolyForm Shield 1.0.0 license
 * that can be found in the licenses directory at the root of this repository, also available at
 * https://polyformproject.org/wp-content/uploads/2020/06/PolyForm-Shield-1.0.0.txt.
 */
 
import React, { useEffect, useState } from 'react'
import { isEmpty } from 'lodash-es'
import { Link } from 'react-router-dom'
import cx from 'classnames'
import { PopoverInteractionKind, Position, ProgressBar } from '@blueprintjs/core'
import type { IconProps } from '@wings-software/uicore/dist/icons/Icon'
import { Accordion, Button, Container, Layout, Popover, Text } from '@wings-software/uicore'
import { Color } from '@harness/design-system'
import { useStrings } from 'framework/strings'
import { useAppStore } from 'framework/AppStore/AppStoreContext'
import type { PipelineInfoConfig } from 'services/cd-ng'
import {
  ConnectorCheckResponse,
  PipelineInputResponse,
  PreFlightDTO,
  PreFlightEntityErrorInfo,
  ResponsePreFlightDTO,
  startPreflightCheckPromise,
  useGetPreflightCheckResponse
} from 'services/pipeline-ng'
import { getIdentifierFromValue } from '@common/components/EntityReference/EntityReference'
import { useToaster } from '@common/exports'
import type { GitQueryParams, Module } from '@common/interfaces/RouteInterfaces'
import routes from '@common/RouteDefinitions'
 
import { yamlStringify } from '@common/utils/YamlHelperMethods'
import css from './PreFlightCheckModal.module.scss'
 
enum Section {
  CONNECTORS = 'CONNECTORS',
  INPUT_SET = 'INPUT_SET'
}
 
const getIconProps = (status?: string): IconProps => {
  if (status === 'SUCCESS') {
    return { color: Color.GREEN_500, name: 'small-tick' }
  } else if (status === 'IN_PROGRESS') {
    return { color: Color.GREY_400, name: 'pending', className: css.spinningIcon }
  } else if (status === 'FAILURE') {
    return { color: Color.RED_500, name: 'small-cross' }
  }
  return { color: Color.GREY_400, name: 'pending', className: css.spinningIcon }
}
 
const getStatusMessage = (status?: string): string => {
  if (status === 'SUCCESS') {
    return 'success'
  } else if (status === 'IN_PROGRESS') {
    return 'in progress'
  } else Eif (status === 'FAILURE') {
    return 'failure'
  }
  return 'unknown'
}
 
function RowStatus({ status }: { status: ConnectorCheckResponse['status'] }): React.ReactElement {
  return (
    <Text inline icon="dot" iconProps={{ color: getIconProps(status).color }} className={css.status}>
      {getStatusMessage(status)}
    </Text>
  )
}
 
interface SectionLabelsProps {
  selectedSection: Section
  setSelectedSection: (section: Section) => void
  preFlightCheckData?: PreFlightDTO
}
 
function SectionLabels({
  selectedSection,
  setSelectedSection,
  preFlightCheckData
}: SectionLabelsProps): React.ReactElement {
  const { getString } = useStrings()
 
  const inputSetStatus = preFlightCheckData?.pipelineInputWrapperResponse?.status
  const inputSetLabel = getString('pre-flight-check.verifyingPipelineInputs')
 
  const connectorStatus = preFlightCheckData?.connectorWrapperResponse?.status
  const connectorLabel = getString('pre-flight-check.verifyingConnectors')
 
  const inputSetIconProps = getIconProps(inputSetStatus)
  const connectorsIconProps = getIconProps(connectorStatus)
 
  return (
    <Layout.Vertical spacing="xlarge" className={css.sectionLabelsWrapper}>
      <Text
        inline
        font={{ weight: selectedSection === Section.INPUT_SET ? 'bold' : 'light' }}
        iconProps={inputSetIconProps}
        icon={inputSetIconProps.name}
        className={css.sectionLabelText}
        onClick={() => setSelectedSection(Section.INPUT_SET)}
      >
        {inputSetLabel}
      </Text>
      <Text
        inline
        font={{ weight: selectedSection === Section.CONNECTORS ? 'bold' : 'light' }}
        iconProps={connectorsIconProps}
        icon={connectorsIconProps.name}
        className={css.sectionLabelText}
        onClick={() => setSelectedSection(Section.CONNECTORS)}
      >
        {connectorLabel}
      </Text>
    </Layout.Vertical>
  )
}
 
interface ErrorPanelProps {
  errorInfo?: PreFlightEntityErrorInfo
}
 
function ErrorPanel({ errorInfo }: ErrorPanelProps): React.ReactElement {
  const { getString } = useStrings()
 
  return (
    <Container className={css.errorPanel}>
      <h3>{getString('errorSummaryText')}</h3>
      <Container margin={{ bottom: 'medium' }}>
        <Text>{errorInfo?.summary}</Text>
        <Text>{errorInfo?.description}</Text>
      </Container>
      {errorInfo?.causes && errorInfo?.causes.length > 0 && (
        <Container margin={{ bottom: 'medium' }}>
          <Text>{getString('pre-flight-check.possibleCauses')}</Text>
          {errorInfo?.causes?.map((cause, idx) => (
            <Text key={idx}>{cause.cause}</Text>
          ))}
        </Container>
      )}
      {errorInfo?.resolution && errorInfo?.resolution?.length > 0 && (
        <Container margin={{ bottom: 'medium' }}>
          <Text>{getString('pre-flight-check.resolution')}</Text>
          {errorInfo?.resolution?.map((res, idx) => (
            <Text key={idx}>{res.resolution}</Text>
          ))}
        </Container>
      )}
    </Container>
  )
}
 
interface ConnectorsSectionProps {
  accountId: string
  orgIdentifier: string
  projectIdentifier: string
  pipelineIdentifier: string
  module: Module
  preFlightCheckData?: PreFlightDTO
}
 
function ConnectorsSection({
  accountId,
  orgIdentifier,
  projectIdentifier,
  pipelineIdentifier,
  module,
  preFlightCheckData,
  branch,
  repoIdentifier
}: ConnectorsSectionProps & GitQueryParams): React.ReactElement {
  const { getString } = useStrings()
 
  const data = preFlightCheckData?.connectorWrapperResponse?.checkResponses
  const status = preFlightCheckData?.connectorWrapperResponse?.status
 
  Iif (status === 'IN_PROGRESS' && isEmpty(data)) {
    return <Text>{getString('pre-flight-check.gettingConnectorResult')}</Text>
  }
  Iif (status === 'SUCCESS' && isEmpty(data)) {
    // No connectors to verify
    return <Text intent="success">{getString('success')}</Text>
  }
  Iif (status === 'FAILURE' && isEmpty(data)) {
    // No connectors to verify
    return <Text intent="danger">{getString('pre-flight-check.couldNotVerifyConnectors')}</Text>
  }
 
  function getConnectorUrl(connectorRef: string): string {
    const connectorId = getIdentifierFromValue(connectorRef)
    return routes.toConnectorDetails({
      projectIdentifier,
      orgIdentifier,
      connectorId,
      accountId,
      module
    })
  }
 
  const getStageLink = (stageId: string): string => {
    return `${routes.toPipelineStudio({
      accountId,
      orgIdentifier,
      projectIdentifier,
      pipelineIdentifier,
      module,
      branch,
      repoIdentifier,
      stageId
    })}`
  }
 
  const getStepLink = (stageIdentifier: string, stepIdentifier: string): string => {
    return `${getStageLink(stageIdentifier)}&stepId=${stepIdentifier}`
  }
 
  const getDetails = (row: ConnectorCheckResponse, hasExpandableDetails: boolean) => (
    <Layout.Horizontal spacing="large" key={row.fqn} className={css.listRow}>
      <Text
        lineClamp={1}
        className={cx(css.connectorName, { [css.accordionPaddingCorrection]: !hasExpandableDetails })}
      >
        {row.connectorIdentifier}
      </Text>
      <span className={css.connectorId}>
        <Popover
          boundary={'window'}
          position={Position.TOP}
          interactionKind={PopoverInteractionKind.HOVER}
          portalClassName={css.locationPopover}
          modifiers={{ preventOverflow: { enabled: false } }}
        >
          {row.connectorIdentifier ? (
            <div className={css.connectorIdentifierHolder}>
              <span> {getString('idLabel')}</span>
              <Link target={'_blank'} to={getConnectorUrl(row.connectorIdentifier)}>
                <Text className={css.connectorIdentifier}> {row.connectorIdentifier}</Text>
              </Link>
            </div>
          ) : null}
 
          <Container className={css.locationPopoverContent}>
            <Text className={css.row}>{getString('pre-flight-check.connectorLocationInPipeline')}</Text>
            {!!row.stageIdentifier && (
              <Text className={css.row}>
                <strong>{getString('pre-flight-check.stageColon')}</strong>{' '}
                <Link target="_blank" to={getStageLink(row.stageIdentifier)}>
                  {row.stageName}
                </Link>
              </Text>
            )}
            {!!row.stageIdentifier && !!row.stepIdentifier && (
              <Text className={css.row}>
                <strong>{getString('pre-flight-check.stepColon')}</strong>{' '}
                <Link target="_blank" to={getStepLink(row.stageIdentifier, row.stepIdentifier)}>
                  {row.stepName}
                </Link>
              </Text>
            )}
          </Container>
        </Popover>
      </span>
      <RowStatus status={row.status} />
    </Layout.Horizontal>
  )
 
  return (
    <Layout.Vertical spacing="large">
      {data?.map(row => {
        return row.status === 'FAILURE' ? (
          <Accordion>
            <Accordion.Panel
              id={row.connectorIdentifier || ''}
              details={<ErrorPanel errorInfo={row.errorInfo} />}
              summary={getDetails(row, true)}
            ></Accordion.Panel>
          </Accordion>
        ) : (
          getDetails(row, false)
        )
      })}
    </Layout.Vertical>
  )
}
 
interface InputSetsSectionProps {
  preFlightCheckData?: PreFlightDTO
}
 
function InputSetsSection({ preFlightCheckData }: InputSetsSectionProps): React.ReactElement {
  const { getString } = useStrings()
 
  const data = preFlightCheckData?.pipelineInputWrapperResponse?.pipelineInputResponse
  const status = preFlightCheckData?.pipelineInputWrapperResponse?.status
 
  Iif (status === 'IN_PROGRESS' && isEmpty(data)) {
    return <Text>{getString('pre-flight-check.gettingResults')}</Text>
  }
  Iif (status === 'SUCCESS' && isEmpty(data)) {
    // No connectors to verify
    return <Text intent="success">{getString('success')}</Text>
  }
  Iif (status === 'FAILURE' && isEmpty(data)) {
    // No connectors to verify
    return <Text intent="danger">{getString('pre-flight-check.couldNotVerifyInputSets')}</Text>
  }
 
  const getDetails = (row: PipelineInputResponse, hasExpandableDetails: boolean) => (
    <Layout.Horizontal spacing="large" key={row.fqn} className={css.listRow}>
      <Text lineClamp={1} className={cx(css.inputFqn, { [css.accordionPaddingCorrection]: !hasExpandableDetails })}>
        {row.fqn}
      </Text>
      <RowStatus status={row.success ? 'SUCCESS' : 'FAILURE'} />
    </Layout.Horizontal>
  )
 
  return (
    <Layout.Vertical spacing="large">
      {data?.map(row => {
        return row.success === false ? (
          <Accordion>
            <Accordion.Panel
              id={row.fqn || ''}
              details={<ErrorPanel errorInfo={row.errorInfo} />}
              summary={getDetails(row, true)}
            ></Accordion.Panel>
          </Accordion>
        ) : (
          getDetails(row, false)
        )
      })}
    </Layout.Vertical>
  )
}
 
interface SectionPanelProps {
  accountId: string
  orgIdentifier: string
  projectIdentifier: string
  pipelineIdentifier: string
  module: Module
  selectedSection: Section
  preFlightCheckData?: PreFlightDTO
}
 
function SectionPanel({
  accountId,
  orgIdentifier,
  projectIdentifier,
  pipelineIdentifier,
  module,
  selectedSection,
  preFlightCheckData,
  branch,
  repoIdentifier
}: SectionPanelProps & GitQueryParams): React.ReactElement {
  return (
    <div className={css.sectionPanelWrapper}>
      {selectedSection === Section.CONNECTORS ? (
        <ConnectorsSection
          accountId={accountId}
          orgIdentifier={orgIdentifier}
          projectIdentifier={projectIdentifier}
          pipelineIdentifier={pipelineIdentifier}
          module={module}
          preFlightCheckData={preFlightCheckData}
          branch={branch}
          repoIdentifier={repoIdentifier}
        />
      ) : (
        <InputSetsSection preFlightCheckData={preFlightCheckData} />
      )}
    </div>
  )
}
 
interface PreFlightCheckSectionsProps {
  accountId: string
  orgIdentifier: string
  projectIdentifier: string
  pipelineIdentifier: string
  module: Module
  preFlightCheckData?: PreFlightDTO
}
function PreFlightCheckSections({
  accountId,
  orgIdentifier,
  projectIdentifier,
  pipelineIdentifier,
  module,
  preFlightCheckData,
  branch,
  repoIdentifier
}: PreFlightCheckSectionsProps & GitQueryParams): React.ReactElement {
  const [selectedSection, setSelectedSection] = useState(Section.INPUT_SET)
 
  const AUTO_SELECT_STATUSES = ['FAILURE', 'IN_PROGRESS']
 
  // auto select section
  useEffect(() => {
    if (preFlightCheckData) {
      let selection: Section | undefined = undefined
 
      if (AUTO_SELECT_STATUSES.indexOf(preFlightCheckData?.pipelineInputWrapperResponse?.status || '') !== -1) {
        selection = Section.INPUT_SET
      }
      if (AUTO_SELECT_STATUSES.indexOf(preFlightCheckData?.connectorWrapperResponse?.status || '') !== -1) {
        selection = Section.CONNECTORS
      }
 
      if (selection) setSelectedSection(selection)
    }
  }, [preFlightCheckData])
 
  return (
    <Layout.Horizontal spacing="medium" className={css.sectionsWrapper}>
      <SectionLabels
        selectedSection={selectedSection}
        setSelectedSection={setSelectedSection}
        preFlightCheckData={preFlightCheckData}
      />
      <div className={css.divider} />
      <SectionPanel
        accountId={accountId}
        orgIdentifier={orgIdentifier}
        projectIdentifier={projectIdentifier}
        pipelineIdentifier={pipelineIdentifier}
        module={module}
        selectedSection={selectedSection}
        preFlightCheckData={preFlightCheckData}
        branch={branch}
        repoIdentifier={repoIdentifier}
      />
    </Layout.Horizontal>
  )
}
 
interface PreFlightCheckFooter {
  preFlightCheckData?: PreFlightDTO
  onContinuePipelineClick: () => void
  onCloseButtonClick: () => void
  onRetryButtonClick: () => void
}
 
function PreFlightCheckFooter({
  preFlightCheckData,
  onContinuePipelineClick,
  onCloseButtonClick,
  onRetryButtonClick
}: PreFlightCheckFooter): React.ReactElement {
  const { getString } = useStrings()
  // If the check is complete
  if (preFlightCheckData?.status === 'SUCCESS' || preFlightCheckData?.status === 'FAILURE') {
    return (
      <div className={css.footerFailure}>
        <Button intent="primary" text={getString('retry')} onClick={() => onRetryButtonClick()} />
        <Button text={getString('close')} onClick={() => onCloseButtonClick()} />
        <Button
          text={getString('pre-flight-check.continueToRunPipeline')}
          minimal
          intent="primary"
          onClick={() => onContinuePipelineClick()}
        />
      </div>
    )
  }
  return (
    <div className={css.footerInProgress}>
      <Button text={getString('pre-flight-check.skipCheckBtn')} onClick={() => onContinuePipelineClick()} />
      <Text className={css.footerSmallText}>{getString('pre-flight-check.skipCheckInfo')}</Text>
    </div>
  )
}
 
interface HeadLineProps {
  errorCount: number
}
 
function HeadLine({ errorCount }: HeadLineProps): React.ReactElement {
  const { getString } = useStrings()
 
  return (
    <Layout.Horizontal className={css.headLine}>
      <span className={css.title}>{getString('pre-flight-check.preFlightCheckTitle')}</span>
      {errorCount > 0 ? (
        <span className={css.error}>{getString('pre-flight-check.errorFoundCounter', { errorCount })}</span>
      ) : null}
    </Layout.Horizontal>
  )
}
 
export const POLL_INTERVAL = 3 /* sec */ * 1000 /* ms */
 
export interface PreFlightCheckModalProps {
  pipeline?: PipelineInfoConfig
  module: Module
  accountId: string
  orgIdentifier: string
  projectIdentifier: string
  pipelineIdentifier: string
  onCloseButtonClick: () => void
  onContinuePipelineClick: () => void
}
 
export function PreFlightCheckModal({
  pipeline,
  module,
  accountId,
  orgIdentifier,
  projectIdentifier,
  pipelineIdentifier,
  branch,
  repoIdentifier,
  onCloseButtonClick,
  onContinuePipelineClick
}: PreFlightCheckModalProps & GitQueryParams): React.ReactElement {
  const [preFlightCheckId, setPreFlightCheckId] = useState<string | undefined>()
  const [preFlightCheckData, setPreFlightCheckData] = useState<ResponsePreFlightDTO | null>()
 
  const { showError } = useToaster()
  const { getString } = useStrings()
  const { isGitSyncEnabled } = useAppStore()
  const processResponseError = (error?: { message?: string }) => {
    showError(error?.message ? error?.message : getString('somethingWentWrong'), undefined, 'pipeline.preflight.error')
    onCloseButtonClick()
  }
 
  // start preflight check
  useEffect(() => {
    if (!preFlightCheckId) {
      startPreflightCheckPromise({
        queryParams: {
          accountIdentifier: accountId,
          orgIdentifier,
          projectIdentifier,
          pipelineIdentifier,
          ...(isGitSyncEnabled ? { repoIdentifier, branch, getDefaultFromOtherRepo: true } : {})
        },
        body: !isEmpty(pipeline) ? (yamlStringify({ pipeline }) as any) : ''
      })
        .then(response => {
          Iif (response?.status === 'ERROR' || response?.status === 'FAILURE') {
            processResponseError(response as any)
          } else if (response.data) {
            setPreFlightCheckId(response.data)
          } else {
            processResponseError()
          }
        })
        .catch(error => {
          processResponseError(error)
        })
    }
  }, [pipeline, preFlightCheckId])
 
  const { data: preFlightCheckResponse, refetch } = useGetPreflightCheckResponse({
    queryParams: {
      accountIdentifier: accountId,
      orgIdentifier,
      projectIdentifier,
      preflightCheckId: preFlightCheckId || ''
    },
    lazy: true
  })
 
  useEffect(() => {
    setPreFlightCheckData(preFlightCheckResponse)
  }, [preFlightCheckResponse])
 
  // setting up the polling
  useEffect(() => {
    if (preFlightCheckId) {
      if (!preFlightCheckData || preFlightCheckData?.data?.status === 'IN_PROGRESS') {
        const timerId = window.setTimeout(
          () => {
            refetch()
          },
          !preFlightCheckData ? 1 : POLL_INTERVAL
        )
 
        return () => {
          window.clearTimeout(timerId)
        }
      }
    }
  }, [preFlightCheckId, preFlightCheckData])
 
  // auto close if check pass successfully
  useEffect(() => {
    if (preFlightCheckData?.data?.status === 'SUCCESS') {
      onContinuePipelineClick()
    }
  }, [preFlightCheckData])
 
  // count total, progress, failed
  const getChecksCount = (preFlight?: PreFlightDTO) => {
    const checkCount = { total: 0, progress: 0, failed: 0 }
    preFlight?.pipelineInputWrapperResponse?.pipelineInputResponse?.forEach(item => {
      checkCount.total++
      if (item.success === false) checkCount.failed++
    })
    preFlight?.connectorWrapperResponse?.checkResponses?.forEach(item => {
      checkCount.total++
      if (item.status === 'IN_PROGRESS') checkCount.progress++
      if (item.status === 'FAILURE') checkCount.failed++
    })
 
    return checkCount
  }
 
  const checkCounts = getChecksCount(preFlightCheckData?.data)
  const progressValue = checkCounts.total > 0 ? 1 - (1 / checkCounts.total) * checkCounts.progress : 0
 
  return (
    <Container className={css.preFlightCheckContainer} padding="medium">
      <HeadLine errorCount={checkCounts.failed} />
      <ProgressBar
        intent={preFlightCheckData?.data?.status === 'FAILURE' ? 'danger' : 'success'}
        value={progressValue}
      />
      <PreFlightCheckSections
        accountId={accountId}
        orgIdentifier={orgIdentifier}
        projectIdentifier={projectIdentifier}
        pipelineIdentifier={pipelineIdentifier}
        module={module}
        preFlightCheckData={preFlightCheckData?.data}
        branch={branch}
        repoIdentifier={repoIdentifier}
      />
      <PreFlightCheckFooter
        preFlightCheckData={preFlightCheckData?.data}
        onContinuePipelineClick={onContinuePipelineClick}
        onCloseButtonClick={onCloseButtonClick}
        onRetryButtonClick={() => {
          setPreFlightCheckData(null)
          setPreFlightCheckId(undefined)
        }}
      />
    </Container>
  )
}