Skip to content

Commit 24ed78d

Browse files
Merge pull request #2686 from devtron-labs/fix/chart-download-file-name-and-runner-param
fix: derive isolated env chart download file name from BE and fix runner query payload for that.
2 parents da5e940 + 3006bd9 commit 24ed78d

File tree

12 files changed

+58
-38
lines changed

12 files changed

+58
-38
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.10.0-patch-7-ng",
7+
"@devtron-labs/devtron-fe-common-lib": "1.10.0-patch-8-ng",
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: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,26 @@ export interface BulkCDDetailType
9595
resourceFilters?: FilterConditionsListType[]
9696
}
9797

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

108119
interface BulkRuntimeParamsType {
109120
runtimeParams: Record<string, RuntimePluginVariables[]>
@@ -182,10 +193,10 @@ export interface TriggerResponseModalBodyProps {
182193
responseList: ResponseRowType[]
183194
isLoading: boolean
184195
isVirtualEnv?: boolean
185-
envName?: string
186196
}
187197

188-
export interface TriggerResponseModalFooterProps extends Pick<TriggerResponseModalBodyProps, 'isLoading' | 'responseList'> {
198+
export interface TriggerResponseModalFooterProps
199+
extends Pick<TriggerResponseModalBodyProps, 'isLoading' | 'responseList'> {
189200
onClickRetryBuild: (appsToRetry: Record<string, boolean>) => void
190201
closePopup: (e) => void
191202
}
@@ -194,7 +205,6 @@ export interface TriggerModalRowType {
194205
rowData: ResponseRowType
195206
index: number
196207
isVirtualEnv?: boolean
197-
envName?: string
198208
}
199209

200210
export interface WorkflowNodeSelectionType {

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -874,14 +874,13 @@ export default function BulkCDTrigger({
874874
return (
875875
<Drawer position="right" width="75%" minWidth="1024px" maxWidth="1200px">
876876
<div className="bg__primary bulk-ci-trigger-container">
877-
<div className='flexbox-col flex-grow-1 dc__overflow-hidden'>
877+
<div className="flexbox-col flex-grow-1 dc__overflow-hidden">
878878
{renderHeaderSection()}
879879
{responseListLength ? (
880880
<TriggerResponseModalBody
881881
responseList={responseList}
882882
isLoading={isLoading}
883883
isVirtualEnv={isVirtualEnv}
884-
envName={selectedApp.envName}
885884
/>
886885
) : (
887886
renderBodySection()

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ import {
109109
BulkCIDetailType,
110110
ProcessWorkFlowStatusType,
111111
ResponseRowType,
112+
TriggerVirtualEnvResponseRowType,
112113
WorkflowAppSelectionType,
113114
WorkflowNodeSelectionType,
114115
} from '../../AppGroup.types'
@@ -1537,13 +1538,26 @@ export default function EnvTriggerView({ filteredAppIds, isVirtualEnv }: AppGrou
15371538
BULK_VIRTUAL_RESPONSE_STATUS[BulkResponseStatus.PASS],
15381539
BULK_CD_RESPONSE_STATUS_TEXT[BulkResponseStatus.PASS],
15391540
)
1541+
1542+
const virtualEnvResponseRowType: TriggerVirtualEnvResponseRowType =
1543+
[DeploymentNodeType.CD, DeploymentNodeType.POSTCD, DeploymentNodeType.PRECD].includes(
1544+
bulkTriggerType,
1545+
) && isVirtualEnv
1546+
? {
1547+
isVirtual: true,
1548+
helmPackageName: response.value?.result?.helmPackageName,
1549+
cdWorkflowType: bulkTriggerType,
1550+
}
1551+
: {}
1552+
15401553
_responseList.push({
15411554
appId: triggeredAppList[index].appId,
15421555
appName: triggeredAppList[index].appName,
15431556
statusText: statusType,
15441557
status: BulkResponseStatus.PASS,
15451558
envId: triggeredAppList[index].envId,
15461559
message: '',
1560+
...virtualEnvResponseRowType,
15471561
})
15481562
} else {
15491563
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
@@ -29,7 +29,7 @@ const DownloadManifestForVirtualEnvironmentButton = importComponentFromFELibrary
2929
'function',
3030
)
3131

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

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

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,7 @@ export const TriggerResponseModalFooter = ({
6868
)
6969
}
7070

71-
const TriggerResponseModalBody = ({
72-
responseList,
73-
isLoading,
74-
isVirtualEnv,
75-
envName,
76-
}: TriggerResponseModalBodyProps) => {
71+
const TriggerResponseModalBody = ({ responseList, isLoading, isVirtualEnv }: TriggerResponseModalBodyProps) => {
7772
if (isLoading) {
7873
return <Progressing pageLoader />
7974
}
@@ -95,7 +90,6 @@ const TriggerResponseModalBody = ({
9590
rowData={response}
9691
index={index}
9792
isVirtualEnv={isVirtualEnv}
98-
envName={envName}
9993
/>
10094
))}
10195
</div>

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

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
DATE_TIME_FORMATS,
2727
DeploymentAppTypes,
2828
handleUTCTime,
29+
logExceptionToSentry,
2930
Progressing,
3031
ReleaseMode,
3132
showError,
@@ -318,10 +319,14 @@ export const SourceInfo = ({
318319
const cardLoading = useMemo(() => loadingDetails || loadingResourceTree, [loadingDetails, loadingResourceTree])
319320

320321
const renderGeneratedManifestDownloadCard = (): JSX.Element => {
322+
if (!appDetails?.helmPackageName) {
323+
logExceptionToSentry(new Error('Cannot find helm package name in appDetails while downloading'))
324+
}
325+
321326
const paramsId = {
322327
appId: +params.appId,
323328
envId: +params.envId,
324-
appName: `${appDetails?.appName}-${appDetails?.environmentName}-${appDetails?.imageTag}`,
329+
appName: appDetails?.helmPackageName || 'helm-package',
325330
}
326331
if (AppDetailsDownloadCard) {
327332
return <AppDetailsDownloadCard params={paramsId} />
@@ -395,13 +400,14 @@ export const SourceInfo = ({
395400
filteredEnvIds={filteredEnvIds}
396401
/>
397402
)}
398-
{!appDetails?.deploymentAppDeleteRequest && !appMigratedFromExternalSourceAndIsNotTriggered && (
399-
<SecurityVulnerabilityCard
400-
cardLoading={cardLoading}
401-
appId={params.appId}
402-
envId={params.envId}
403-
/>
404-
)}
403+
{!appDetails?.deploymentAppDeleteRequest &&
404+
!appMigratedFromExternalSourceAndIsNotTriggered && (
405+
<SecurityVulnerabilityCard
406+
cardLoading={cardLoading}
407+
appId={params.appId}
408+
envId={params.envId}
409+
/>
410+
)}
405411
<div className="flex right ml-auto">
406412
{appDetails?.appStoreChartId && (
407413
<>

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)
@@ -503,7 +501,7 @@ const ChartDeploymentHistory = ({
503501
const paramsData = {
504502
appId,
505503
envId: params.envId,
506-
appName: helmAppPackageName,
504+
appName: deployment.helmPackageName,
507505
workflowId: deployment.version,
508506
isHelmApp: true,
509507
}
@@ -603,7 +601,7 @@ const ChartDeploymentHistory = ({
603601
renderCodeEditor()}
604602
{selectedDeploymentTabName === DEPLOYMENT_HISTORY_TAB.ARTIFACTS && VirtualHistoryArtifact && (
605603
<VirtualHistoryArtifact
606-
titleName={`${helmAppPackageName}.tgz`}
604+
titleName={deployment.helmPackageName}
607605
params={paramsData}
608606
status={deployment.status}
609607
/>

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)