@backstage-community/plugin-tekton 3.32.1 → 3.33.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/components/Charts/PipelineBars.esm.js +1 -1
- package/dist/components/Charts/PipelineBars.esm.js.map +1 -1
- package/dist/components/PipelineRunList/PipelineRunList.esm.js +1 -1
- package/dist/components/PipelineRunList/PipelineRunList.esm.js.map +1 -1
- package/dist/components/PipelineRunList/PipelineRunOutput.esm.js.map +1 -1
- package/dist/components/PipelineRunList/PipelineRunRow.esm.js.map +1 -1
- package/dist/components/PipelineRunList/PipelineRunRowActions.esm.js +1 -1
- package/dist/components/PipelineRunList/PipelineRunRowActions.esm.js.map +1 -1
- package/dist/components/PipelineRunList/PipelineRunSBOMLink.esm.js.map +1 -1
- package/dist/components/PipelineRunList/PipelineRunTableBody.esm.js.map +1 -1
- package/dist/components/PipelineRunList/PipelineRunTaskStatus.esm.js.map +1 -1
- package/dist/components/PipelineRunList/PipelineRunVulnerabilities.esm.js.map +1 -1
- package/dist/components/PipelineRunList/PlrStatus.esm.js +1 -1
- package/dist/components/PipelineRunList/PlrStatus.esm.js.map +1 -1
- package/dist/components/PipelineRunLogs/PipelineRunLogDialog.esm.js.map +1 -1
- package/dist/components/PipelineRunLogs/PipelineRunLogDownloader.esm.js.map +1 -1
- package/dist/components/PipelineRunLogs/PipelineRunLogs.esm.js +1 -1
- package/dist/components/PipelineRunLogs/PipelineRunLogs.esm.js.map +1 -1
- package/dist/components/PipelineRunLogs/TaskStatusStepper.esm.js +1 -1
- package/dist/components/PipelineRunLogs/TaskStatusStepper.esm.js.map +1 -1
- package/dist/components/PipelineRunOutput/PipelineRunOutputDialog.esm.js.map +1 -1
- package/dist/components/PipelineRunParamsAndResults/PipelineRunParams.esm.js.map +1 -1
- package/dist/components/PipelineRunParamsAndResults/PipelineRunParamsAndResults.esm.js.map +1 -1
- package/dist/components/PipelineRunParamsAndResults/PipelineRunParamsAndResultsDialog.esm.js.map +1 -1
- package/dist/components/PipelineRunParamsAndResults/PipelineRunResults.esm.js.map +1 -1
- package/dist/components/common/ClusterSelector.esm.js.map +1 -1
- package/dist/components/common/StatusSelector.esm.js +1 -1
- package/dist/components/common/StatusSelector.esm.js.map +1 -1
- package/dist/components/pipeline-topology/PipelineTaskNode.esm.js.map +1 -1
- package/dist/components/pipeline-topology/PipelineVisualization.esm.js.map +1 -1
- package/dist/hooks/TektonResourcesContext.esm.js +1 -1
- package/dist/hooks/TektonResourcesContext.esm.js.map +1 -1
- package/dist/hooks/usePipelineRunScanResults.esm.js.map +1 -1
- package/dist/hooks/useTektonObjectsResponse.esm.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/types/types.esm.js.map +1 -1
- package/dist/utils/isTektonCIAvailable.esm.js.map +1 -1
- package/dist/utils/pipeline-step-utils.esm.js +1 -1
- package/dist/utils/pipeline-step-utils.esm.js.map +1 -1
- package/dist/utils/pipeline-topology-utils.esm.js +1 -1
- package/dist/utils/pipeline-topology-utils.esm.js.map +1 -1
- package/dist/utils/pipelineRun-utils.esm.js +1 -1
- package/dist/utils/pipelineRun-utils.esm.js.map +1 -1
- package/dist/utils/taskRun-utils.esm.js +1 -1
- package/dist/utils/taskRun-utils.esm.js.map +1 -1
- package/dist/utils/tekton-utils.esm.js +1 -1
- package/dist/utils/tekton-utils.esm.js.map +1 -1
- package/package.json +6 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskStatusStepper.esm.js","sources":["../../../src/components/PipelineRunLogs/TaskStatusStepper.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useState, memo } from 'react';\nimport useInterval from 'react-use/lib/useInterval';\n\nimport {\n CircularProgress,\n createStyles,\n makeStyles,\n StepButton,\n StepIconProps,\n Theme,\n} from '@material-ui/core';\nimport Step from '@material-ui/core/Step';\nimport StepLabel from '@material-ui/core/StepLabel';\nimport Stepper from '@material-ui/core/Stepper';\nimport Typography from '@material-ui/core/Typography';\nimport Cancel from '@material-ui/icons/Cancel';\nimport Check from '@material-ui/icons/Check';\nimport FiberManualRecordIcon from '@material-ui/icons/FiberManualRecord';\nimport classNames from 'classnames';\n\nimport { ComputedStatus } from '@
|
|
1
|
+
{"version":3,"file":"TaskStatusStepper.esm.js","sources":["../../../src/components/PipelineRunLogs/TaskStatusStepper.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useState, memo } from 'react';\nimport useInterval from 'react-use/lib/useInterval';\n\nimport {\n CircularProgress,\n createStyles,\n makeStyles,\n StepButton,\n StepIconProps,\n Theme,\n} from '@material-ui/core';\nimport Step from '@material-ui/core/Step';\nimport StepLabel from '@material-ui/core/StepLabel';\nimport Stepper from '@material-ui/core/Stepper';\nimport Typography from '@material-ui/core/Typography';\nimport Cancel from '@material-ui/icons/Cancel';\nimport Check from '@material-ui/icons/Check';\nimport FiberManualRecordIcon from '@material-ui/icons/FiberManualRecord';\nimport classNames from 'classnames';\n\nimport { ComputedStatus } from '@backstage-community/plugin-tekton-react';\n\nimport { TaskStep } from '../../utils/taskRun-utils';\nimport { calculateDuration } from '../../utils/tekton-utils';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translations/index.ts';\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n width: '100%',\n },\n titleContainer: {\n display: 'flex',\n alignItems: 'center',\n gap: theme.spacing(1),\n },\n closeButton: {\n position: 'absolute',\n right: theme.spacing(1),\n top: theme.spacing(1),\n color: theme.palette.grey[500],\n },\n labelWrapper: {\n display: 'flex',\n flex: 1,\n flexDirection: 'row',\n justifyContent: 'space-between',\n },\n stepWrapper: {\n width: '100%',\n },\n }),\n);\n\nconst StepTimeTicker = ({ step }: { step: TaskStep }) => {\n const [time, setTime] = useState('');\n const { t } = useTranslationRef(tektonTranslationRef);\n\n useInterval(() => {\n if (!step.startedAt) {\n setTime('');\n return;\n }\n\n setTime(calculateDuration(t, step.startedAt, step.endedAt));\n }, 1000);\n\n return <Typography variant=\"caption\">{time}</Typography>;\n};\n\nconst useStepIconStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n color: theme.palette.text.disabled,\n display: 'flex',\n height: 22,\n alignItems: 'center',\n },\n completed: {\n color: theme.palette.status.ok,\n },\n error: {\n color: theme.palette.status.error,\n },\n }),\n);\n\nconst TaskStepIconComponent = ({ active, completed, error }: StepIconProps) => {\n const classes = useStepIconStyles();\n\n const getMiddle = () => {\n if (active) {\n return <CircularProgress size=\"24px\" />;\n }\n if (completed) {\n return <Check />;\n }\n if (error) {\n return <Cancel />;\n }\n return <FiberManualRecordIcon />;\n };\n\n return (\n <div\n className={classNames(classes.root, {\n [classes.completed]: completed,\n [classes.error]: error,\n })}\n >\n {getMiddle()}\n </div>\n );\n};\n\ntype TaskStatusStepperProps = {\n steps: TaskStep[];\n currentStepId: string | undefined;\n onUserStepChange: (id: string) => void;\n classes?: {\n root?: string;\n };\n};\n\nexport const TaskStatusStepper = memo((props: TaskStatusStepperProps) => {\n const { steps, currentStepId, onUserStepChange } = props;\n const classes = useStyles(props);\n const { t } = useTranslationRef(tektonTranslationRef);\n\n return (\n <div className={classes.root}>\n <Stepper\n activeStep={steps.findIndex(s => s.id === currentStepId)}\n orientation=\"vertical\"\n nonLinear\n >\n {steps.map((step, _) => {\n const isCancelled = step.status === ComputedStatus.Cancelled;\n const isActive = step.status === ComputedStatus.Running;\n const isCompleted = step.status === ComputedStatus.Succeeded;\n const isFailed = step.status === ComputedStatus.Failed;\n const isSkipped = step.status === ComputedStatus.Skipped;\n\n return (\n <Step key={step.id} expanded>\n <StepButton onClick={() => onUserStepChange(step.id)}>\n <StepLabel\n StepIconProps={{\n completed: isCompleted,\n error: isFailed || isCancelled,\n active: isActive,\n }}\n StepIconComponent={TaskStepIconComponent}\n className={classes.stepWrapper}\n >\n <div className={classes.labelWrapper}>\n <Typography variant=\"subtitle2\">{step.name}</Typography>\n {isSkipped ? (\n <Typography variant=\"caption\">\n {t('pipelineRunLogs.taskStatusStepper.skipped')}\n </Typography>\n ) : (\n <StepTimeTicker step={step} />\n )}\n </div>\n </StepLabel>\n </StepButton>\n </Step>\n );\n })}\n </Stepper>\n </div>\n );\n});\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA0CA,MAAM,SAAA,GAAY,UAAA;AAAA,EAAW,CAAC,UAC5B,YAAA,CAAa;AAAA,IACX,IAAA,EAAM;AAAA,MACJ,KAAA,EAAO;AAAA,KACT;AAAA,IACA,cAAA,EAAgB;AAAA,MACd,OAAA,EAAS,MAAA;AAAA,MACT,UAAA,EAAY,QAAA;AAAA,MACZ,GAAA,EAAK,KAAA,CAAM,OAAA,CAAQ,CAAC;AAAA,KACtB;AAAA,IACA,WAAA,EAAa;AAAA,MACX,QAAA,EAAU,UAAA;AAAA,MACV,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAA;AAAA,MACtB,GAAA,EAAK,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAA;AAAA,MACpB,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,IAA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AC1C,SAAA,mBACC,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,SAAA,EACjB,QAAA,EAAA,CAAA,CAAE,2CAA2C,CAAA,EAChD,CAAA,mBAEA,GAAA,CAAC,cAAA,EAAA,EAAe,IAAA,EAAY;AAAA,aAAA,EAEhC;AAAA;AAAA,SACF,EACF,CAAA,EAAA,EAtBS,IAAA,CAAK,EAuBhB,CAAA;AAAA,MAEJ,CAAC;AAAA;AAAA,GACH,EACF,CAAA;AAEJ,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PipelineRunOutputDialog.esm.js","sources":["../../../src/components/PipelineRunOutput/PipelineRunOutputDialog.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { memo } from 'react';\n\nimport { ErrorBoundary } from '@backstage/core-components';\n\nimport {\n Box,\n createStyles,\n Dialog,\n DialogContent,\n DialogTitle,\n IconButton,\n makeStyles,\n Theme,\n} from '@material-ui/core';\nimport CloseIcon from '@mui/icons-material/Close';\n\nimport {
|
|
1
|
+
{"version":3,"file":"PipelineRunOutputDialog.esm.js","sources":["../../../src/components/PipelineRunOutput/PipelineRunOutputDialog.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { memo } from 'react';\n\nimport { ErrorBoundary } from '@backstage/core-components';\n\nimport {\n Box,\n createStyles,\n Dialog,\n DialogContent,\n DialogTitle,\n IconButton,\n makeStyles,\n Theme,\n} from '@material-ui/core';\nimport CloseIcon from '@mui/icons-material/Close';\n\nimport {\n PipelineRunKind,\n TaskRunKind,\n} from '@backstage-community/plugin-tekton-react';\n\nimport { tektonGroupColor } from '../../types/types';\nimport PipelineRunOutput from '../PipelineRunList/PipelineRunOutput';\nimport ResourceBadge from '../PipelineRunList/ResourceBadge';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translations/index.ts';\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n titleContainer: {\n display: 'flex',\n alignItems: 'center',\n gap: theme.spacing(1),\n },\n closeButton: {\n position: 'absolute',\n right: theme.spacing(1),\n top: theme.spacing(1),\n color: theme.palette.grey[500],\n },\n }),\n);\n\ntype PipelineRunOutputDialogProps = {\n open: boolean;\n closeDialog: () => void;\n pipelineRun: PipelineRunKind;\n taskRuns: TaskRunKind[];\n};\nconst PipelineRunOutputDialog = ({\n open,\n closeDialog,\n pipelineRun,\n taskRuns,\n}: PipelineRunOutputDialogProps) => {\n const classes = useStyles();\n const { t } = useTranslationRef(tektonTranslationRef);\n\n return (\n <Dialog\n data-testid=\"pipelinerun-output-dialog\"\n maxWidth=\"xl\"\n fullWidth\n open={open}\n onClose={closeDialog}\n >\n <DialogTitle id=\"pipelinerun-output\" title={t('pipelineRunOutput.title')}>\n <Box className={classes.titleContainer}>\n <ResourceBadge\n color={tektonGroupColor}\n abbr=\"PLR\"\n name={pipelineRun?.metadata?.name ?? ''}\n />{' '}\n <IconButton\n aria-label=\"close\"\n className={classes.closeButton}\n onClick={closeDialog}\n >\n <CloseIcon />\n </IconButton>\n </Box>\n </DialogTitle>\n <DialogContent>\n <ErrorBoundary>\n <PipelineRunOutput pipelineRun={pipelineRun} taskRuns={taskRuns} />\n </ErrorBoundary>\n </DialogContent>\n </Dialog>\n );\n};\n\nexport default memo(PipelineRunOutputDialog);\n"],"names":[],"mappings":";;;;;;;;;;;;AA0CA,MAAM,SAAA,GAAY,UAAA;AAAA,EAAW,CAAC,UAC5B,YAAA,CAAa;AAAA,IACX,cAAA,EAAgB;AAAA,MACd,OAAA,EAAS,MAAA;AAAA,MACT,UAAA,EAAY,QAAA;AAAA,MACZ,GAAA,EAAK,KAAA,CAAM,OAAA,CAAQ,CAAC;AAAA,KACtB;AAAA,IACA,WAAA,EAAa;AAAA,MACX,QAAA,EAAU,UAAA;AAAA,MACV,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAA;AAAA,MACtB,GAAA,EAAK,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAA;AAAA,MACpB,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,IAAA,CAAK,GAAG;AAAA;AAC/B,GACD;AACH,CAAA;AAQA,MAAM,0BAA0B,CAAC;AAAA,EAC/B,IAAA;AAAA,EACA,WAAA;AAAA,EACA,WAAA;AAAA,EACA;AACF,CAAA,KAAoC;AAClC,EAAA,MAAM,UAAU,SAAA,EAAU;AAC1B,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,oBAAoB,CAAA;AAEpD,EAAA,uBACE,IAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,aAAA,EAAY,2BAAA;AAAA,MACZ,QAAA,EAAS,IAAA;AAAA,MACT,SAAA,EAAS,IAAA;AAAA,MACT,IAAA;AAAA,MACA,OAAA,EAAS,WAAA;AAAA,MAET,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,WAAA,EAAA,EAAY,EAAA,EAAG,oBAAA,EAAqB,KAAA,EAAO,CAAA,CAAE,yBAAyB,CAAA,EACrE,QAAA,kBAAA,IAAA,CAAC,GAAA,EAAA,EAAI,SAAA,EAAW,OAAA,CAAQ,cAAA,EACtB,QAAA,EAAA;AAAA,0BAAA,GAAA;AAAA,YAAC,aAAA;AAAA,YAAA;AAAA,cACC,KAAA,EAAO,gBAAA;AAAA,cACP,IAAA,EAAK,KAAA;AAAA,cACL,IAAA,EAAM,WAAA,EAAa,QAAA,EAAU,IAAA,IAAQ;AAAA;AAAA,WACvC;AAAA,UAAG,GAAA;AAAA,0BACH,GAAA;AAAA,YAAC,UAAA;AAAA,YAAA;AAAA,cACC,YAAA,EAAW,OAAA;AAAA,cACX,WAAW,OAAA,CAAQ,WAAA;AAAA,cACnB,OAAA,EAAS,WAAA;AAAA,cAET,8BAAC,SAAA,EAAA,EAAU;AAAA;AAAA;AACb,SAAA,EACF,CAAA,EACF,CAAA;AAAA,wBACA,GAAA,CAAC,iBACC,QAAA,kBAAA,GAAA,CAAC,aAAA,EAAA,EACC,8BAAC,iBAAA,EAAA,EAAkB,WAAA,EAA0B,QAAA,EAAoB,CAAA,EACnE,CAAA,EACF;AAAA;AAAA;AAAA,GACF;AAEJ,CAAA;AAEA,gCAAe,KAAK,uBAAuB,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PipelineRunParams.esm.js","sources":["../../../src/components/PipelineRunParamsAndResults/PipelineRunParams.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { PipelineRunKind } from '@
|
|
1
|
+
{"version":3,"file":"PipelineRunParams.esm.js","sources":["../../../src/components/PipelineRunParamsAndResults/PipelineRunParams.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { PipelineRunKind } from '@backstage-community/plugin-tekton-react';\nimport { Typography } from '@material-ui/core';\nimport { tektonTranslationRef } from '../../translations';\nimport { Output } from './Output';\n\ntype PipelineRunParamsProps = {\n pipelineRun: PipelineRunKind;\n};\n\nexport const PipelineRunParams = ({ pipelineRun }: PipelineRunParamsProps) => {\n const { t } = useTranslationRef(tektonTranslationRef);\n const noDataAvailable =\n pipelineRun.spec?.params === undefined ||\n pipelineRun.spec?.params.length === 0;\n\n if (noDataAvailable) {\n return (\n <Typography align=\"center\" variant=\"body2\">\n {t('pipelineRunParamsAndResults.noParams')}\n </Typography>\n );\n }\n\n return <Output results={pipelineRun?.spec.params ?? []} />;\n};\n"],"names":[],"mappings":";;;;;;;AA0BO,MAAM,iBAAA,GAAoB,CAAC,EAAE,WAAA,EAAY,KAA8B;AAC5E,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,oBAAoB,CAAA;AACpD,EAAA,MAAM,eAAA,GACJ,YAAY,IAAA,EAAM,MAAA,KAAW,UAC7B,WAAA,CAAY,IAAA,EAAM,OAAO,MAAA,KAAW,CAAA;AAEtC,EAAA,IAAI,eAAA,EAAiB;AACnB,IAAA,uBACE,GAAA,CAAC,cAAW,KAAA,EAAM,QAAA,EAAS,SAAQ,OAAA,EAChC,QAAA,EAAA,CAAA,CAAE,sCAAsC,CAAA,EAC3C,CAAA;AAAA,EAEJ;AAEA,EAAA,2BAAQ,MAAA,EAAA,EAAO,OAAA,EAAS,aAAa,IAAA,CAAK,MAAA,IAAU,EAAC,EAAG,CAAA;AAC1D;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PipelineRunParamsAndResults.esm.js","sources":["../../../src/components/PipelineRunParamsAndResults/PipelineRunParamsAndResults.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { PipelineRunKind } from '@
|
|
1
|
+
{"version":3,"file":"PipelineRunParamsAndResults.esm.js","sources":["../../../src/components/PipelineRunParamsAndResults/PipelineRunParamsAndResults.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { PipelineRunKind } from '@backstage-community/plugin-tekton-react';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translations';\nimport { Typography } from '@material-ui/core';\nimport { PipelineRunParams } from './PipelineRunParams';\nimport { PipelineRunResults } from './PipelineRunResults';\n\ntype PipelineRunParamsAndResultsProps = {\n pipelineRun: PipelineRunKind;\n};\nexport const PipelineRunParamsAndResults = ({\n pipelineRun,\n}: PipelineRunParamsAndResultsProps) => {\n const { t } = useTranslationRef(tektonTranslationRef);\n\n return (\n <div style={{ height: '80vh' }}>\n <div>\n <Typography variant=\"h6\" align=\"left\" gutterBottom>\n {t('pipelineRunParamsAndResults.params')}\n </Typography>\n <PipelineRunParams pipelineRun={pipelineRun} />\n </div>\n <div style={{ marginTop: '20px' }}>\n <Typography variant=\"h6\" align=\"left\" gutterBottom>\n {t('pipelineRunParamsAndResults.results')}\n </Typography>\n <PipelineRunResults pipelineRun={pipelineRun} />\n </div>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AA0BO,MAAM,8BAA8B,CAAC;AAAA,EAC1C;AACF,CAAA,KAAwC;AACtC,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,oBAAoB,CAAA;AAEpD,EAAA,4BACG,KAAA,EAAA,EAAI,KAAA,EAAO,EAAE,MAAA,EAAQ,QAAO,EAC3B,QAAA,EAAA;AAAA,oBAAA,IAAA,CAAC,KAAA,EAAA,EACC,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,SAAQ,IAAA,EAAK,KAAA,EAAM,QAAO,YAAA,EAAY,IAAA,EAC/C,QAAA,EAAA,CAAA,CAAE,oCAAoC,CAAA,EACzC,CAAA;AAAA,sBACA,GAAA,CAAC,qBAAkB,WAAA,EAA0B;AAAA,KAAA,EAC/C,CAAA;AAAA,yBACC,KAAA,EAAA,EAAI,KAAA,EAAO,EAAE,SAAA,EAAW,QAAO,EAC9B,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,SAAQ,IAAA,EAAK,KAAA,EAAM,QAAO,YAAA,EAAY,IAAA,EAC/C,QAAA,EAAA,CAAA,CAAE,qCAAqC,CAAA,EAC1C,CAAA;AAAA,sBACA,GAAA,CAAC,sBAAmB,WAAA,EAA0B;AAAA,KAAA,EAChD;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
|
package/dist/components/PipelineRunParamsAndResults/PipelineRunParamsAndResultsDialog.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PipelineRunParamsAndResultsDialog.esm.js","sources":["../../../src/components/PipelineRunParamsAndResults/PipelineRunParamsAndResultsDialog.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ErrorBoundary } from '@backstage/core-components';\nimport {\n Box,\n createStyles,\n Dialog,\n DialogContent,\n DialogTitle,\n IconButton,\n makeStyles,\n Theme,\n} from '@material-ui/core';\nimport CloseIcon from '@mui/icons-material/Close';\n\nimport { PipelineRunKind } from '@
|
|
1
|
+
{"version":3,"file":"PipelineRunParamsAndResultsDialog.esm.js","sources":["../../../src/components/PipelineRunParamsAndResults/PipelineRunParamsAndResultsDialog.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ErrorBoundary } from '@backstage/core-components';\nimport {\n Box,\n createStyles,\n Dialog,\n DialogContent,\n DialogTitle,\n IconButton,\n makeStyles,\n Theme,\n} from '@material-ui/core';\nimport CloseIcon from '@mui/icons-material/Close';\n\nimport { PipelineRunKind } from '@backstage-community/plugin-tekton-react';\n\nimport { tektonGroupColor } from '../../types/types';\nimport ResourceBadge from '../PipelineRunList/ResourceBadge';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translations';\nimport { PipelineRunParamsAndResults } from './PipelineRunParamsAndResults';\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n titleContainer: {\n display: 'flex',\n alignItems: 'center',\n gap: theme.spacing(1),\n },\n closeButton: {\n position: 'absolute',\n right: theme.spacing(1),\n top: theme.spacing(1),\n color: theme.palette.grey[500],\n },\n }),\n);\n\ntype PipelineRunParamsAndResultsDialogProps = {\n open: boolean;\n closeDialog: () => void;\n pipelineRun: PipelineRunKind;\n};\nexport const PipelineRunParamsAndResultsDialog = ({\n open,\n closeDialog,\n pipelineRun,\n}: PipelineRunParamsAndResultsDialogProps) => {\n const classes = useStyles();\n\n const { t } = useTranslationRef(tektonTranslationRef);\n\n return (\n <Dialog\n data-testid=\"pipelinerun-params-and-results-dialog\"\n maxWidth=\"xl\"\n fullWidth\n open={open}\n onClose={closeDialog}\n >\n <DialogTitle title={t('pipelineRunParamsAndResults.title')}>\n <Box className={classes.titleContainer}>\n <ResourceBadge\n color={tektonGroupColor}\n abbr=\"PLR\"\n name={pipelineRun?.metadata?.name ?? ''}\n />\n <IconButton\n aria-label=\"close\"\n className={classes.closeButton}\n onClick={closeDialog}\n >\n <CloseIcon />\n </IconButton>\n </Box>\n </DialogTitle>\n <DialogContent>\n <ErrorBoundary>\n <PipelineRunParamsAndResults pipelineRun={pipelineRun} />\n </ErrorBoundary>\n </DialogContent>\n </Dialog>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAqCA,MAAM,SAAA,GAAY,UAAA;AAAA,EAAW,CAAC,UAC5B,YAAA,CAAa;AAAA,IACX,cAAA,EAAgB;AAAA,MACd,OAAA,EAAS,MAAA;AAAA,MACT,UAAA,EAAY,QAAA;AAAA,MACZ,GAAA,EAAK,KAAA,CA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,SAAA,EAAA,EAAU;AAAA;AAAA;AACb,SAAA,EACF,CAAA,EACF,CAAA;AAAA,wBACA,GAAA,CAAC,iBACC,QAAA,kBAAA,GAAA,CAAC,aAAA,EAAA,EACC,8BAAC,2BAAA,EAAA,EAA4B,WAAA,EAA0B,GACzD,CAAA,EACF;AAAA;AAAA;AAAA,GACF;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PipelineRunResults.esm.js","sources":["../../../src/components/PipelineRunParamsAndResults/PipelineRunResults.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { PipelineRunKind } from '@
|
|
1
|
+
{"version":3,"file":"PipelineRunResults.esm.js","sources":["../../../src/components/PipelineRunParamsAndResults/PipelineRunResults.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { PipelineRunKind } from '@backstage-community/plugin-tekton-react';\nimport { Typography } from '@material-ui/core';\nimport { tektonTranslationRef } from '../../translations';\nimport { Output } from './Output';\n\ntype PipelineRunResultsProps = {\n pipelineRun: PipelineRunKind;\n};\n\nexport const PipelineRunResults = ({\n pipelineRun,\n}: PipelineRunResultsProps) => {\n const { t } = useTranslationRef(tektonTranslationRef);\n const noDataAvailable =\n pipelineRun.status?.results === undefined ||\n pipelineRun.status?.results.length === 0;\n\n if (noDataAvailable) {\n return (\n <Typography align=\"center\" variant=\"body2\">\n {t('pipelineRunParamsAndResults.noResults')}\n </Typography>\n );\n }\n\n return <Output results={pipelineRun?.status?.results ?? []} />;\n};\n"],"names":[],"mappings":";;;;;;;AA0BO,MAAM,qBAAqB,CAAC;AAAA,EACjC;AACF,CAAA,KAA+B;AAC7B,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,oBAAoB,CAAA;AACpD,EAAA,MAAM,eAAA,GACJ,YAAY,MAAA,EAAQ,OAAA,KAAY,UAChC,WAAA,CAAY,MAAA,EAAQ,QAAQ,MAAA,KAAW,CAAA;AAEzC,EAAA,IAAI,eAAA,EAAiB;AACnB,IAAA,uBACE,GAAA,CAAC,cAAW,KAAA,EAAM,QAAA,EAAS,SAAQ,OAAA,EAChC,QAAA,EAAA,CAAA,CAAE,uCAAuC,CAAA,EAC5C,CAAA;AAAA,EAEJ;AAEA,EAAA,2BAAQ,MAAA,EAAA,EAAO,OAAA,EAAS,aAAa,MAAA,EAAQ,OAAA,IAAW,EAAC,EAAG,CAAA;AAC9D;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClusterSelector.esm.js","sources":["../../../src/components/common/ClusterSelector.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useContext, useState } from 'react';\n\nimport { Select, SelectedItems } from '@backstage/core-components';\
|
|
1
|
+
{"version":3,"file":"ClusterSelector.esm.js","sources":["../../../src/components/common/ClusterSelector.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useContext, useState } from 'react';\n\nimport { Select, SelectedItems } from '@backstage/core-components';\n\nimport { makeStyles, Typography, Theme } from '@material-ui/core';\n\nimport { TektonResourcesContext } from '../../hooks/TektonResourcesContext';\n\nimport './ClusterSelector.css';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translations';\n\nconst useStyles = makeStyles<Theme>(theme => ({\n label: {\n color: theme.palette.text.primary,\n fontSize: '1rem',\n paddingRight: '10px',\n fontWeight: 'bold',\n },\n}));\n\nexport const ClusterSelector = () => {\n const classes = useStyles();\n const {\n clusters: k8sClusters,\n selectedCluster,\n setSelectedCluster: setClusterContext,\n } = useContext(TektonResourcesContext);\n const { t } = useTranslationRef(tektonTranslationRef);\n const clusterOptions = k8sClusters.map(cluster => ({\n value: cluster,\n label: cluster,\n }));\n\n const curCluster =\n selectedCluster && k8sClusters?.length > 0\n ? k8sClusters[selectedCluster]\n : k8sClusters?.[0];\n\n const [clusterSelected, setClusterSelected] =\n useState<SelectedItems>(curCluster);\n\n const onClusterChange = (arg: SelectedItems) => {\n const index = k8sClusters.findIndex(cluster => cluster === arg);\n setClusterContext(index);\n setClusterSelected(arg);\n };\n return (\n <div className=\"bs-tkn-cluster-selector\">\n <Typography className={classes.label}>\n {t('clusterSelector.label')}\n </Typography>\n <Select\n onChange={onClusterChange}\n label=\"\"\n items={clusterOptions}\n selected={clusterSelected}\n margin=\"dense\"\n />\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AA2BA,MAAM,SAAA,GAAY,WAAkB,CAAA,KAAA,MAAU;AAAA,EAC5C,KAAA,EAAO;AAAA,IACL,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,IAAA,CAAK,OAAA;AAAA,IAC1B,QAAA,EAAU,MAAA;AAAA,IACV,YAAA,EAAc,MAAA;AAAA,IACd,UAAA,EAAY;AAAA;AAEhB,CAAA,CAAE,CAAA;AAEK,MAAM,kBAAkB,MAAM;AACnC,EAAA,MAAM,UAAU,SAAA,EAAU;AAC1B,EAAA,MAAM;AAAA,IACJ,QAAA,EAAU,WAAA;AAAA,IACV,eAAA;AAAA,IACA,kBAAA,EAAoB;AAAA,GACtB,GAAI,WAAW,sBAAsB,CAAA;AACrC,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,oBAAoB,CAAA;AACpD,EAAA,MAAM,cAAA,GAAiB,WAAA,CAAY,GAAA,CAAI,CAAA,OAAA,MAAY;AAAA,IACjD,KAAA,EAAO,OAAA;AAAA,IACP,KAAA,EAAO;AAAA,GACT,CAAE,CAAA;AAEF,EAAA,MAAM,UAAA,GACJ,mBAAmB,WAAA,EAAa,MAAA,GAAS,IACrC,WAAA,CAAY,eAAe,CAAA,GAC3B,WAAA,GAAc,CAAC,CAAA;AAErB,EAAA,MAAM,CAAC,eAAA,EAAiB,kBAAkB,CAAA,GACxC,SAAwB,UAAU,CAAA;AAEpC,EAAA,MAAM,eAAA,GAAkB,CAAC,GAAA,KAAuB;AAC9C,IAAA,MAAM,KAAA,GAAQ,WAAA,CAAY,SAAA,CAAU,CAAA,OAAA,KAAW,YAAY,GAAG,CAAA;AAC9D,IAAA,iBAAA,CAAkB,KAAK,CAAA;AACvB,IAAA,kBAAA,CAAmB,GAAG,CAAA;AAAA,EACxB,CAAA;AACA,EAAA,uBACE,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,yBAAA,EACb,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,cAAW,SAAA,EAAW,OAAA,CAAQ,KAAA,EAC5B,QAAA,EAAA,CAAA,CAAE,uBAAuB,CAAA,EAC5B,CAAA;AAAA,oBACA,GAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,QAAA,EAAU,eAAA;AAAA,QACV,KAAA,EAAM,EAAA;AAAA,QACN,KAAA,EAAO,cAAA;AAAA,QACP,QAAA,EAAU,eAAA;AAAA,QACV,MAAA,EAAO;AAAA;AAAA;AACT,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -3,7 +3,7 @@ import { useContext } from 'react';
|
|
|
3
3
|
import { Select } from '@backstage/core-components';
|
|
4
4
|
import { makeStyles, Typography } from '@material-ui/core';
|
|
5
5
|
import './StatusSelector.css.esm.js';
|
|
6
|
-
import { ComputedStatus } from '@
|
|
6
|
+
import { ComputedStatus } from '@backstage-community/plugin-tekton-react';
|
|
7
7
|
import { TektonResourcesContext } from '../../hooks/TektonResourcesContext.esm.js';
|
|
8
8
|
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
9
9
|
import '../../translations/index.esm.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusSelector.esm.js","sources":["../../../src/components/common/StatusSelector.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useContext } from 'react';\n\nimport { Select, SelectedItems } from '@backstage/core-components';\n\nimport { makeStyles, Theme, Typography } from '@material-ui/core';\n\nimport './StatusSelector.css';\n\nimport { ComputedStatus } from '@
|
|
1
|
+
{"version":3,"file":"StatusSelector.esm.js","sources":["../../../src/components/common/StatusSelector.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useContext } from 'react';\n\nimport { Select, SelectedItems } from '@backstage/core-components';\n\nimport { makeStyles, Theme, Typography } from '@material-ui/core';\n\nimport './StatusSelector.css';\n\nimport { ComputedStatus } from '@backstage-community/plugin-tekton-react';\n\nimport { TektonResourcesContext } from '../../hooks/TektonResourcesContext';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translations/index.ts';\n\nconst useStyles = makeStyles<Theme>(theme => ({\n label: {\n color: theme.palette.text.primary,\n fontSize: '1rem',\n paddingRight: '10px',\n fontWeight: 'bold',\n },\n}));\n\nexport const StatusSelector = () => {\n const classes = useStyles();\n const { selectedStatus, setSelectedStatus } = useContext(\n TektonResourcesContext,\n );\n\n const onStatusChange = (status: SelectedItems) => {\n setSelectedStatus(status as ComputedStatus);\n };\n const { t } = useTranslationRef(tektonTranslationRef);\n const statusOptions = Object.entries(ComputedStatus)\n .sort(([keyA], [keyB]) => {\n if (keyA === keyB) {\n return 0;\n } else if (keyA < keyB) {\n return -1;\n }\n return 1;\n })\n .map(([key, value]) => ({\n value: key,\n label: t(`pipelineRunStatus.${key}` as any, { defaultValue: value }),\n }));\n\n return (\n <div className=\"bs-tkn-status-selector\">\n <Typography className={classes.label}>\n {t('statusSelector.label')}\n </Typography>\n <Select\n onChange={onStatusChange}\n label=\"\"\n items={statusOptions}\n selected={selectedStatus}\n margin=\"dense\"\n />\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AA6BA,MAAM,SAAA,GAAY,WAAkB,CAAA,KAAA,MAAU;AAAA,EAC5C,KAAA,EAAO;AAAA,IACL,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,IAAA,CAAK,OAAA;AAAA,IAC1B,QAAA,EAAU,MAAA;AAAA,IACV,YAAA,EAAc,MAAA;AAAA,IACd,UAAA,EAAY;AAAA;AAEhB,CAAA,CAAE,CAAA;AAEK,MAAM,iBAAiB,MAAM;AAClC,EAAA,MAAM,UAAU,SAAA,EAAU;AAC1B,EAAA,MAAM,EAAE,cAAA,EAAgB,iBAAA,EAAkB,GAAI,UAAA;AAAA,IAC5C;AAAA,GACF;AAEA,EAAA,MAAM,cAAA,GAAiB,CAAC,MAAA,KAA0B;AAChD,IAAA,iBAAA,CAAkB,MAAwB,CAAA;AAAA,EAC5C,CAAA;AACA,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,oBAAoB,CAAA;AACpD,EAAA,MAAM,aAAA,GAAgB,MAAA,CAAO,OAAA,CAAQ,cAAc,CAAA,CAChD,IAAA,CAAK,CAAC,CAAC,IAAI,CAAA,EAAG,CAAC,IAAI,CAAA,KAAM;AACxB,IAAA,IAAI,SAAS,IAAA,EAAM;AACjB,MAAA,OAAO,CAAA;AAAA,IACT,CAAA,MAAA,IAAW,OAAO,IAAA,EAAM;AACtB,MAAA,OAAO,EAAA;AAAA,IACT;AACA,IAAA,OAAO,CAAA;AAAA,EACT,CAAC,CAAA,CACA,GAAA,CAAI,CAAC,CAAC,GAAA,EAAK,KAAK,CAAA,MAAO;AAAA,IACtB,KAAA,EAAO,GAAA;AAAA,IACP,KAAA,EAAO,EAAE,CAAA,kBAAA,EAAqB,GAAG,IAAW,EAAE,YAAA,EAAc,OAAO;AAAA,GACrE,CAAE,CAAA;AAEJ,EAAA,uBACE,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,wBAAA,EACb,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,cAAW,SAAA,EAAW,OAAA,CAAQ,KAAA,EAC5B,QAAA,EAAA,CAAA,CAAE,sBAAsB,CAAA,EAC3B,CAAA;AAAA,oBACA,GAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,QAAA,EAAU,cAAA;AAAA,QACV,KAAA,EAAM,EAAA;AAAA,QACN,KAAA,EAAO,aAAA;AAAA,QACP,QAAA,EAAU,cAAA;AAAA,QACV,MAAA,EAAO;AAAA;AAAA;AACT,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PipelineTaskNode.esm.js","sources":["../../../src/components/pipeline-topology/PipelineTaskNode.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport type { LegacyRef } from 'react';\n\nimport { useState, useContext, useRef, useMemo, memo } from 'react';\n\nimport { Tooltip } from '@patternfly/react-core';\nimport {\n DEFAULT_LAYER,\n DEFAULT_WHEN_OFFSET,\n GraphElement,\n Layer,\n Node,\n RunStatus,\n ScaleDetailsLevel,\n TaskNode,\n TOP_LAYER,\n useDetailsLevel,\n useHover,\n WhenDecorator,\n WithContextMenuProps,\n WithSelectionProps,\n} from '@patternfly/react-topology';\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport { observer } from 'mobx-react';\n\nimport { PipelineTaskWithStatus, TaskRunKind } from '@janus-idp/shared-react';\n\nimport { NodeType } from '../../consts/pipeline-topology-const';\nimport {\n TEKTON_PIPELINE_RUN,\n TEKTON_PIPELINE_TASK,\n} from '../../consts/tekton-const';\nimport { TektonResourcesContext } from '../../hooks/TektonResourcesContext';\nimport { StepStatus } from '../../types/taskRun';\nimport { TektonResourcesContextData } from '../../types/types';\nimport { createStepStatus } from '../../utils/pipeline-step-utils';\nimport { getTaskStatus } from '../../utils/pipelineRun-utils';\nimport PipelineRunLogDialog from '../PipelineRunLogs/PipelineRunLogDialog';\nimport { PipelineVisualizationStepList } from './PipelineVisualizationStepList';\n\nimport './PipelineTaskNode.css';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translations/index.ts';\n\ntype PipelineTaskNodeProps = {\n element: Node;\n} & WithContextMenuProps &\n WithSelectionProps &\n GraphElement;\n\nconst PipelineTaskNode = ({\n element,\n onContextMenu,\n contextMenuOpen,\n ...rest\n}: PipelineTaskNodeProps) => {\n const [open, setOpen] = useState<boolean>(false);\n const { watchResourcesData } = useContext<TektonResourcesContextData>(\n TektonResourcesContext,\n );\n const { t } = useTranslationRef(tektonTranslationRef);\n const data = element.getData();\n const triggerRef = useRef<SVGGElement | null>(null);\n\n const pipelineRun = data.pipelineRun;\n const [hover, hoverRef] = useHover();\n const detailsLevel = useDetailsLevel();\n const isFinallyTask = element.getType() === NodeType.FINALLY_NODE;\n\n const pods = watchResourcesData?.pods?.data || [];\n const taskRuns = watchResourcesData?.taskruns?.data || [];\n const openDialog = () => {\n setOpen(true);\n };\n\n const closeDialog = () => {\n setOpen(false);\n };\n\n const computedTask: PipelineTaskWithStatus = data.task;\n const stepList =\n computedTask?.status?.steps || computedTask?.taskSpec?.steps || [];\n\n const taskStatus = getTaskStatus(data.pipelineRun, data.task);\n\n const stepStatusList: StepStatus[] = stepList.map((step: { name: string }) =>\n createStepStatus(step, taskStatus, t),\n );\n const succeededStepsCount = stepStatusList.filter(\n ({ status }) => status === RunStatus.Succeeded,\n ).length;\n\n const badge =\n stepStatusList.length > 0 && data.status\n ? `${succeededStepsCount}/${stepStatusList.length}`\n : null;\n\n const passedData = useMemo(() => {\n const newData = { ...data };\n Object.keys(newData).forEach(key => {\n if (newData[key] === undefined) {\n delete newData[key];\n }\n });\n return newData;\n }, [data]);\n\n const hasTaskIcon = !!(data.taskIconClass || data.taskIcon);\n const whenDecorator = data.whenStatus ? (\n <WhenDecorator\n element={element}\n status={data.whenStatus}\n leftOffset={\n hasTaskIcon\n ? DEFAULT_WHEN_OFFSET + (element.getBounds().height - 4) * 0.75\n : DEFAULT_WHEN_OFFSET\n }\n />\n ) : null;\n const activeTaskId = taskRuns.find(\n (tr: TaskRunKind) =>\n tr?.metadata?.labels?.[TEKTON_PIPELINE_RUN] ===\n pipelineRun?.metadata?.name &&\n tr?.metadata?.labels?.[TEKTON_PIPELINE_TASK] === data.task?.name,\n )?.metadata?.name;\n\n const taskNode = (\n <>\n <PipelineRunLogDialog\n pipelineRun={pipelineRun}\n open={open}\n closeDialog={closeDialog}\n pods={pods}\n taskRuns={taskRuns}\n activeTask={activeTaskId}\n />\n <TaskNode\n className=\"bs-tkn-pipeline-task-node\"\n element={element}\n onContextMenu={data.showContextMenu ? onContextMenu : undefined}\n contextMenuOpen={contextMenuOpen}\n scaleNode={\n (hover || contextMenuOpen) && detailsLevel !== ScaleDetailsLevel.high\n }\n hideDetailsAtMedium\n {...passedData}\n {...rest}\n badge={badge}\n truncateLength={element.getData()?.label?.length}\n onSelect={activeTaskId && openDialog}\n >\n {whenDecorator}\n </TaskNode>\n </>\n );\n\n return (\n <Layer\n id={\n detailsLevel !== ScaleDetailsLevel.high && (hover || contextMenuOpen)\n ? TOP_LAYER\n : DEFAULT_LAYER\n }\n >\n <g\n data-test={`task ${element.getLabel()}`}\n className=\"bs-tkn-pipeline-task-node\"\n ref={hoverRef as LegacyRef<SVGGElement>}\n >\n <Tooltip\n position=\"bottom\"\n enableFlip={false}\n content={\n <PipelineVisualizationStepList\n isSpecOverview={!data.status}\n taskName={element.getLabel()}\n steps={stepStatusList}\n isFinallyTask={isFinallyTask}\n />\n }\n triggerRef={triggerRef}\n >\n <g ref={triggerRef}>{taskNode}</g>\n </Tooltip>\n </g>\n </Layer>\n );\n};\n\nexport default memo(observer(PipelineTaskNode));\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAgEA,MAAM,mBAAmB,CAAC;AAAA,EACxB,OAAA;AAAA,EACA,aAAA;AAAA,EACA,eAAA;AAAA,EACA,GAAG;AACL,CAAA,KAA6B;AAC3B,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAkB,KAAK,CAAA;AAC/C,EAAA,MAAM,EAAE,oBAAmB,GAAI,UAAA;AAAA,IAC7B;AAAA,GACF;AACA,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,oBAAoB,CAAA;AACpD,EAAA,MAAM,IAAA,GAAO,QAAQ,OAAA,EAAQ;AAC7B,EAAA,MAAM,UAAA,GAAa,OAA2B,IAAI,CAAA;AAElD,EAAA,MAAM,cAAc,IAAA,CAAK,WAAA;AACzB,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAI,QAAA,EAAS;AACnC,EAAA,MAAM,eAAe,eAAA,EAAgB;AACrC,EAAA,MAAM,aAAA,GAAgB,OAAA,CAAQ,OAAA,EAAQ,KAAM,QAAA,CAAS,YAAA;AAErD,EAAA,MAAM,IAAA,GAAO,kBAAA,EAAoB,IAAA,EAAM,IAAA,IAAQ,EAAC;AAChD,EAAA,MAAM,QAAA,GAAW,kBAAA,EAAoB,QAAA,EAAU,IAAA,IAAQ,EAAC;AACxD,EAAA,MAAM,aAAa,MAAM;AACvB,IAAA,OAAA,CAAQ,IAAI,CAAA;AAAA,EACd,CAAA;AAEA,EAAA,MAAM,cAAc,MAAM;AACxB,IAAA,OAAA,CAAQ,KAAK,CAAA;AAAA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,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,IACE,YAAA,KAAiB,iBAAA,CAAkB,IAAA,KAAS,KAAA,IAAS,mBACjD,SAAA,GACA,aAAA;AAAA,MAGN,QAAA,kBAAA,GAAA;AAAA,QAAC,GAAA;AAAA,QAAA;AAAA,UACC,WAAA,EAAW,CAAA,KAAA,EAAQ,OAAA,CAAQ,QAAA,EAAU,CAAA,CAAA;AAAA,UACrC,SAAA,EAAU,2BAAA;AAAA,UACV,GAAA,EAAK,QAAA;AAAA,UAEL,QAAA,kBAAA,GAAA;AAAA,YAAC,OAAA;AAAA,YAAA;AAAA,cACC,QAAA,EAAS,QAAA;AAAA,cACT,UAAA,EAAY,KAAA;AAAA,cACZ,OAAA,kBACE,GAAA;AAAA,gBAAC,6BAAA;AAAA,gBAAA;AAAA,kBACC,cAAA,EAAgB,CAAC,IAAA,CAAK,MAAA;AAAA,kBACtB,QAAA,EAAU,QAAQ,QAAA,EAAS;AAAA,kBAC3B,KAAA,EAAO,cAAA;AAAA,kBACP;AAAA;AAAA,eACF;AAAA,cAEF,UAAA;AAAA,cAEA,QAAA,kBAAA,GAAA,CAAC,GAAA,EAAA,EAAE,GAAA,EAAK,UAAA,EAAa,QAAA,EAAA,QAAA,EAAS;AAAA;AAAA;AAChC;AAAA;AACF;AAAA,GACF;AAEJ,CAAA;AAEA,yBAAe,IAAA,CAAK,QAAA,CAAS,gBAAgB,CAAC,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"PipelineTaskNode.esm.js","sources":["../../../src/components/pipeline-topology/PipelineTaskNode.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport type { LegacyRef } from 'react';\n\nimport { useState, useContext, useRef, useMemo, memo } from 'react';\n\nimport { Tooltip } from '@patternfly/react-core';\nimport {\n DEFAULT_LAYER,\n DEFAULT_WHEN_OFFSET,\n GraphElement,\n Layer,\n Node,\n RunStatus,\n ScaleDetailsLevel,\n TaskNode,\n TOP_LAYER,\n useDetailsLevel,\n useHover,\n WhenDecorator,\n WithContextMenuProps,\n WithSelectionProps,\n} from '@patternfly/react-topology';\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport { observer } from 'mobx-react';\n\nimport {\n PipelineTaskWithStatus,\n TaskRunKind,\n} from '@backstage-community/plugin-tekton-react';\n\nimport { NodeType } from '../../consts/pipeline-topology-const';\nimport {\n TEKTON_PIPELINE_RUN,\n TEKTON_PIPELINE_TASK,\n} from '../../consts/tekton-const';\nimport { TektonResourcesContext } from '../../hooks/TektonResourcesContext';\nimport { StepStatus } from '../../types/taskRun';\nimport { TektonResourcesContextData } from '../../types/types';\nimport { createStepStatus } from '../../utils/pipeline-step-utils';\nimport { getTaskStatus } from '../../utils/pipelineRun-utils';\nimport PipelineRunLogDialog from '../PipelineRunLogs/PipelineRunLogDialog';\nimport { PipelineVisualizationStepList } from './PipelineVisualizationStepList';\n\nimport './PipelineTaskNode.css';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translations/index.ts';\n\ntype PipelineTaskNodeProps = {\n element: Node;\n} & WithContextMenuProps &\n WithSelectionProps &\n GraphElement;\n\nconst PipelineTaskNode = ({\n element,\n onContextMenu,\n contextMenuOpen,\n ...rest\n}: PipelineTaskNodeProps) => {\n const [open, setOpen] = useState<boolean>(false);\n const { watchResourcesData } = useContext<TektonResourcesContextData>(\n TektonResourcesContext,\n );\n const { t } = useTranslationRef(tektonTranslationRef);\n const data = element.getData();\n const triggerRef = useRef<SVGGElement | null>(null);\n\n const pipelineRun = data.pipelineRun;\n const [hover, hoverRef] = useHover();\n const detailsLevel = useDetailsLevel();\n const isFinallyTask = element.getType() === NodeType.FINALLY_NODE;\n\n const pods = watchResourcesData?.pods?.data || [];\n const taskRuns = watchResourcesData?.taskruns?.data || [];\n const openDialog = () => {\n setOpen(true);\n };\n\n const closeDialog = () => {\n setOpen(false);\n };\n\n const computedTask: PipelineTaskWithStatus = data.task;\n const stepList =\n computedTask?.status?.steps || computedTask?.taskSpec?.steps || [];\n\n const taskStatus = getTaskStatus(data.pipelineRun, data.task);\n\n const stepStatusList: StepStatus[] = stepList.map((step: { name: string }) =>\n createStepStatus(step, taskStatus, t),\n );\n const succeededStepsCount = stepStatusList.filter(\n ({ status }) => status === RunStatus.Succeeded,\n ).length;\n\n const badge =\n stepStatusList.length > 0 && data.status\n ? `${succeededStepsCount}/${stepStatusList.length}`\n : null;\n\n const passedData = useMemo(() => {\n const newData = { ...data };\n Object.keys(newData).forEach(key => {\n if (newData[key] === undefined) {\n delete newData[key];\n }\n });\n return newData;\n }, [data]);\n\n const hasTaskIcon = !!(data.taskIconClass || data.taskIcon);\n const whenDecorator = data.whenStatus ? (\n <WhenDecorator\n element={element}\n status={data.whenStatus}\n leftOffset={\n hasTaskIcon\n ? DEFAULT_WHEN_OFFSET + (element.getBounds().height - 4) * 0.75\n : DEFAULT_WHEN_OFFSET\n }\n />\n ) : null;\n const activeTaskId = taskRuns.find(\n (tr: TaskRunKind) =>\n tr?.metadata?.labels?.[TEKTON_PIPELINE_RUN] ===\n pipelineRun?.metadata?.name &&\n tr?.metadata?.labels?.[TEKTON_PIPELINE_TASK] === data.task?.name,\n )?.metadata?.name;\n\n const taskNode = (\n <>\n <PipelineRunLogDialog\n pipelineRun={pipelineRun}\n open={open}\n closeDialog={closeDialog}\n pods={pods}\n taskRuns={taskRuns}\n activeTask={activeTaskId}\n />\n <TaskNode\n className=\"bs-tkn-pipeline-task-node\"\n element={element}\n onContextMenu={data.showContextMenu ? onContextMenu : undefined}\n contextMenuOpen={contextMenuOpen}\n scaleNode={\n (hover || contextMenuOpen) && detailsLevel !== ScaleDetailsLevel.high\n }\n hideDetailsAtMedium\n {...passedData}\n {...rest}\n badge={badge}\n truncateLength={element.getData()?.label?.length}\n onSelect={activeTaskId && openDialog}\n >\n {whenDecorator}\n </TaskNode>\n </>\n );\n\n return (\n <Layer\n id={\n detailsLevel !== ScaleDetailsLevel.high && (hover || contextMenuOpen)\n ? TOP_LAYER\n : DEFAULT_LAYER\n }\n >\n <g\n data-test={`task ${element.getLabel()}`}\n className=\"bs-tkn-pipeline-task-node\"\n ref={hoverRef as LegacyRef<SVGGElement>}\n >\n <Tooltip\n position=\"bottom\"\n enableFlip={false}\n content={\n <PipelineVisualizationStepList\n isSpecOverview={!data.status}\n taskName={element.getLabel()}\n steps={stepStatusList}\n isFinallyTask={isFinallyTask}\n />\n }\n triggerRef={triggerRef}\n >\n <g ref={triggerRef}>{taskNode}</g>\n </Tooltip>\n </g>\n </Layer>\n );\n};\n\nexport default memo(observer(PipelineTaskNode));\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAmEA,MAAM,mBAAmB,CAAC;AAAA,EACxB,OAAA;AAAA,EACA,aAAA;AAAA,EACA,eAAA;AAAA,EACA,GAAG;AACL,CAAA,KAA6B;AAC3B,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAkB,KAAK,CAAA;AAC/C,EAAA,MAAM,EAAE,oBAAmB,GAAI,UAAA;AAAA,IAC7B;AAAA,GACF;AACA,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,oBAAoB,CAAA;AACpD,EAAA,MAAM,IAAA,GAAO,QAAQ,OAAA,EAAQ;AAC7B,EAAA,MAAM,UAAA,GAAa,OAA2B,IAAI,CAAA;AAElD,EAAA,MAAM,cAAc,IAAA,CAAK,WAAA;AACzB,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAI,QAAA,EAAS;AACnC,EAAA,MAAM,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,GACF;AAEJ,CAAA;AAEA,yBAAe,IAAA,CAAK,QAAA,CAAS,gBAAgB,CAAC,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PipelineVisualization.esm.js","sources":["../../../src/components/pipeline-topology/PipelineVisualization.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {
|
|
1
|
+
{"version":3,"file":"PipelineVisualization.esm.js","sources":["../../../src/components/pipeline-topology/PipelineVisualization.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n PipelineRunKind,\n TaskRunKind,\n} from '@backstage-community/plugin-tekton-react';\n\nimport { useDarkTheme } from '../../hooks/useDarkTheme';\nimport { getGraphDataModel } from '../../utils/pipeline-topology-utils';\nimport { PipelineLayout } from './PipelineLayout';\n\nimport './PipelineVisualization.css';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../../translations/index.ts';\n\ntype PipelineVisualizationProps = {\n pipelineRun: PipelineRunKind | null;\n taskRuns: TaskRunKind[];\n};\n\nexport const PipelineVisualization = ({\n pipelineRun,\n taskRuns,\n}: PipelineVisualizationProps) => {\n useDarkTheme();\n\n const model = getGraphDataModel(pipelineRun ?? undefined, taskRuns ?? []);\n const { t } = useTranslationRef(tektonTranslationRef);\n\n return (\n <>\n {!model || (model.nodes.length === 0 && model.edges.length === 0) ? (\n <div data-testid=\"pipeline-no-tasks\">\n {t('pipelineVisualization.noTasksDescription')}\n </div>\n ) : (\n <div\n data-testid=\"pipelineRun-visualization\"\n className=\"bs-tkn-pipeline-visualization__layout\"\n >\n <PipelineLayout model={model} />\n </div>\n )}\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAiCO,MAAM,wBAAwB,CAAC;AAAA,EACpC,WAAA;AAAA,EACA;AACF,CAAA,KAAkC;AAChC,EAAA,YAAA,EAAa;AAEb,EAAA,MAAM,QAAQ,iBAAA,CAAkB,WAAA,IAAe,MAAA,EAAW,QAAA,IAAY,EAAE,CAAA;AACxE,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,oBAAoB,CAAA;AAEpD,EAAA,uCAEK,QAAA,EAAA,CAAC,KAAA,IAAU,MAAM,KAAA,CAAM,MAAA,KAAW,KAAK,KAAA,CAAM,KAAA,CAAM,MAAA,KAAW,CAAA,uBAC5D,KAAA,EAAA,EAAI,aAAA,EAAY,qBACd,QAAA,EAAA,CAAA,CAAE,0CAA0C,GAC/C,CAAA,mBAEA,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,aAAA,EAAY,2BAAA;AAAA,MACZ,SAAA,EAAU,uCAAA;AAAA,MAEV,QAAA,kBAAA,GAAA,CAAC,kBAAe,KAAA,EAAc;AAAA;AAAA,GAChC,EAEJ,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TektonResourcesContext.esm.js","sources":["../../src/hooks/TektonResourcesContext.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createContext } from 'react';\n\nimport { ComputedStatus } from '@
|
|
1
|
+
{"version":3,"file":"TektonResourcesContext.esm.js","sources":["../../src/hooks/TektonResourcesContext.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createContext } from 'react';\n\nimport { ComputedStatus } from '@backstage-community/plugin-tekton-react';\n\nimport { TektonResourcesContextData } from '../types/types';\n\nexport const TektonResourcesContext = createContext<TektonResourcesContextData>(\n {\n clusters: [],\n selectedStatus: ComputedStatus.All,\n setSelectedCluster: () => {},\n setSelectedStatus: () => {},\n setIsExpanded: () => {},\n },\n);\n"],"names":[],"mappings":";;;AAqBO,MAAM,sBAAA,GAAyB,aAAA;AAAA,EACpC;AAAA,IACE,UAAU,EAAC;AAAA,IACX,gBAAgB,cAAA,CAAe,GAAA;AAAA,IAC/B,oBAAoB,MAAM;AAAA,IAAC,CAAA;AAAA,IAC3B,mBAAmB,MAAM;AAAA,IAAC,CAAA;AAAA,IAC1B,eAAe,MAAM;AAAA,IAAC;AAAA;AAE1B;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePipelineRunScanResults.esm.js","sources":["../../src/hooks/usePipelineRunScanResults.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useMemo } from 'react';\n\nimport { PipelineRunKind } from '@
|
|
1
|
+
{"version":3,"file":"usePipelineRunScanResults.esm.js","sources":["../../src/hooks/usePipelineRunScanResults.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useMemo } from 'react';\n\nimport { PipelineRunKind } from '@backstage-community/plugin-tekton-react';\n\nimport { PipelineRunScanResults } from '../types/types';\n\nconst SCAN_OUTPUT_SUFFIX = 'SCAN_OUTPUT';\n\nexport const getPipelineRunScanResults = (\n pipelineRun: PipelineRunKind,\n): PipelineRunScanResults =>\n (pipelineRun.status?.results || pipelineRun.status?.pipelineResults)?.reduce(\n (acc, result) => {\n if (result.name?.endsWith(SCAN_OUTPUT_SUFFIX)) {\n if (!acc.vulnerabilities) {\n acc.vulnerabilities = { critical: 0, high: 0, medium: 0, low: 0 };\n }\n try {\n const taskVulnerabilities = JSON.parse(result.value);\n if (taskVulnerabilities.vulnerabilities) {\n acc.vulnerabilities.critical +=\n taskVulnerabilities.vulnerabilities.critical || 0;\n acc.vulnerabilities.high +=\n taskVulnerabilities.vulnerabilities.high || 0;\n acc.vulnerabilities.medium +=\n taskVulnerabilities.vulnerabilities.medium || 0;\n acc.vulnerabilities.low +=\n taskVulnerabilities.vulnerabilities.low || 0;\n }\n } catch (e) {\n // ignore\n }\n }\n return acc;\n },\n {} as PipelineRunScanResults,\n ) || {};\n\nexport const usePipelineRunScanResults = (\n pipelineRun: PipelineRunKind,\n): PipelineRunScanResults => {\n return useMemo(() => {\n if (!pipelineRun) {\n return {};\n }\n\n return getPipelineRunScanResults(pipelineRun);\n }, [pipelineRun]);\n};\n"],"names":[],"mappings":";;AAqBA,MAAM,kBAAA,GAAqB,aAAA;AAEpB,MAAM,yBAAA,GAA4B,CACvC,WAAA,KAAA,CAEC,WAAA,CAAY,QAAQ,OAAA,IAAW,WAAA,CAAY,QAAQ,eAAA,GAAkB,MAAA;AAAA,EACpE,CAAC,KAAK,MAAA,KAAW;AACf,IAAA,IAAI,MAAA,CAAO,IAAA,EAAM,QAAA,CAAS,kBAAkB,CAAA,EAAG;AAC7C,MAAA,IAAI,CAAC,IAAI,eAAA,EAAiB;AACxB,QAAA,GAAA,CAAI,eAAA,GAAkB,EAAE,QAAA,EAAU,CAAA,EAAG,MAAM,CAAA,EAAG,MAAA,EAAQ,CAAA,EAAG,GAAA,EAAK,CAAA,EAAE;AAAA,MAClE;AACA,MAAA,IAAI;AACF,QAAA,MAAM,mBAAA,GAAsB,IAAA,CAAK,KAAA,CAAM,MAAA,CAAO,KAAK,CAAA;AACnD,QAAA,IAAI,oBAAoB,eAAA,EAAiB;AACvC,UAAA,GAAA,CAAI,eAAA,CAAgB,QAAA,IAClB,mBAAA,CAAoB,eAAA,CAAgB,QAAA,IAAY,CAAA;AAClD,UAAA,GAAA,CAAI,eAAA,CAAgB,IAAA,IAClB,mBAAA,CAAoB,eAAA,CAAgB,IAAA,IAAQ,CAAA;AAC9C,UAAA,GAAA,CAAI,eAAA,CAAgB,MAAA,IAClB,mBAAA,CAAoB,eAAA,CAAgB,MAAA,IAAU,CAAA;AAChD,UAAA,GAAA,CAAI,eAAA,CAAgB,GAAA,IAClB,mBAAA,CAAoB,eAAA,CAAgB,GAAA,IAAO,CAAA;AAAA,QAC/C;AAAA,MACF,SAAS,CAAA,EAAG;AAAA,MAEZ;AAAA,IACF;AACA,IAAA,OAAO,GAAA;AAAA,EACT,CAAA;AAAA,EACA;AACF,CAAA,IAAK;AAEA,MAAM,yBAAA,GAA4B,CACvC,WAAA,KAC2B;AAC3B,EAAA,OAAO,QAAQ,MAAM;AACnB,IAAA,IAAI,CAAC,WAAA,EAAa;AAChB,MAAA,OAAO,EAAC;AAAA,IACV;AAEA,IAAA,OAAO,0BAA0B,WAAW,CAAA;AAAA,EAC9C,CAAA,EAAG,CAAC,WAAW,CAAC,CAAA;AAClB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTektonObjectsResponse.esm.js","sources":["../../src/hooks/useTektonObjectsResponse.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useState, useRef, useEffect, useCallback } from 'react';\n\nimport { useEntity } from '@backstage/plugin-catalog-react';\n\nimport { isEqual } from 'lodash';\n\nimport { ComputedStatus } from '@
|
|
1
|
+
{"version":3,"file":"useTektonObjectsResponse.esm.js","sources":["../../src/hooks/useTektonObjectsResponse.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useState, useRef, useEffect, useCallback } from 'react';\n\nimport { useEntity } from '@backstage/plugin-catalog-react';\n\nimport { isEqual } from 'lodash';\n\nimport { ComputedStatus } from '@backstage-community/plugin-tekton-react';\n\nimport { useKubernetesObjects } from '@backstage/plugin-kubernetes-react';\nimport { TektonResourcesContextData, TektonResponseData } from '../types/types';\nimport { useAllWatchResources } from './useAllWatchResources';\nimport { useResourcesClusters } from './useResourcesClusters';\nimport { useDebounceCallback } from './useDebounceCallback';\nimport { useDeepCompareMemoize } from './useDeepCompareMemoize';\n\nexport const useTektonObjectsResponse = (\n watchedResource: string[],\n): TektonResourcesContextData => {\n const { entity } = useEntity();\n const { kubernetesObjects, loading, error } = useKubernetesObjects(entity);\n const [selectedCluster, setSelectedCluster] = useState<number>(0);\n const [selectedStatus, setSelectedStatus] = useState<ComputedStatus>(\n 'All' as ComputedStatus,\n );\n const [isExpanded, setIsExpanded] = useState<boolean>(false);\n const [loaded, setLoaded] = useState<boolean>(false);\n const [errorState, setErrorState] = useState<string>();\n const [pipelinesData, setPipelinesData] = useState<\n TektonResponseData | undefined\n >();\n\n const mounted = useRef(false);\n\n useEffect(() => {\n mounted.current = true;\n return () => {\n mounted.current = false;\n };\n }, []);\n\n const watchResourcesData = useAllWatchResources(\n { kubernetesObjects, loading, error },\n selectedCluster,\n watchedResource,\n );\n\n const resourcesClusters = useResourcesClusters({\n kubernetesObjects,\n loading,\n error,\n });\n\n const updateResults = useCallback(\n (\n resData: TektonResponseData,\n isLoading: boolean,\n errorData: string | undefined,\n ) => {\n if (!isLoading && !errorData && mounted.current) {\n setLoaded(true);\n setPipelinesData(prevPipelinesData => {\n if (isEqual(prevPipelinesData, resData)) {\n return prevPipelinesData;\n }\n return resData;\n });\n } else if (errorData && mounted.current) {\n setLoaded(true);\n setErrorState(errorData);\n }\n },\n [setLoaded, setPipelinesData, setErrorState],\n );\n\n const debouncedUpdateResources = useDebounceCallback(updateResults, 250);\n\n useEffect(() => {\n debouncedUpdateResources?.(watchResourcesData, loading, error);\n }, [debouncedUpdateResources, watchResourcesData, loading, error]);\n\n return useDeepCompareMemoize({\n watchResourcesData: pipelinesData,\n loaded,\n responseError: errorState,\n selectedClusterErrors: resourcesClusters?.errors?.[selectedCluster] ?? [],\n clusters: resourcesClusters?.clusters || [],\n selectedCluster,\n setSelectedCluster,\n selectedStatus,\n setSelectedStatus,\n isExpanded,\n setIsExpanded,\n });\n};\n"],"names":[],"mappings":";;;;;;;;;AA8BO,MAAM,wBAAA,GAA2B,CACtC,eAAA,KAC+B;AAC/B,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,SAAA,EAAU;AAC7B,EAAA,MAAM,EAAE,iBAAA,EAAmB,OAAA,EAAS,KAAA,EAAM,GAAI,qBAAqB,MAAM,CAAA;AACzE,EAAA,MAAM,CAAC,eAAA,EAAiB,kBAAkB,CAAA,GAAI,SAAiB,CAAC,CAAA;AAChE,EAAA,MAAM,CAAC,cAAA,EAAgB,iBAAiB,CAAA,GAAI,QAAA;AAAA,IAC1C;AAAA,GACF;AACA,EAAA,MAAM,CAAC,UAAA,EAAY,aAAa,CAAA,GAAI,SAAkB,KAAK,CAAA;AAC3D,EAAA,MAAM,CAAC,MAAA,EAAQ,SAAS,CAAA,GAAI,SAAkB,KAAK,CAAA;AACnD,EAAA,MAAM,CAAC,UAAA,EAAY,aAAa,CAAA,GAAI,QAAA,EAAiB;AACrD,EAAA,MAAM,CAAC,aAAA,EAAe,gBAAgB,CAAA,GAAI,QAAA,EAExC;AAEF,EAAA,MAAM,OAAA,GAAU,OAAO,KAAK,CAAA;AAE5B,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,OAAA,CAAQ,OAAA,GAAU,IAAA;AAClB,IAAA,OAAO,MAAM;AACX,MAAA,OAAA,CAAQ,OAAA,GAAU,KAAA;AAAA,IACpB,CA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ACA,aAAA,EAAe,UAAA;AAAA,IACf,qBAAA,EAAuB,iBAAA,EAAmB,MAAA,GAAS,eAAe,KAAK,EAAC;AAAA,IACxE,QAAA,EAAU,iBAAA,EAAmB,QAAA,IAAY,EAAC;AAAA,IAC1C,eAAA;AAAA,IACA,kBAAA;AAAA,IACA,cAAA;AAAA,IACA,iBAAA;AAAA,IACA,UAAA;AAAA,IACA;AAAA,GACD,CAAA;AACH;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -55,15 +55,15 @@ declare const tektonTranslationRef: _backstage_core_plugin_api_alpha.Translation
|
|
|
55
55
|
readonly "pipelineRunList.rowActions.SBOMNotApplicable": "View SBOM is not applicable for this PipelineRun";
|
|
56
56
|
readonly "pipelineRunList.rowActions.viewOutput": "View output";
|
|
57
57
|
readonly "pipelineRunList.rowActions.outputNotApplicable": "View Output is not applicable for this PipelineRun";
|
|
58
|
+
readonly "pipelineRunList.vulnerabilitySeverityTitle.medium": "Medium";
|
|
58
59
|
readonly "pipelineRunList.vulnerabilitySeverityTitle.critical": "Critical";
|
|
59
60
|
readonly "pipelineRunList.vulnerabilitySeverityTitle.high": "High";
|
|
60
|
-
readonly "pipelineRunList.vulnerabilitySeverityTitle.medium": "Medium";
|
|
61
61
|
readonly "pipelineRunList.vulnerabilitySeverityTitle.low": "Low";
|
|
62
62
|
readonly "pipelineRunList.tableHeaderTitle.name": "NAME";
|
|
63
|
-
readonly "pipelineRunList.tableHeaderTitle.
|
|
63
|
+
readonly "pipelineRunList.tableHeaderTitle.startTime": "STARTED";
|
|
64
64
|
readonly "pipelineRunList.tableHeaderTitle.status": "STATUS";
|
|
65
65
|
readonly "pipelineRunList.tableHeaderTitle.taskStatus": "TASK STATUS";
|
|
66
|
-
readonly "pipelineRunList.tableHeaderTitle.
|
|
66
|
+
readonly "pipelineRunList.tableHeaderTitle.vulnerabilities": "VULNERABILITIES";
|
|
67
67
|
readonly "pipelineRunList.tableHeaderTitle.duration": "DURATION";
|
|
68
68
|
readonly "pipelineRunList.tableHeaderTitle.actions": "ACTIONS";
|
|
69
69
|
readonly "pipelineRunList.tablePagination.rowsPerPageOptionLabel": "{{num}} rows";
|
|
@@ -76,7 +76,6 @@ declare const tektonTranslationRef: _backstage_core_plugin_api_alpha.Translation
|
|
|
76
76
|
readonly "pipelineRunLogs.taskStatusStepper.skipped": "Skipped";
|
|
77
77
|
readonly "pipelineRunOutput.title": "PipelineRun Output";
|
|
78
78
|
readonly "pipelineRunOutput.noOutput": "No output";
|
|
79
|
-
readonly "pipelineRunStatus.Skipped": "Skipped";
|
|
80
79
|
readonly "pipelineRunStatus.All": "All";
|
|
81
80
|
readonly "pipelineRunStatus.Cancelling": "Cancelling";
|
|
82
81
|
readonly "pipelineRunStatus.Succeeded": "Succeeded";
|
|
@@ -85,6 +84,7 @@ declare const tektonTranslationRef: _backstage_core_plugin_api_alpha.Translation
|
|
|
85
84
|
readonly "pipelineRunStatus.In Progress": "In Progress";
|
|
86
85
|
readonly "pipelineRunStatus.FailedToStart": "FailedToStart";
|
|
87
86
|
readonly "pipelineRunStatus.PipelineNotStarted": "PipelineNotStarted";
|
|
87
|
+
readonly "pipelineRunStatus.Skipped": "Skipped";
|
|
88
88
|
readonly "pipelineRunStatus.Cancelled": "Cancelled";
|
|
89
89
|
readonly "pipelineRunStatus.Pending": "Pending";
|
|
90
90
|
readonly "pipelineRunStatus.Idle": "Idle";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.esm.js","sources":["../../src/types/types.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Dispatch, SetStateAction } from 'react';\n\nimport { ComputedStatus } from '@
|
|
1
|
+
{"version":3,"file":"types.esm.js","sources":["../../src/types/types.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Dispatch, SetStateAction } from 'react';\n\nimport { ComputedStatus } from '@backstage-community/plugin-tekton-react';\n\nexport const tektonGroupColor = '#38812f';\n\nexport type GroupVersionKind = {\n kind: string;\n apiVersion: string;\n apiGroup?: string;\n};\n\nexport type TektonResponseData = {\n [key: string]: { data: any[] };\n};\n\nexport type ClusterError = {\n errorType?: string;\n message?: string;\n resourcePath?: string;\n statusCode?: number;\n};\n\nexport type ClusterErrors = ClusterError[];\n\nexport type TektonResourcesContextData = {\n watchResourcesData?: TektonResponseData;\n loaded?: boolean;\n responseError?: string;\n selectedClusterErrors?: ClusterErrors;\n clusters: string[];\n selectedCluster?: number;\n setSelectedCluster: Dispatch<SetStateAction<number>>;\n selectedStatus: ComputedStatus;\n setSelectedStatus: Dispatch<SetStateAction<ComputedStatus>>;\n isExpanded?: boolean;\n setIsExpanded: Dispatch<SetStateAction<boolean>>;\n};\n\nexport type Order = 'asc' | 'desc';\n\nexport type OpenRowStatus = {\n [x: string]: boolean;\n};\n\nexport type PipelineRunScanResults = {\n vulnerabilities?: {\n critical: number;\n high: number;\n medium: number;\n low: number;\n };\n};\n"],"names":[],"mappings":"AAoBO,MAAM,gBAAA,GAAmB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isTektonCIAvailable.esm.js","sources":["../../src/utils/isTektonCIAvailable.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Entity } from '@backstage/catalog-model';\n\nimport { TektonAnnotations } from '@backstage-community/plugin-tekton-common';\n\
|
|
1
|
+
{"version":3,"file":"isTektonCIAvailable.esm.js","sources":["../../src/utils/isTektonCIAvailable.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Entity } from '@backstage/catalog-model';\n\nimport { TektonAnnotations } from '@backstage-community/plugin-tekton-common';\n\nconst DEPRECATED_JANUS_IDP_ANNOTATION = 'janus-idp.io/tekton';\n\n/**\n * Returns true if the entity supports the Tekton CI/CD feature and\n * the Tekton CI/CD card should be shown on the CI/CD tab.\n *\n * This means that the catalog entity has one of this annotations set:\n *\n * 1. `tekton.dev/ci-cd: \"true\"` or\n * 2. `janus-idp.io/tekton` is defined (any value is accepted).\n *\n * @public\n */\nexport const isTektonCIAvailable = (entity: Entity): boolean =>\n entity.metadata.annotations?.[TektonAnnotations.CICD] === 'true' ||\n Boolean(entity.metadata.annotations?.[DEPRECATED_JANUS_IDP_ANNOTATION]);\n"],"names":[],"mappings":";;AAmBA,MAAM,+BAAA,GAAkC,qBAAA;AAajC,MAAM,mBAAA,GAAsB,CAAC,MAAA,KAClC,MAAA,CAAO,SAAS,WAAA,GAAc,iBAAA,CAAkB,IAAI,CAAA,KAAM,UAC1D,OAAA,CAAQ,MAAA,CAAO,QAAA,CAAS,WAAA,GAAc,+BAA+B,CAAC;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComputedStatus, TerminatedReasons } from '@
|
|
1
|
+
import { ComputedStatus, TerminatedReasons } from '@backstage-community/plugin-tekton-react';
|
|
2
2
|
import { calculateDuration } from './tekton-utils.esm.js';
|
|
3
3
|
|
|
4
4
|
const getMatchingStepDuration = (t, matchingStep) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline-step-utils.esm.js","sources":["../../src/utils/pipeline-step-utils.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {
|
|
1
|
+
{"version":3,"file":"pipeline-step-utils.esm.js","sources":["../../src/utils/pipeline-step-utils.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n ComputedStatus,\n TerminatedReasons,\n} from '@backstage-community/plugin-tekton-react';\n\nimport { StepStatus, TaskStatus, TaskStatusStep } from '../types/taskRun';\nimport { calculateDuration } from './tekton-utils';\nimport { TranslationFunction } from '@backstage/core-plugin-api/alpha';\nimport { tektonTranslationRef } from '../translations/index.ts';\n\nconst getMatchingStepDuration = (\n t: TranslationFunction<typeof tektonTranslationRef.T>,\n matchingStep?: TaskStatusStep,\n) => {\n if (!matchingStep) return '';\n\n if (matchingStep.terminated) {\n return calculateDuration(\n t,\n matchingStep.terminated.startedAt,\n matchingStep.terminated.finishedAt,\n );\n }\n\n if (matchingStep.running) {\n return calculateDuration(t, matchingStep.running.startedAt);\n }\n\n return '';\n};\n\nconst getMatchingStep = (\n step: { name: string },\n status: TaskStatus,\n): TaskStatusStep | undefined => {\n const statusSteps: TaskStatusStep[] = status.steps || [];\n return statusSteps.find(statusStep => {\n // In rare occasions the status step name is prefixed with `step-`\n // This is likely a bug but this workaround will be temporary as it's investigated separately\n return (\n statusStep.name === step.name || statusStep.name === `step-${step.name}`\n );\n });\n};\n\nexport const createStepStatus = (\n step: { name: string },\n status: TaskStatus,\n t: TranslationFunction<typeof tektonTranslationRef.T>,\n): StepStatus => {\n let stepRunStatus = ComputedStatus.PipelineNotStarted;\n let duration = null;\n\n if (!status?.reason) {\n stepRunStatus = ComputedStatus.Cancelled;\n } else if (status.reason === ComputedStatus['In Progress']) {\n // In progress, try to get granular statuses\n const matchingStep = getMatchingStep(step, status);\n\n if (!matchingStep) {\n stepRunStatus = ComputedStatus.Pending;\n } else if (matchingStep.terminated) {\n stepRunStatus =\n matchingStep.terminated.reason === TerminatedReasons.Completed\n ? ComputedStatus.Succeeded\n : ComputedStatus.Failed;\n duration = getMatchingStepDuration(t, matchingStep);\n } else if (matchingStep.running) {\n stepRunStatus = ComputedStatus['In Progress'];\n duration = getMatchingStepDuration(t, matchingStep);\n } else if (matchingStep.waiting) {\n stepRunStatus = ComputedStatus.Pending;\n }\n } else {\n // Not in progress, just use the run status reason\n stepRunStatus = status.reason;\n\n duration =\n getMatchingStepDuration(t, getMatchingStep(step, status)) ||\n status.duration;\n }\n\n return {\n duration,\n name: step.name,\n status: stepRunStatus as any,\n };\n};\n"],"names":[],"mappings":";;;AAyBA,MAAM,uBAAA,GAA0B,CAC9B,CAAA,EACA,YAAA,KACG;AACH,EAAA,IAAI,CAAC,cAAc,OAAO,EAAA;AAE1B,EAAA,IAAI,aAAa,UAAA,EAAY;AAC3B,IAAA,OAAO,iBAAA;AAAA,MACL,CAAA;AAAA,MACA,aAAa,UAAA,CAAW,SAAA;AAAA,MACxB,aAAa,UAAA,CAAW;AAAA,KAC1B;AAAA,EACF;AAEA,EAAA,IAAI,aAAa,OAAA,EAAS;AACxB,IAAA,OAAO,iBAAA,CAAkB,CAAA,EAAG,YAAA,CAAa,OAAA,CAAQ,SAAS,CAAA;AAAA,EAC5D;AAEA,EAAA,OAAO,EAAA;AACT,CAAA;AAEA,MAAM,eAAA,GAAkB,CACtB,IAAA,EACA,MAAA,KAC+B;AAC/B,EAAA,MAAM,WAAA,GAAgC,MAAA,CAAO,KAAA,IAAS,EAAC;AACvD,EAAA,OAAO,WAAA,CAAY,KAAK,CAAA,UAAA,KAAc;AAGpC,IAAA,OACE,UAAA,CAAW,SAAS,IAAA,CAAK,IAAA,IAAQ,WAAW,IAAA,KAAS,CAAA,KAAA,EAAQ,KAAK,IAAI,CAAA,CAAA;AAAA,EAE1E,CAAC,CAAA;AACH,CAAA;AAEO,MAAM,gBAAA,GAAmB,CAC9B,IAAA,EACA,MAAA,EACA,CAAA,KACe;AACf,EAAA,IAAI,gBAAgB,cAAA,CAAe,kBAAA;AACnC,EAAA,IAAI,QAAA,GAAW,IAAA;AAEf,EAAA,IAAI,CAAC,QAAQ,MAAA,EAAQ;AACnB,IAAA,aAAA,GAAgB,cAAA,CAAe,SAAA;AAAA,EACjC,CAAA,MAAA,IAAW,MAAA,CAAO,MAAA,KAAW,cAAA,CAAe,aAAa,CAAA,EAAG;AAE1D,IAAA,MAAM,YAAA,GAAe,eAAA,CAAgB,IAAA,EAAM,MAAM,CAAA;AAEjD,IAAA,IAAI,CAAC,YAAA,EAAc;AACjB,MAAA,aAAA,GAAgB,cAAA,CAAe,OAAA;AAAA,IACjC,CAAA,MAAA,IAAW,aAAa,UAAA,EAAY;AAClC,MAAA,aAAA,GACE,aAAa,UAAA,CAAW,MAAA,KAAW,kBAAkB,SAAA,GACjD,cAAA,CAAe,YACf,cAAA,CAAe,MAAA;AACrB,MAAA,QAAA,GAAW,uBAAA,CAAwB,GAAG,YAAY,CAAA;AAAA,IACpD,CAAA,MAAA,IAAW,aAAa,OAAA,EAAS;AAC/B,MAAA,aAAA,GAAgB,eAAe,aAAa,CAAA;AAC5C,MAAA,QAAA,GAAW,uBAAA,CAAwB,GAAG,YAAY,CAAA;AAAA,IACpD,CAAA,MAAA,IAAW,aAAa,OAAA,EAAS;AAC/B,MAAA,aAAA,GAAgB,cAAA,CAAe,OAAA;AAAA,IACjC;AAAA,EACF,CAAA,MAAO;AAEL,IAAA,aAAA,GAAgB,MAAA,CAAO,MAAA;AAEvB,IAAA,QAAA,GACE,wBAAwB,CAAA,EAAG,eAAA,CAAgB,MAAM,MAAM,CAAC,KACxD,MAAA,CAAO,QAAA;AAAA,EACX;AAEA,EAAA,OAAO;AAAA,IACL,QAAA;AAAA,IACA,MAAM,IAAA,CAAK,IAAA;AAAA,IACX,MAAA,EAAQ;AAAA,GACV;AACF;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RunStatus, getSpacerNodes, getEdgesFromNodes, ModelKind, WhenStatus } from '@patternfly/react-topology';
|
|
2
2
|
import { uniq, minBy } from 'lodash';
|
|
3
|
-
import { ComputedStatus } from '@
|
|
3
|
+
import { ComputedStatus } from '@backstage-community/plugin-tekton-react';
|
|
4
4
|
import { DAG } from '../components/pipeline-topology/dag.esm.js';
|
|
5
5
|
import { DEFAULT_BADGE_WIDTH, NODE_WIDTH, NODE_HEIGHT, NODE_PADDING, DEFAULT_NODE_ICON_WIDTH, NodeType, DEFAULT_FINALLLY_GROUP_PADDING, PipelineLayout, DEFAULT_NODE_HEIGHT, DAGRE_BUILDER_SPACED_PROPS, DAGRE_VIEWER_SPACED_PROPS, DAGRE_VIEWER_PROPS, DAGRE_BUILDER_PROPS, REGEX_EXTRACT_DEPS } from '../consts/pipeline-topology-const.esm.js';
|
|
6
6
|
import { getPLRTaskRuns, appendPipelineRunStatus } from './pipelineRun-utils.esm.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline-topology-utils.esm.js","sources":["../../src/utils/pipeline-topology-utils.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n EdgeModel,\n getEdgesFromNodes,\n getSpacerNodes,\n GraphModel,\n ModelKind,\n RunStatus,\n WhenStatus,\n} from '@patternfly/react-topology';\nimport * as dagre from 'dagre';\nimport { minBy, uniq } from 'lodash';\n\nimport {\n ComputedStatus,\n PipelineRunKind,\n PipelineTask,\n PipelineTaskParam,\n PipelineTaskWithStatus,\n TaskRunKind,\n} from '@janus-idp/shared-react';\n\nimport { DAG, Vertex } from '../components/pipeline-topology/dag';\nimport {\n DAGRE_BUILDER_PROPS,\n DAGRE_BUILDER_SPACED_PROPS,\n DAGRE_VIEWER_PROPS,\n DAGRE_VIEWER_SPACED_PROPS,\n DEFAULT_BADGE_WIDTH,\n DEFAULT_FINALLLY_GROUP_PADDING,\n DEFAULT_NODE_HEIGHT,\n DEFAULT_NODE_ICON_WIDTH,\n FINALLY_NODE_PADDING,\n NODE_HEIGHT,\n NODE_PADDING,\n NODE_WIDTH,\n NodeType,\n PipelineLayout,\n REGEX_EXTRACT_DEPS,\n WHEN_EXPRESSION_SPACING,\n} from '../consts/pipeline-topology-const';\nimport {\n FinallyNodeModel,\n LoadingNodeModel,\n NodeCreator,\n NodeCreatorSetup,\n PipelineEdgeModel,\n PipelineMixedNodeModel,\n PipelineRunAfterNodeModelData,\n} from '../types/pipeline-topology-types';\nimport { appendPipelineRunStatus, getPLRTaskRuns } from './pipelineRun-utils';\n\nconst createGenericNode: NodeCreatorSetup =\n (type, width?, height?) => (name, data) => ({\n id: name,\n label: data?.label || name,\n runAfterTasks: data?.runAfterTasks || [],\n ...(data && { data }),\n height: height ?? NODE_HEIGHT,\n width: width ?? NODE_WIDTH,\n type,\n });\n\nconst getMaxFinallyNode = (finallyTaskList: PipelineTaskWithStatus[]) => {\n const sortedFinallyTaskList = [...finallyTaskList].sort(\n (a, b) => b.name.length - a.name.length,\n );\n return sortedFinallyTaskList[0]?.name || '';\n};\n\nexport const createFinallyNode = (\n height: number,\n): NodeCreator<FinallyNodeModel> =>\n createGenericNode(\n NodeType.FINALLY_NODE,\n NODE_WIDTH + WHEN_EXPRESSION_SPACING + FINALLY_NODE_PADDING * 2,\n height,\n );\n\nexport const createLoadingNode: NodeCreator<LoadingNodeModel> =\n createGenericNode(NodeType.LOADING_NODE);\n\nconst createPipelineTaskNode = (\n type: NodeType,\n data: PipelineRunAfterNodeModelData,\n) => createGenericNode(type, data.width, data.height)(data.id ?? '', data);\n\nexport const getTextWidth = (\n text: string,\n font: string = '0.8rem RedHatText',\n): number => {\n if (!text || text.length === 0) {\n return 0;\n }\n const canvas = document.createElement('canvas');\n const context = canvas.getContext('2d');\n if (!context) {\n return text.length;\n }\n context.font = font;\n const { width } = context.measureText(text);\n return width;\n};\n\nexport const extractDepsFromContextVariables = (\n contextVariable: string | null | undefined,\n) => {\n let matches;\n const deps: string[] = [];\n if (!contextVariable) {\n return deps;\n }\n // eslint-disable-next-line no-cond-assign\n while ((matches = REGEX_EXTRACT_DEPS.exec(contextVariable)) !== null) {\n // This is necessary to avoid infinite loops with zero-width matches\n if (matches.index === REGEX_EXTRACT_DEPS.lastIndex) {\n REGEX_EXTRACT_DEPS.lastIndex++;\n }\n if (matches) {\n if (!deps.includes(matches[1])) {\n deps.push(matches[1]);\n }\n }\n }\n return deps;\n};\n\nexport const getSpacerNode = (\n node: PipelineMixedNodeModel,\n): PipelineMixedNodeModel => ({\n ...node,\n height: 1,\n width: 1,\n});\n\nexport const getWhenStatus = (\n status: ComputedStatus,\n): WhenStatus | undefined => {\n switch (status) {\n case ComputedStatus.Succeeded:\n case ComputedStatus.Failed:\n return WhenStatus.Met;\n case ComputedStatus.Skipped:\n case ComputedStatus['In Progress']:\n case ComputedStatus.Idle:\n return WhenStatus.Unmet;\n default:\n return undefined;\n }\n};\n\nexport const getTaskWhenStatus = (\n task: PipelineTaskWithStatus,\n): WhenStatus | undefined => {\n if (!task.when) {\n return undefined;\n }\n return getWhenStatus(task.status?.reason as ComputedStatus);\n};\n\nconst getDepsFromContextVariables = (task: PipelineTask) => {\n const depsFromContextVariables: string[] = [];\n if (task.params) {\n task.params.forEach((p: PipelineTaskParam) => {\n if (Array.isArray(p.value)) {\n p.value.forEach(paramValue => {\n depsFromContextVariables.push(\n ...extractDepsFromContextVariables(paramValue),\n );\n });\n } else {\n depsFromContextVariables.push(\n ...extractDepsFromContextVariables(p.value),\n );\n }\n });\n }\n if (task?.when) {\n task.when.forEach(({ input, values }) => {\n depsFromContextVariables.push(...extractDepsFromContextVariables(input));\n values.forEach((whenValue: string) => {\n depsFromContextVariables.push(\n ...extractDepsFromContextVariables(whenValue),\n );\n });\n });\n }\n return depsFromContextVariables;\n};\n\nconst getRunAfterTasks = (task: PipelineTask, dag: DAG, vertex: Vertex) => {\n const runAfterTasks: string[] = [];\n const depsFromContextVariables = getDepsFromContextVariables(task);\n\n const dependancies = uniq([...vertex.dependancyNames]);\n if (dependancies) {\n dependancies.forEach(dep => {\n const depObj = dag.vertices.get(dep) as Vertex;\n if (\n depObj.level - vertex.level <= 1 ||\n vertex.data.runAfter?.includes(depObj.name)\n ) {\n runAfterTasks.push(dep);\n }\n });\n }\n if (depsFromContextVariables.length > 0) {\n const v = depsFromContextVariables.map(d => {\n return dag.vertices.get(d) as Vertex;\n });\n const minLevelDep = minBy(v, (d: Vertex) => d.level) as Vertex;\n const nearestDeps = v.filter(v1 => v1.level === minLevelDep.level);\n nearestDeps.forEach(nd => {\n if (nd.level - vertex.level <= 1 || vertex.dependancyNames.length === 0) {\n runAfterTasks.push(nd.name);\n }\n });\n }\n return runAfterTasks;\n};\n\nexport const getGraphDataModel = (\n pipelineRun: PipelineRunKind | undefined,\n taskRuns: TaskRunKind[],\n): {\n graph: GraphModel;\n nodes: PipelineMixedNodeModel[];\n edges: EdgeModel[];\n} | null => {\n if (!pipelineRun) {\n return null;\n }\n\n const plrTaskRuns = getPLRTaskRuns(taskRuns, pipelineRun?.metadata?.name);\n\n const taskList = appendPipelineRunStatus(pipelineRun, plrTaskRuns);\n\n const dag = new DAG();\n taskList?.forEach((task: PipelineTask) => {\n dag.addEdges(task.name, task, '', task.runAfter || []);\n });\n\n const nodes: PipelineMixedNodeModel[] = [];\n const maxWidthForLevel: { [key: string]: number } = {};\n dag.topologicalSort((v: Vertex) => {\n if (!maxWidthForLevel[v.level]) {\n maxWidthForLevel[v.level] = getTextWidth(v.name);\n } else {\n maxWidthForLevel[v.level] = Math.max(\n maxWidthForLevel[v.level],\n getTextWidth(v.name),\n );\n }\n });\n dag.topologicalSort((vertex: Vertex) => {\n const task = vertex.data as PipelineTask;\n const runAfterTasks = getRunAfterTasks(task, dag, vertex);\n const badgePadding =\n Object.keys(pipelineRun.spec)?.length > 0 ? DEFAULT_BADGE_WIDTH : 0;\n const isTaskSkipped = pipelineRun?.status?.skippedTasks?.some(\n t => t.name === task.name,\n );\n nodes.push(\n createPipelineTaskNode(NodeType.TASK_NODE, {\n id: vertex.name,\n label: vertex.name,\n width:\n maxWidthForLevel[vertex.level] +\n NODE_PADDING * 2 +\n DEFAULT_NODE_ICON_WIDTH +\n badgePadding,\n runAfterTasks,\n status: isTaskSkipped ? RunStatus.Skipped : vertex.data.status?.reason,\n whenStatus: getTaskWhenStatus(vertex.data),\n task: vertex.data,\n pipelineRun,\n }),\n );\n });\n\n const finallyTaskList = appendPipelineRunStatus(\n pipelineRun,\n plrTaskRuns,\n true,\n );\n\n const finallyNodes = finallyTaskList.map(fTask => {\n const isTaskSkipped = pipelineRun?.status?.skippedTasks?.some(\n t => t.name === fTask.name,\n );\n\n return createPipelineTaskNode(NodeType.FINALLY_NODE, {\n id: fTask.name,\n label: fTask.name,\n width:\n getTextWidth(getMaxFinallyNode(finallyTaskList)) +\n NODE_PADDING * 2 +\n DEFAULT_FINALLLY_GROUP_PADDING * 2,\n height: DEFAULT_NODE_HEIGHT,\n runAfterTasks: [],\n status: isTaskSkipped\n ? RunStatus.Skipped\n : (fTask.status?.reason as RunStatus),\n whenStatus: getTaskWhenStatus(fTask),\n task: fTask,\n pipelineRun,\n });\n });\n\n const finallyGroup = finallyNodes.length\n ? [\n {\n id: 'finally-group-id',\n type: NodeType.FINALLY_GROUP,\n children: finallyNodes.map(n => n.id),\n group: true,\n style: { padding: DEFAULT_FINALLLY_GROUP_PADDING },\n },\n ]\n : [];\n const spacerNodes: PipelineMixedNodeModel[] = (\n getSpacerNodes([...nodes, ...finallyNodes], NodeType.SPACER_NODE, [\n NodeType.FINALLY_NODE,\n ]) as PipelineMixedNodeModel[]\n ).map(getSpacerNode);\n\n const edges: PipelineEdgeModel[] = getEdgesFromNodes(\n [...nodes, ...spacerNodes, ...finallyNodes],\n NodeType.SPACER_NODE,\n NodeType.EDGE,\n NodeType.EDGE,\n [NodeType.FINALLY_NODE],\n NodeType.EDGE,\n );\n\n return {\n graph: {\n id: `${pipelineRun?.metadata?.name}-graph`,\n type: ModelKind.graph,\n layout: PipelineLayout.DAGRE_VIEWER,\n scaleExtent: [0.5, 1],\n },\n nodes: [\n ...nodes,\n ...spacerNodes,\n ...finallyNodes,\n ...finallyGroup,\n ] as PipelineMixedNodeModel[],\n edges,\n };\n};\n\nexport const getLayoutData = (\n layout: PipelineLayout,\n): dagre.GraphLabel | null => {\n switch (layout) {\n case PipelineLayout.DAGRE_BUILDER:\n return DAGRE_BUILDER_PROPS;\n case PipelineLayout.DAGRE_VIEWER:\n return DAGRE_VIEWER_PROPS;\n case PipelineLayout.DAGRE_VIEWER_SPACED:\n return DAGRE_VIEWER_SPACED_PROPS;\n case PipelineLayout.DAGRE_BUILDER_SPACED:\n return DAGRE_BUILDER_SPACED_PROPS;\n default:\n return null;\n }\n};\n"],"names":[],"mappings":";;;;;;;AAkEA,MAAM,oBACJ,CAAC,IAAA,EAAM,OAAQ,MAAA,KAAY,CAAC,MAAM,IAAA,MAAU;AAAA,EAC1C,EAAA,EAAI,IAAA;AAAA,EACJ,KAAA,EAAO,MAAM,KAAA,IAAS,IAAA;AAAA,EACtB,aAAA,EAAe,IAAA,EAAM,aAAA,IAAiB,EAAC;AAAA,EACvC,GAAI,IAAA,IAAQ,EAAE,IAAA,EAAK;AAAA,EACnB,QAAQ,MAAA,IAAU,WAAA;AAAA,EAClB,OAAO,KAAA,IAAS,UAAA;AAAA,EAChB;AACF,CAAA,CAAA;AAEF,MAAM,iBAAA,GAAoB,CAAC,eAAA,KAA8C;AACvE,EAAA,MAAM,qBAAA,GAAwB,CAAC,GAAG,eAAe,CAAA,CAAE,IAAA;AAAA,IACjD,CAAC,CAAA,EAAG,CAAA,KAAM,EAAE,IAAA,CAAK,MAAA,GAAS,EAAE,IAAA,CAAK;AAAA,GACnC;AACA,EAAA,OAAO,qBAAA,CAAsB,CAAC,CAAA,EAAG,IAAA,IAAQ,EAAA;AAC3C,CAAA;AAYE,iBAAA,CAAkB,QAAA,CAAS,YAAY;AAEzC,MAAM,sBAAA,GAAyB,CAC7B,IAAA,EACA,IAAA,KACG,kBAAkB,IAAA,EAAM,IAAA,CAAK,KAAA,EAAO,IAAA,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/utils/pipeline-topology-utils.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n EdgeModel,\n getEdgesFromNodes,\n getSpacerNodes,\n GraphModel,\n ModelKind,\n RunStatus,\n WhenStatus,\n} from '@patternfly/react-topology';\nimport * as dagre from 'dagre';\nimport { minBy, uniq } from 'lodash';\n\nimport {\n ComputedStatus,\n PipelineRunKind,\n PipelineTask,\n PipelineTaskParam,\n PipelineTaskWithStatus,\n TaskRunKind,\n} from '@backstage-community/plugin-tekton-react';\n\nimport { DAG, Vertex } from '../components/pipeline-topology/dag';\nimport {\n DAGRE_BUILDER_PROPS,\n DAGRE_BUILDER_SPACED_PROPS,\n DAGRE_VIEWER_PROPS,\n DAGRE_VIEWER_SPACED_PROPS,\n DEFAULT_BADGE_WIDTH,\n DEFAULT_FINALLLY_GROUP_PADDING,\n DEFAULT_NODE_HEIGHT,\n DEFAULT_NODE_ICON_WIDTH,\n FINALLY_NODE_PADDING,\n NODE_HEIGHT,\n NODE_PADDING,\n NODE_WIDTH,\n NodeType,\n PipelineLayout,\n REGEX_EXTRACT_DEPS,\n WHEN_EXPRESSION_SPACING,\n} from '../consts/pipeline-topology-const';\nimport {\n FinallyNodeModel,\n LoadingNodeModel,\n NodeCreator,\n NodeCreatorSetup,\n PipelineEdgeModel,\n PipelineMixedNodeModel,\n PipelineRunAfterNodeModelData,\n} from '../types/pipeline-topology-types';\nimport { appendPipelineRunStatus, getPLRTaskRuns } from './pipelineRun-utils';\n\nconst createGenericNode: NodeCreatorSetup =\n (type, width?, height?) => (name, data) => ({\n id: name,\n label: data?.label || name,\n runAfterTasks: data?.runAfterTasks || [],\n ...(data && { data }),\n height: height ?? NODE_HEIGHT,\n width: width ?? NODE_WIDTH,\n type,\n });\n\nconst getMaxFinallyNode = (finallyTaskList: PipelineTaskWithStatus[]) => {\n const sortedFinallyTaskList = [...finallyTaskList].sort(\n (a, b) => b.name.length - a.name.length,\n );\n return sortedFinallyTaskList[0]?.name || '';\n};\n\nexport const createFinallyNode = (\n height: number,\n): NodeCreator<FinallyNodeModel> =>\n createGenericNode(\n NodeType.FINALLY_NODE,\n NODE_WIDTH + WHEN_EXPRESSION_SPACING + FINALLY_NODE_PADDING * 2,\n height,\n );\n\nexport const createLoadingNode: NodeCreator<LoadingNodeModel> =\n createGenericNode(NodeType.LOADING_NODE);\n\nconst createPipelineTaskNode = (\n type: NodeType,\n data: PipelineRunAfterNodeModelData,\n) => createGenericNode(type, data.width, data.height)(data.id ?? '', data);\n\nexport const getTextWidth = (\n text: string,\n font: string = '0.8rem RedHatText',\n): number => {\n if (!text || text.length === 0) {\n return 0;\n }\n const canvas = document.createElement('canvas');\n const context = canvas.getContext('2d');\n if (!context) {\n return text.length;\n }\n context.font = font;\n const { width } = context.measureText(text);\n return width;\n};\n\nexport const extractDepsFromContextVariables = (\n contextVariable: string | null | undefined,\n) => {\n let matches;\n const deps: string[] = [];\n if (!contextVariable) {\n return deps;\n }\n // eslint-disable-next-line no-cond-assign\n while ((matches = REGEX_EXTRACT_DEPS.exec(contextVariable)) !== null) {\n // This is necessary to avoid infinite loops with zero-width matches\n if (matches.index === REGEX_EXTRACT_DEPS.lastIndex) {\n REGEX_EXTRACT_DEPS.lastIndex++;\n }\n if (matches) {\n if (!deps.includes(matches[1])) {\n deps.push(matches[1]);\n }\n }\n }\n return deps;\n};\n\nexport const getSpacerNode = (\n node: PipelineMixedNodeModel,\n): PipelineMixedNodeModel => ({\n ...node,\n height: 1,\n width: 1,\n});\n\nexport const getWhenStatus = (\n status: ComputedStatus,\n): WhenStatus | undefined => {\n switch (status) {\n case ComputedStatus.Succeeded:\n case ComputedStatus.Failed:\n return WhenStatus.Met;\n case ComputedStatus.Skipped:\n case ComputedStatus['In Progress']:\n case ComputedStatus.Idle:\n return WhenStatus.Unmet;\n default:\n return undefined;\n }\n};\n\nexport const getTaskWhenStatus = (\n task: PipelineTaskWithStatus,\n): WhenStatus | undefined => {\n if (!task.when) {\n return undefined;\n }\n return getWhenStatus(task.status?.reason as ComputedStatus);\n};\n\nconst getDepsFromContextVariables = (task: PipelineTask) => {\n const depsFromContextVariables: string[] = [];\n if (task.params) {\n task.params.forEach((p: PipelineTaskParam) => {\n if (Array.isArray(p.value)) {\n p.value.forEach(paramValue => {\n depsFromContextVariables.push(\n ...extractDepsFromContextVariables(paramValue),\n );\n });\n } else {\n depsFromContextVariables.push(\n ...extractDepsFromContextVariables(p.value),\n );\n }\n });\n }\n if (task?.when) {\n task.when.forEach(({ input, values }) => {\n depsFromContextVariables.push(...extractDepsFromContextVariables(input));\n values.forEach((whenValue: string) => {\n depsFromContextVariables.push(\n ...extractDepsFromContextVariables(whenValue),\n );\n });\n });\n }\n return depsFromContextVariables;\n};\n\nconst getRunAfterTasks = (task: PipelineTask, dag: DAG, vertex: Vertex) => {\n const runAfterTasks: string[] = [];\n const depsFromContextVariables = getDepsFromContextVariables(task);\n\n const dependancies = uniq([...vertex.dependancyNames]);\n if (dependancies) {\n dependancies.forEach(dep => {\n const depObj = dag.vertices.get(dep) as Vertex;\n if (\n depObj.level - vertex.level <= 1 ||\n vertex.data.runAfter?.includes(depObj.name)\n ) {\n runAfterTasks.push(dep);\n }\n });\n }\n if (depsFromContextVariables.length > 0) {\n const v = depsFromContextVariables.map(d => {\n return dag.vertices.get(d) as Vertex;\n });\n const minLevelDep = minBy(v, (d: Vertex) => d.level) as Vertex;\n const nearestDeps = v.filter(v1 => v1.level === minLevelDep.level);\n nearestDeps.forEach(nd => {\n if (nd.level - vertex.level <= 1 || vertex.dependancyNames.length === 0) {\n runAfterTasks.push(nd.name);\n }\n });\n }\n return runAfterTasks;\n};\n\nexport const getGraphDataModel = (\n pipelineRun: PipelineRunKind | undefined,\n taskRuns: TaskRunKind[],\n): {\n graph: GraphModel;\n nodes: PipelineMixedNodeModel[];\n edges: EdgeModel[];\n} | null => {\n if (!pipelineRun) {\n return null;\n }\n\n const plrTaskRuns = getPLRTaskRuns(taskRuns, pipelineRun?.metadata?.name);\n\n const taskList = appendPipelineRunStatus(pipelineRun, plrTaskRuns);\n\n const dag = new DAG();\n taskList?.forEach((task: PipelineTask) => {\n dag.addEdges(task.name, task, '', task.runAfter || []);\n });\n\n const nodes: PipelineMixedNodeModel[] = [];\n const maxWidthForLevel: { [key: string]: number } = {};\n dag.topologicalSort((v: Vertex) => {\n if (!maxWidthForLevel[v.level]) {\n maxWidthForLevel[v.level] = getTextWidth(v.name);\n } else {\n maxWidthForLevel[v.level] = Math.max(\n maxWidthForLevel[v.level],\n getTextWidth(v.name),\n );\n }\n });\n dag.topologicalSort((vertex: Vertex) => {\n const task = vertex.data as PipelineTask;\n const runAfterTasks = getRunAfterTasks(task, dag, vertex);\n const badgePadding =\n Object.keys(pipelineRun.spec)?.length > 0 ? DEFAULT_BADGE_WIDTH : 0;\n const isTaskSkipped = pipelineRun?.status?.skippedTasks?.some(\n t => t.name === task.name,\n );\n nodes.push(\n createPipelineTaskNode(NodeType.TASK_NODE, {\n id: vertex.name,\n label: vertex.name,\n width:\n maxWidthForLevel[vertex.level] +\n NODE_PADDING * 2 +\n DEFAULT_NODE_ICON_WIDTH +\n badgePadding,\n runAfterTasks,\n status: isTaskSkipped ? RunStatus.Skipped : vertex.data.status?.reason,\n whenStatus: getTaskWhenStatus(vertex.data),\n task: vertex.data,\n pipelineRun,\n }),\n );\n });\n\n const finallyTaskList = appendPipelineRunStatus(\n pipelineRun,\n plrTaskRuns,\n true,\n );\n\n const finallyNodes = finallyTaskList.map(fTask => {\n const isTaskSkipped = pipelineRun?.status?.skippedTasks?.some(\n t => t.name === fTask.name,\n );\n\n return createPipelineTaskNode(NodeType.FINALLY_NODE, {\n id: fTask.name,\n label: fTask.name,\n width:\n getTextWidth(getMaxFinallyNode(finallyTaskList)) +\n NODE_PADDING * 2 +\n DEFAULT_FINALLLY_GROUP_PADDING * 2,\n height: DEFAULT_NODE_HEIGHT,\n runAfterTasks: [],\n status: isTaskSkipped\n ? RunStatus.Skipped\n : (fTask.status?.reason as RunStatus),\n whenStatus: getTaskWhenStatus(fTask),\n task: fTask,\n pipelineRun,\n });\n });\n\n const finallyGroup = finallyNodes.length\n ? [\n {\n id: 'finally-group-id',\n type: NodeType.FINALLY_GROUP,\n children: finallyNodes.map(n => n.id),\n group: true,\n style: { padding: DEFAULT_FINALLLY_GROUP_PADDING },\n },\n ]\n : [];\n const spacerNodes: PipelineMixedNodeModel[] = (\n getSpacerNodes([...nodes, ...finallyNodes], NodeType.SPACER_NODE, [\n NodeType.FINALLY_NODE,\n ]) as PipelineMixedNodeModel[]\n ).map(getSpacerNode);\n\n const edges: PipelineEdgeModel[] = getEdgesFromNodes(\n [...nodes, ...spacerNodes, ...finallyNodes],\n NodeType.SPACER_NODE,\n NodeType.EDGE,\n NodeType.EDGE,\n [NodeType.FINALLY_NODE],\n NodeType.EDGE,\n );\n\n return {\n graph: {\n id: `${pipelineRun?.metadata?.name}-graph`,\n type: ModelKind.graph,\n layout: PipelineLayout.DAGRE_VIEWER,\n scaleExtent: [0.5, 1],\n },\n nodes: [\n ...nodes,\n ...spacerNodes,\n ...finallyNodes,\n ...finallyGroup,\n ] as PipelineMixedNodeModel[],\n edges,\n };\n};\n\nexport const getLayoutData = (\n layout: PipelineLayout,\n): dagre.GraphLabel | null => {\n switch (layout) {\n case PipelineLayout.DAGRE_BUILDER:\n return DAGRE_BUILDER_PROPS;\n case PipelineLayout.DAGRE_VIEWER:\n return DAGRE_VIEWER_PROPS;\n case PipelineLayout.DAGRE_VIEWER_SPACED:\n return DAGRE_VIEWER_SPACED_PROPS;\n case PipelineLayout.DAGRE_BUILDER_SP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,IACT,CAAC,SAAS,YAAY,CAAA;AAAA,IACtB,QAAA,CAAS;AAAA,GACX;AAEA,EAAA,OAAO;AAAA,IACL,KAAA,EAAO;AAAA,MACL,EAAA,EAAI,CAAA,EAAG,WAAA,EAAa,QAAA,EAAU,IAAI,CAAA,MAAA,CAAA;AAAA,MAClC,MAAM,SAAA,CAAU,KAAA;AAAA,MAChB,QAAQ,cAAA,CAAe,YAAA;AAAA,MACvB,WAAA,EAAa,CAAC,GAAA,EAAK,CAAC;AAAA,KACtB;AAAA,IACA,KAAA,EAAO;AAAA,MACL,GAAG,KAAA;AAAA,MACH,GAAG,WAAA;AAAA,MACH,GAAG,YAAA;AAAA,MACH,GAAG;AAAA,KACL;AAAA,IACA;AAAA,GACF;AACF;AAEO,MAAM,aAAA,GAAgB,CAC3B,MAAA,KAC4B;AAC5B,EAAA,QAAQ,MAAA;AAAQ,IACd,KAAK,cAAA,CAAe,aAAA;AAClB,MAAA,OAAO,mBAAA;AAAA,IACT,KAAK,cAAA,CAAe,YAAA;AAClB,MAAA,OAAO,kBAAA;AAAA,IACT,KAAK,cAAA,CAAe,mBAAA;AAClB,MAAA,OAAO,yBAAA;AAAA,IACT,KAAK,cAAA,CAAe,oBAAA;AAClB,MAAA,OAAO,0BAAA;AAAA,IACT;AACE,MAAA,OAAO,IAAA;AAAA;AAEb;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isEmpty, get, find, cloneDeep, isFinite, each, trim } from 'lodash';
|
|
2
|
-
import { ComputedStatus, SucceedConditionReason, pipelineRunStatus, pipelineRunFilterReducer } from '@
|
|
2
|
+
import { ComputedStatus, SucceedConditionReason, pipelineRunStatus, pipelineRunFilterReducer } from '@backstage-community/plugin-tekton-react';
|
|
3
3
|
import { TEKTON_PIPELINE_RUN, TEKTON_PIPELINE_TASK } from '../consts/tekton-const.esm.js';
|
|
4
4
|
|
|
5
5
|
const s = 1e3;
|