Skip to content

Commit faf1ae8

Browse files
committed
Merge branch 'develop' of https://github.com/devtron-labs/dashboard into feat/resource-recommender-develop
2 parents 8fbbe0b + fad5761 commit faf1ae8

File tree

12 files changed

+13669
-8793
lines changed

12 files changed

+13669
-8793
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
cache: 'yarn'
2626

2727
- name: Install dependencies
28-
run: yarn install --frozen-lockfile
28+
run: yarn install --immutable
2929

3030
- name: Check linting issues
3131
run: yarn lint

.yarn/releases/yarn-4.9.2.cjs

Lines changed: 942 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
nodeLinker: node-modules
2+
3+
yarnPath: .yarn/releases/yarn-4.9.2.cjs

Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@ FROM node:22-alpine AS builder
22

33
WORKDIR /app
44

5-
COPY package.json yarn.lock .
5+
RUN corepack enable yarn && \
6+
yarn set version 4.9.2
7+
8+
COPY package.json .
9+
COPY yarn.lock .
10+
COPY .yarn/ .yarn/
11+
COPY .yarnrc.yml ./
612

713
RUN apk add --no-cache git
8-
RUN yarn install --frozen-lockfile --network-timeout 600000
14+
RUN yarn install --immutable --network-timeout 600000
915

1016
COPY . .
1117

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"homepage": "/dashboard",
66
"dependencies": {
7-
"@devtron-labs/devtron-fe-common-lib": "1.15.3-pre-1",
7+
"@devtron-labs/devtron-fe-common-lib": "1.15.3-pre-4",
88
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
99
"@rjsf/core": "^5.13.3",
1010
"@rjsf/utils": "^5.13.3",
@@ -138,5 +138,6 @@
138138
"rollup": "^4.22.4",
139139
"path-to-regexp": "^1.9.0",
140140
"cross-spawn": "^7.0.5"
141-
}
141+
},
142+
"packageManager": "[email protected]"
142143
}

