Skip to content

Commit 42ffe3a

Browse files
Merge pull request #2694 from devtron-labs/fix-ng-changes-develop-sync
fix: derive helmPackageName from BE and fix runner queryParam for chart download
2 parents c8b013d + edd0acf commit 42ffe3a

File tree

12 files changed

+48
-30
lines changed

12 files changed

+48
-30
lines changed

package.json

Lines changed: 1 addition & 1 deletion
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.12.0-pre-6",
7+
"@devtron-labs/devtron-fe-common-lib": "1.12.0-pre-8",
88
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
99
"@rjsf/core": "^5.13.3",
1010
"@rjsf/utils": "^5.13.3",

src/components/ApplicationGroup/AppGroup.types.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,26 @@ export interface BulkCDDetailType
9696
isExceptionUser?: boolean
9797
}
9898

99-
export interface ResponseRowType {
99+
export type TriggerVirtualEnvResponseRowType =
100+
| {
101+
isVirtual: true
102+
helmPackageName: string
103+
cdWorkflowType: DeploymentNodeType
104+
}
105+
| {
106+
isVirtual?: never
107+
helmPackageName?: never
108+
cdWorkflowType?: DeploymentNodeType
109+
}
110+
111+
export type ResponseRowType = {
100112
appId: number
101113
appName: string
102114
status: BulkResponseStatus
103115
statusText: string
104116
message: string
105-
isVirtual?: boolean
106117
envId?: number
107-
}
118+
} & TriggerVirtualEnvResponseRowType
108119