src/components/ResourceBrowser/ResourceList/ClusterSelector.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import ReactSelect, { Props as SelectProps, SelectInstance } from 'react-select'
2121
import {
2222
APP_SELECTOR_STYLES,
2323
AppSelectorDropdownIndicator,
24+
Badge,
25+
ComponentSizeType,
2426
DocLink,
2527
DocLinkProps,
2628
Icon,
@@ -148,7 +150,7 @@ const ClusterSelector: React.FC<ClusterSelectorType> = ({
148150
}}
149151
/>
150152

151-
{defaultOption?.isProd && <span className="px-6 py-2 br-4 bcb-1 cb-7 fs-12 lh-16 fw-5">Production</span>}
153+
{defaultOption?.isProd && <Badge label="Production" size={ComponentSizeType.xxs} />}
152154

153155
{RBPageHeaderPopup && !isInstallationStatusView ? (
154156
<RBPageHeaderPopup

src/components/cdPipeline/BuildCD.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export default function BuildCD({
8080
isGitOpsRepoNotConfigured,
8181
noGitOpsModuleInstalledAndConfigured,
8282
releaseMode,
83+
isCustomChart,
8384
getMandatoryPluginData,
8485
migrateToDevtronFormState,
8586
setMigrateToDevtronFormState,
@@ -671,7 +672,7 @@ export default function BuildCD({
671672
}
672673

673674
const renderAdvancedDeploymentStrategy = () => {
674-
if (noStrategyAvailable.current || releaseMode === ReleaseMode.MIGRATE_EXTERNAL_APPS) {
675+
if (noStrategyAvailable.current || (releaseMode === ReleaseMode.MIGRATE_EXTERNAL_APPS && isCustomChart)) {
675676
return null
676677
}
677678

src/components/cdPipeline/CDPipeline.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ export default function CDPipeline({
179179
deploymentAppType: window._env_.HIDE_GITOPS_OR_HELM_OPTION ? '' : DeploymentAppTypes.HELM,
180180
deploymentAppName: '',
181181
releaseMode: ReleaseMode.NEW_DEPLOYMENT,
182+
isCustomChart: false,
182183
triggerType: TriggerType.Auto,
183184
strategies: [],
184185
savedStrategies: [],
@@ -601,6 +602,7 @@ export default function CDPipeline({
601602
form.name = pipelineConfigFromRes.name
602603
form.deploymentAppName = pipelineConfigFromRes.deploymentAppName
603604
form.releaseMode = pipelineConfigFromRes.releaseMode
605+
form.isCustomChart = pipelineConfigFromRes.isCustomChart
604606
form.environmentName = pipelineConfigFromRes.environmentName || ''
605607
form.namespace = env.namespace
606608
form.repoName = pipelineConfigFromRes.repoName
@@ -731,7 +733,7 @@ export default function CDPipeline({
731733
environmentId: formData.environmentId,
732734
namespace: formData.namespace,
733735
id: +cdPipelineId,
734-
strategies: formData.releaseMode === ReleaseMode.MIGRATE_EXTERNAL_APPS ? [] : formData.savedStrategies,
736+
strategies: formData.releaseMode === ReleaseMode.MIGRATE_EXTERNAL_APPS && formData.isCustomChart ? [] : formData.savedStrategies,
735737
parentPipelineType,
736738
parentPipelineId: +parentPipelineId,
737739
isClusterCdActive: formData.isClusterCdActive,
@@ -1369,6 +1371,7 @@ export default function CDPipeline({
13691371
isGitOpsRepoNotConfigured={isGitOpsRepoNotConfigured}
13701372
noGitOpsModuleInstalledAndConfigured={noGitOpsModuleInstalledAndConfigured}
13711373
releaseMode={formData.releaseMode}
1374+
isCustomChart={formData.isCustomChart}
13721375
getMandatoryPluginData={getMandatoryPluginData}
13731376
migrateToDevtronFormState={migrateToDevtronFormState}
13741377
setMigrateToDevtronFormState={setMigrateToDevtronFormState}

src/components/cdPipeline/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ export interface BuildCDProps
9191
isWebhookCD: boolean
9292
dockerRegistries: any[]
9393
releaseMode: ReleaseMode
94+
isCustomChart: boolean
9495
getMandatoryPluginData: (
9596
form: PipelineFormType,
9697
requiredPluginIds?: PluginDetailPayloadType['pluginIds'],

src/components/common/helpers/Helpers.tsx

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ import {
3030
useMainContext,
3131
SelectPickerOptionType,
3232
InfoBlock,
33+
Badge,
34+
SeveritiesDTO,
3335
} from '@devtron-labs/devtron-fe-common-lib'
3436
import YAML from 'yaml'
3537
import { Link } from 'react-router-dom'
@@ -1098,33 +1100,31 @@ export const getPluginIdsFromBuildStage = (
10981100
return pluginIds
10991101
}
11001102

1103+
const SEVERITY_ORDER = [
1104+
{ key: SeveritiesDTO.CRITICAL, label: 'Critical', variant: 'negative' },
1105+
{ key: SeveritiesDTO.HIGH, label: 'High', variant: 'custom', fontColor: 'R500', bgColor: 'R100' },
1106+
{ key: SeveritiesDTO.MEDIUM, label: 'Medium', variant: 'custom', fontColor: 'O600', bgColor: 'O100' },
1107+
{ key: SeveritiesDTO.LOW, label: 'Low', variant: 'warning' },
1108+
{ key: SeveritiesDTO.UNKNOWN, label: 'Unknown', variant: 'neutral' },
1109+
] as const
1110+
11011111
export const getSeverityWithCount = (severityCount: SeverityCount) => {
1102-
if (severityCount.critical) {
1103-
return (
1104-
<span className="severity-chip severity-chip--critical dc__w-fit-content">
1105-
{severityCount.critical} Critical
1106-
</span>
1107-
)
1108-
}
1109-
if (severityCount.high) {
1110-
return <span className="severity-chip severity-chip--high dc__w-fit-content">{severityCount.high} High</span>
1111-
}
1112-
if (severityCount.medium) {
1113-
return (
1114-
<span className="severity-chip severity-chip--medium dc__w-fit-content">{severityCount.medium} Medium</span>
1115-
)
1116-
}
1117-
if (severityCount.low) {
1118-
return <span className="severity-chip severity-chip--low dc__w-fit-content">{severityCount.low} Low</span>
1119-
}
1120-
if (severityCount.unknown) {
1121-
return (
1122-
<span className="severity-chip severity-chip--unknown dc__w-fit-content">
1123-
{severityCount.unknown} Unknown
1124-
</span>
1125-
)
1112+
for (const item of SEVERITY_ORDER) {
1113+
if (severityCount[item.key]) {
1114+
if (item.variant === 'custom') {
1115+
return (
1116+
<Badge
1117+
label={`${severityCount[item.key]} ${item.label}`}
1118+
variant="custom"
1119+
fontColor={item.fontColor}
1120+
bgColor={item.bgColor}
1121+
/>
1122+
)
1123+
}
1124+
return <Badge label={`${severityCount[item.key]} ${item.label}`} variant={item.variant} />
1125+
}
11261126
}
1127-
return <span className="severity-chip severity-chip--passed dc__w-fit-content">Passed</span>
1127+
return <Badge label="Passed" variant="positive" />
11281128
}
11291129

11301130
// FIXME: Ideally whole branch calculations should be in fe-lib

0 commit comments

Comments
 (0)