109120
interface BulkRuntimeParamsType {
110121
runtimeParams: Record<string, RuntimePluginVariables[]>
@@ -183,7 +194,6 @@ export interface TriggerResponseModalBodyProps {
183194
responseList: ResponseRowType[]
184195
isLoading: boolean
185196
isVirtualEnv?: boolean
186-
envName?: string
187197
}
188198

189199
type RetryFailedType =
@@ -206,7 +216,6 @@ export interface TriggerModalRowType {
206216
rowData: ResponseRowType
207217
index: number
208218
isVirtualEnv?: boolean
209-
envName?: string
210219
}
211220

212221
export interface WorkflowNodeSelectionType {

src/components/ApplicationGroup/Details/TriggerView/BulkCDTrigger.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,6 @@ export default function BulkCDTrigger({
936936
responseList={responseList}
937937
isLoading={isLoading}
938938
isVirtualEnv={isVirtualEnv}
939-
envName={selectedApp.envName}
940939
/>
941940
) : (
942941
renderBodySection()

src/components/ApplicationGroup/Details/TriggerView/EnvTriggerView.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ import {
110110
BulkCIDetailType,
111111
ProcessWorkFlowStatusType,
112112
ResponseRowType,
113+
TriggerVirtualEnvResponseRowType,
113114
WorkflowAppSelectionType,
114115
WorkflowNodeSelectionType,
115116
} from '../../AppGroup.types'
@@ -1544,13 +1545,26 @@ export default function EnvTriggerView({ filteredAppIds, isVirtualEnv }: AppGrou
15441545
BULK_VIRTUAL_RESPONSE_STATUS[BulkResponseStatus.PASS],
15451546
BULK_CD_RESPONSE_STATUS_TEXT[BulkResponseStatus.PASS],
15461547
)
1548+
1549+
const virtualEnvResponseRowType: TriggerVirtualEnvResponseRowType =
1550+
[DeploymentNodeType.CD, DeploymentNodeType.POSTCD, DeploymentNodeType.PRECD].includes(
1551+
bulkTriggerType,
1552+
) && isVirtualEnv
1553+
? {
1554+
isVirtual: true,
1555+
helmPackageName: response.value?.result?.helmPackageName,
1556+
cdWorkflowType: bulkTriggerType,
1557+
}
1558+
: {}
1559+
15471560
_responseList.push({
15481561
appId: triggeredAppList[index].appId,
15491562
appName: triggeredAppList[index].appName,
15501563
statusText: statusType,
15511564
status: BulkResponseStatus.PASS,
15521565
envId: triggeredAppList[index].envId,
15531566
message: '',
1567+
...virtualEnvResponseRowType,
15541568
})
15551569
} else {
15561570
const errorReason = response.reason

src/components/ApplicationGroup/Details/TriggerView/TriggerModalTableRow.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const DownloadManifestForVirtualEnvironmentButton = importComponentFromFELibrary
3030
'function',
3131
)
3232

33-
export const TriggerModalRow = ({ rowData, index, isVirtualEnv, envName }: TriggerModalRowType) => {
33+
export const TriggerModalRow = ({ rowData, index, isVirtualEnv }: TriggerModalRowType) => {
3434
const { handleDownload } = useDownload()
3535

3636
const renderStatusIcon = (responseRowData: ResponseRowType): JSX.Element => {
@@ -58,7 +58,8 @@ export const TriggerModalRow = ({ rowData, index, isVirtualEnv, envName }: Trigg
5858
<DownloadManifestForVirtualEnvironmentButton
5959
appId={rowData.appId}
6060
envId={rowData.envId}
61-
appName={`${rowData.appName}-${envName}`}
61+
helmPackageName={rowData.helmPackageName}
62+
cdWorkflowType={rowData.cdWorkflowType}
6263
handleDownload={handleDownload}
6364
showSuccessfulToast={false}
6465
/>

src/components/ApplicationGroup/Details/TriggerView/TriggerResponseModal.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,7 @@ export const TriggerResponseModalFooter = ({
7777
)
7878
}
7979

80-
const TriggerResponseModalBody = ({
81-
responseList,
82-
isLoading,
83-
isVirtualEnv,
84-
envName,
85-
}: TriggerResponseModalBodyProps) => {
80+
const TriggerResponseModalBody = ({ responseList, isLoading, isVirtualEnv }: TriggerResponseModalBodyProps) => {
8681
if (isLoading) {
8782
return <Progressing pageLoader />
8883
}
@@ -104,7 +99,6 @@ const TriggerResponseModalBody = ({
10499
rowData={response}
105100
index={index}
106101
isVirtualEnv={isVirtualEnv}
107-
envName={envName}
108102
/>
109103
))}
110104
</div>

src/components/app/details/appDetails/SourceInfo.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
import { useMemo, useState } from 'react'
18-
import { Link, useHistory, useParams } from 'react-router-dom'
18+
import { Link, useParams } from 'react-router-dom'
1919
import ReactGA from 'react-ga4'
2020
import moment from 'moment'
2121
import {
@@ -27,6 +27,7 @@ import {
2727
DATE_TIME_FORMATS,
2828
DeploymentAppTypes,
2929
handleUTCTime,
30+
logExceptionToSentry,
3031
Icon,
3132
Progressing,
3233
ReleaseMode,
@@ -351,10 +352,14 @@ export const SourceInfo = ({
351352
const cardLoading = useMemo(() => loadingDetails || loadingResourceTree, [loadingDetails, loadingResourceTree])
352353

353354
const renderGeneratedManifestDownloadCard = (): JSX.Element => {
355+
if (!appDetails?.helmPackageName) {
356+
logExceptionToSentry(new Error('Cannot find helm package name in appDetails while downloading'))
357+
}
358+
354359
const paramsId = {
355360
appId: +params.appId,
356361
envId: +params.envId,
357-
appName: `${appDetails?.appName}-${appDetails?.environmentName}-${appDetails?.imageTag}`,
362+
appName: appDetails?.helmPackageName || 'helm-package',
358363
}
359364
if (AppDetailsDownloadCard) {
360365
return <AppDetailsDownloadCard params={paramsId} />

src/components/v2/appDetails/sourceInfo/environmentStatus/EnvironmentStatus.component.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ const EnvironmentStatusComponent = ({
126126
const deploymentManifestParams = {
127127
appId: +params.appId,
128128
envId: +params.envId,
129-
appName: appDetails?.helmPackageName,
129+
appName: appDetails?.helmPackageName || 'helm-package',
130130
isHelmApp: true,
131131
}
132132
return <AppDetailsDownloadCard params={deploymentManifestParams} />

src/components/v2/chartDeploymentHistory/ChartDeploymentHistory.component.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,12 @@ const ChartDeploymentHistory = ({
8585
isExternal,
8686
isVirtualEnvironment,
8787
isLoadingDetails,
88-
helmAppPackageName,
8988
}: {
9089
appId: string
9190
appName?: string
9291
isExternal: boolean
9392
isVirtualEnvironment?: boolean
9493
isLoadingDetails?: boolean
95-
helmAppPackageName?: string
9694
}) => {
9795
const params = useParams<{ envId: string }>()
9896
const [isLoading, setIsLoading] = useState(true)
@@ -494,7 +492,7 @@ const ChartDeploymentHistory = ({
494492
const paramsData = {
495493
appId,
496494
envId: params.envId,
497-
appName: helmAppPackageName,
495+
appName: deployment.helmPackageName,
498496
workflowId: deployment.version,
499497
isHelmApp: true,
500498
}
@@ -594,7 +592,7 @@ const ChartDeploymentHistory = ({
594592
renderCodeEditor()}
595593
{selectedDeploymentTabName === DEPLOYMENT_HISTORY_TAB.ARTIFACTS && VirtualHistoryArtifact && (
596594
<VirtualHistoryArtifact
597-
titleName={`${helmAppPackageName}.tgz`}
595+
titleName={deployment.helmPackageName}
598596
params={paramsData}
599597
status={deployment.status}
600598
/>

src/components/v2/chartDeploymentHistory/chartDeploymentHistory.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export interface ChartDeploymentDetail {
4444
deployedBy: string
4545
status: string
4646
message?: string
47+
helmPackageName?: string
4748
}
4849

4950
export interface RollbackReleaseRequest {

0 commit comments

Comments
 (0)