Skip to content

feat: add support for flux steps in deployment timeline #782

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Jul 2, 2025
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
42025a4
feat: add support for flux steps in deployment timeline
arunjaindev Jun 13, 2025
aa07a41
chore: update steps for flux
arunjaindev Jun 13, 2025
05a8262
feat: add deployment app type in history
arunjaindev Jun 13, 2025
01515bb
chore: version bump
arunjaindev Jun 13, 2025
fd2c4bb
fix: use deployment type from service and not app details
arunjaindev Jun 13, 2025
f100d3b
feat: undefined deploymentType in case of failed status
arunjaindev Jun 14, 2025
de1ba60
chore: version bump
arunjaindev Jun 14, 2025
e80662b
feat: rename deployment app type gitops to argo
arunjaindev Jun 18, 2025
bbcb6c7
chore: add feature flag
arunjaindev Jun 19, 2025
c669841
Merge branch 'main' of https://github.com/devtron-labs/devtron-fe-com…
arunjaindev Jun 23, 2025
526e6dc
Merge branch 'feat/flux-deployment' of https://github.com/devtron-lab…
arunjaindev Jun 23, 2025
09ba4eb
Merge pull request #790 from devtron-labs/feat/link-external-flux
arunjaindev Jun 26, 2025
49dd5f0
fix: add root margin of 1px and increase sentinel height by 1px to ov…
AbhishekA1509 Jun 26, 2025
4fa194c
chore(version): bump version to 1.16.1 in package.json and package-lo…
AbhishekA1509 Jun 26, 2025
8d581ff
refactor: replace hardcoded sentinel height with constant for better …
AbhishekA1509 Jun 26, 2025
faaa9f1
Merge pull request #801 from devtron-labs/fix/use-sticky-decimal-width
AbhishekA1509 Jun 26, 2025
8b85c0e
Merge branch 'main' of https://github.com/devtron-labs/devtron-fe-com…
arunjaindev Jul 1, 2025
0962489
Merge branch 'develop' of https://github.com/devtron-labs/devtron-fe-…
arunjaindev Jul 1, 2025
5fd6de9
chore: update tippy for status
arunjaindev Jul 1, 2025
a8e5055
chore: add fallback for deployment app type
arunjaindev Jul 2, 2025
9f1e412
chore: make prop for deployment app type required in status breakdown…
arunjaindev Jul 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devtron-labs/devtron-fe-common-lib",
"version": "1.16.0-pre-3",
"version": "1.16.0-pre-4",
"description": "Supporting common component library",
"type": "module",
"main": "dist/index.js",
Expand Down
4 changes: 2 additions & 2 deletions src/Common/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -659,10 +659,10 @@ export interface CommonNodeAttr extends Pick<MandatoryPluginBaseStateType, 'isTr

export enum DeploymentAppTypes {
HELM = 'helm',
GITOPS = 'argo_cd',
ARGO = 'argo_cd',
MANIFEST_DOWNLOAD = 'manifest_download',
MANIFEST_PUSH = 'manifest_push',
FLUX = 'flux',
FLUX = 'flux_cd',
}

export interface VulnerabilityType {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ const AppStatusModal = ({
}
: null,
isHelmApp: appDetails.appType === AppType.DEVTRON_HELM_CHART,
deploymentAppType: appDetails.deploymentAppType,
}),
deploymentStatusAbortControllerRef,
)
Expand Down
6 changes: 5 additions & 1 deletion src/Shared/Components/AppStatusModal/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export const getDeploymentStatusWithTimeline = async ({
showTimeline,
virtualEnvironmentConfig,
isHelmApp,
deploymentAppType,
}: GetDeploymentStatusWithTimelineParamsType): Promise<DeploymentStatusDetailsBreakdownDataType> => {
const baseURL = isHelmApp ? ROUTES.HELM_DEPLOYMENT_STATUS_TIMELINE_INSTALLED_APP : ROUTES.DEPLOYMENT_STATUS

Expand All @@ -68,5 +69,8 @@ export const getDeploymentStatusWithTimeline = async ({

return virtualEnvironmentConfig
? virtualEnvironmentConfig.processVirtualEnvironmentDeploymentData(deploymentStatusDetailsResponse.result)
: processDeploymentStatusDetailsData(deploymentStatusDetailsResponse.result)
: processDeploymentStatusDetailsData(
deploymentStatusDetailsResponse.result.deploymentAppType ?? deploymentAppType,
deploymentStatusDetailsResponse.result,
)
}
3 changes: 2 additions & 1 deletion src/Shared/Components/AppStatusModal/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FunctionComponent, PropsWithChildren, ReactNode } from 'react'

import { APIOptions } from '@Common/Types'
import { APIOptions, DeploymentAppTypes } from '@Common/Types'
import {
AppDetails,
ConfigDriftModalProps,
Expand Down Expand Up @@ -85,6 +85,7 @@ export type GetDeploymentStatusWithTimelineParamsType = Pick<APIOptions, 'abortC
wfrId: AppDetails['resourceTree']['wfrId']
}
isHelmApp?: boolean
deploymentAppType: DeploymentAppTypes
}

export interface AppStatusModalTabListProps extends Pick<AppStatusModalProps, 'appDetails' | 'type'> {
Expand Down
8 changes: 6 additions & 2 deletions src/Shared/Components/CICDHistory/DeploymentDetailSteps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const DeploymentDetailSteps = ({
const processedData =
isVirtualEnv.current && processVirtualEnvironmentDeploymentData
? processVirtualEnvironmentDeploymentData()
: processDeploymentStatusDetailsData()
: processDeploymentStatusDetailsData(deploymentAppType ?? appDetails?.deploymentAppType)
const [deploymentStatusDetailsBreakdownData, setDeploymentStatusDetailsBreakdownData] =
useState<DeploymentStatusDetailsBreakdownDataType>(processedData)

Expand Down Expand Up @@ -115,7 +115,10 @@ const DeploymentDetailSteps = ({
const processedDeploymentStatusDetailsData =
isVirtualEnv.current && processVirtualEnvironmentDeploymentData
? processVirtualEnvironmentDeploymentData(deploymentStatusDetailRes)
: processDeploymentStatusDetailsData(deploymentStatusDetailRes)
: processDeploymentStatusDetailsData(
deploymentStatusDetailRes.deploymentAppType,
deploymentStatusDetailRes,
)
clearDeploymentStatusTimer()
// If deployment status is in progress then fetch data in every 10 seconds

Expand Down Expand Up @@ -171,6 +174,7 @@ const DeploymentDetailSteps = ({
isVirtualEnvironment={isVirtualEnv.current}
appDetails={appDetails}
rootClassName="p-20"
deploymentAppType={deploymentStatusDetailsBreakdownData.deploymentAppType}
/>
</div>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import { Fragment } from 'react'

import { DeploymentAppTypes } from '@Common/Types'
import { TIMELINE_STATUS } from '@Shared/types'

import { InfoBlock } from '../InfoBlock'
Expand All @@ -29,6 +30,7 @@ const DeploymentStatusDetailBreakdown = ({
isVirtualEnvironment,
appDetails,
rootClassName = '',
deploymentAppType,
}: DeploymentStatusDetailBreakdownType) => {
const isHelmManifestPushed =
deploymentStatusDetailsBreakdownData.deploymentStatusBreakdown[
Expand Down Expand Up @@ -58,8 +60,10 @@ const DeploymentStatusDetailBreakdown = ({
{(
[
TIMELINE_STATUS.GIT_COMMIT,
TIMELINE_STATUS.ARGOCD_SYNC,
TIMELINE_STATUS.KUBECTL_APPLY,
...(appDetails.deploymentAppType === DeploymentAppTypes.ARGO ||
deploymentAppType === DeploymentAppTypes.ARGO
? [TIMELINE_STATUS.ARGOCD_SYNC, TIMELINE_STATUS.KUBECTL_APPLY]
: []),
] as DeploymentStatusDetailRowType['type'][]
).map((timelineStatus) => (
<Fragment key={timelineStatus}>
Expand Down
3 changes: 2 additions & 1 deletion src/Shared/Components/CICDHistory/TriggerOutput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ const HistoryLogs: React.FC<HistoryLogsProps> = ({
deploymentAppType={deploymentAppType}
userApprovalMetadata={userApprovalMetadata}
isGitops={
deploymentAppType === DeploymentAppTypes.GITOPS ||
deploymentAppType === DeploymentAppTypes.ARGO ||
deploymentAppType === DeploymentAppTypes.FLUX ||
deploymentAppType === DeploymentAppTypes.MANIFEST_DOWNLOAD ||
deploymentAppType === DeploymentAppTypes.MANIFEST_PUSH
}
Expand Down
1 change: 1 addition & 0 deletions src/Shared/Components/CICDHistory/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ export interface DeploymentStatusDetailBreakdownType {
*/
appDetails: AppDetails | null
rootClassName?: string
deploymentAppType?: DeploymentAppTypes
}

export interface DeploymentStatusDetailRowType extends Pick<DeploymentStatusDetailBreakdownType, 'appDetails'> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,20 @@ export const FAILED_DEPLOYMENT_STATUS: typeof PROGRESSING_DEPLOYMENT_STATUS = [
DEPLOYMENT_STATUS.UNABLE_TO_FETCH,
]

export const PHYSICAL_ENV_DEPLOYMENT_TIMELINE_ORDER: Readonly<DeploymentStatusTimelineType[]> = [
export const PHYSICAL_ENV_DEPLOYMENT_TIMELINE_ORDER_ARGO: Readonly<DeploymentStatusTimelineType[]> = [
TIMELINE_STATUS.DEPLOYMENT_INITIATED,
TIMELINE_STATUS.GIT_COMMIT,
TIMELINE_STATUS.ARGOCD_SYNC,
TIMELINE_STATUS.KUBECTL_APPLY,
TIMELINE_STATUS.APP_HEALTH,
]

export const PHYSICAL_ENV_DEPLOYMENT_TIMELINE_ORDER_FLUX: Readonly<DeploymentStatusTimelineType[]> = [
TIMELINE_STATUS.DEPLOYMENT_INITIATED,
TIMELINE_STATUS.GIT_COMMIT,
TIMELINE_STATUS.APP_HEALTH,
]

export const DEPLOYMENT_PHASES: Readonly<DeploymentPhaseType[]> = [
DeploymentPhaseType.PRE_SYNC,
DeploymentPhaseType.SYNC,
Expand Down
62 changes: 42 additions & 20 deletions src/Shared/Components/DeploymentStatusBreakdown/utils.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable no-param-reassign */
import { findRight, handleUTCTime, logExceptionToSentry } from '@Common/Helper'
import { DeploymentAppTypes } from '@Common/Types'
import { DEPLOYMENT_STATUS } from '@Shared/constants'
import {
DeploymentPhaseType,
Expand All @@ -14,14 +15,16 @@ import {
import {
DEPLOYMENT_PHASES,
FAILED_DEPLOYMENT_STATUS,
PHYSICAL_ENV_DEPLOYMENT_TIMELINE_ORDER,
PHYSICAL_ENV_DEPLOYMENT_TIMELINE_ORDER_ARGO,
PHYSICAL_ENV_DEPLOYMENT_TIMELINE_ORDER_FLUX,
PROGRESSING_DEPLOYMENT_STATUS,
SUCCESSFUL_DEPLOYMENT_STATUS,
WFR_STATUS_DTO_TO_DEPLOYMENT_STATUS_MAP,
} from './constants'
import { ProcessUnableToFetchOrTimedOutStatusType } from './types'

const getDefaultDeploymentStatusTimeline = (
deploymentAppType: DeploymentAppTypes,
data?: DeploymentStatusDetailsType,
): DeploymentStatusDetailsBreakdownDataType => {
const commonProps: Pick<
Expand All @@ -45,6 +48,7 @@ const getDefaultDeploymentStatusTimeline = (

return {
deploymentStatus,
deploymentAppType,
deploymentTriggerTime: data?.deploymentStartedOn || '',
deploymentEndTime: data?.deploymentFinishedOn || '',
triggeredBy: data?.triggeredBy || '',
Expand All @@ -58,19 +62,26 @@ const getDefaultDeploymentStatusTimeline = (
...commonProps,
displayText: 'Push manifest to Git',
},
[TIMELINE_STATUS.ARGOCD_SYNC]: {
...commonProps,
displayText: 'Synced with Argo CD',
},
[TIMELINE_STATUS.KUBECTL_APPLY]: {
...commonProps,
displayText: 'Apply manifest to Kubernetes',
resourceDetails: [],
subSteps: [],
},
...(deploymentAppType === DeploymentAppTypes.ARGO
? {
[TIMELINE_STATUS.ARGOCD_SYNC]: {
...commonProps,
displayText: 'Synced with Argo CD',
},
[TIMELINE_STATUS.KUBECTL_APPLY]: {
...commonProps,
displayText: 'Apply manifest to Kubernetes',
resourceDetails: [],
subSteps: [],
},
}
: {}),
[TIMELINE_STATUS.APP_HEALTH]: {
...commonProps,
displayText: 'Propagate manifest to Kubernetes resources',
displayText:
deploymentAppType === DeploymentAppTypes.FLUX
? 'Synced with Flux CD'
: 'Propagate manifest to Kubernetes resources',
},
},
errorBarConfig: deploymentErrorMessage
Expand Down Expand Up @@ -233,12 +244,13 @@ const processKubeCTLApply = (
* - In similar fashion based on the deploymentStatus we will set the icon and display text for the timeline.
*/
export const processDeploymentStatusDetailsData = (
deploymentAppType: DeploymentAppTypes,
data?: DeploymentStatusDetailsType,
): DeploymentStatusDetailsBreakdownDataType => {
if (data && !WFR_STATUS_DTO_TO_DEPLOYMENT_STATUS_MAP[data.wfrStatus]) {
logExceptionToSentry(new Error(`New WFR status found: ${data?.wfrStatus}`))
}
const deploymentData = getDefaultDeploymentStatusTimeline(data)
const deploymentData = getDefaultDeploymentStatusTimeline(deploymentAppType, data)

const { deploymentStatus } = deploymentData

Expand Down Expand Up @@ -266,7 +278,13 @@ export const processDeploymentStatusDetailsData = (
timeline.status.includes(TIMELINE_STATUS.ARGOCD_SYNC),
)

PHYSICAL_ENV_DEPLOYMENT_TIMELINE_ORDER.forEach((timelineStatusType, index) => {
// Only keep 3 steps in case of flux
const timelineOrder =
deploymentAppType === DeploymentAppTypes.FLUX
? PHYSICAL_ENV_DEPLOYMENT_TIMELINE_ORDER_FLUX
: PHYSICAL_ENV_DEPLOYMENT_TIMELINE_ORDER_ARGO

timelineOrder.forEach((timelineStatusType, index) => {
const element = findRight(data.timelines, getPredicate(timelineStatusType))
const timelineData = deploymentData.deploymentStatusBreakdown[timelineStatusType]

Expand All @@ -289,7 +307,11 @@ export const processDeploymentStatusDetailsData = (
if (hasDeploymentFailed) {
const hasCurrentTimelineFailed =
timelineStatusType === TIMELINE_STATUS.APP_HEALTH &&
deploymentData.deploymentStatusBreakdown.KUBECTL_APPLY.icon === 'success'
deploymentData.deploymentStatusBreakdown[
deploymentAppType === DeploymentAppTypes.FLUX
? TIMELINE_STATUS.GIT_COMMIT
: TIMELINE_STATUS.KUBECTL_APPLY
].icon === 'success'

timelineData.displaySubText = hasCurrentTimelineFailed ? 'Failed' : ''
timelineData.icon = hasCurrentTimelineFailed ? 'failed' : 'unreachable'
Expand Down Expand Up @@ -353,8 +375,8 @@ export const processDeploymentStatusDetailsData = (
}

// Moving the next timeline to inprogress
if (timelineData.icon === 'success' && index !== PHYSICAL_ENV_DEPLOYMENT_TIMELINE_ORDER.length - 1) {
const nextTimelineStatus = PHYSICAL_ENV_DEPLOYMENT_TIMELINE_ORDER[index + 1]
if (timelineData.icon === 'success' && index !== timelineOrder.length - 1) {
const nextTimelineStatus = timelineOrder[index + 1]
const nextTimeline = deploymentData.deploymentStatusBreakdown[nextTimelineStatus]

if (deploymentData.errorBarConfig) {
Expand All @@ -367,13 +389,13 @@ export const processDeploymentStatusDetailsData = (
})

// Traversing the timeline in reverse order so that if any status is there which is inprogress or success then we will mark all the previous steps as success
for (let i = PHYSICAL_ENV_DEPLOYMENT_TIMELINE_ORDER.length - 1; i >= 0; i -= 1) {
const timelineStatusType = PHYSICAL_ENV_DEPLOYMENT_TIMELINE_ORDER[i]
for (let i = timelineOrder.length - 1; i >= 0; i -= 1) {
const timelineStatusType = timelineOrder[i]
const timelineData = deploymentData.deploymentStatusBreakdown[timelineStatusType]

if (timelineData.icon === 'inprogress' || timelineData.icon === 'success') {
for (let j = i - 1; j >= 0; j -= 1) {
const prevTimelineStatusType = PHYSICAL_ENV_DEPLOYMENT_TIMELINE_ORDER[j]
const prevTimelineStatusType = timelineOrder[j]
const prevTimelineData = deploymentData.deploymentStatusBreakdown[prevTimelineStatusType]
prevTimelineData.icon = 'success'
prevTimelineData.displaySubText = ''
Expand Down
2 changes: 1 addition & 1 deletion src/Shared/Components/StatusComponent/AppStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const AppStatus = ({
tooltipProps={{
alwaysShowTippyOnHover: true,
placement: 'top',
content: 'To fetch app status for Helm based deployments open the app detail page',
content: 'To view app status open the app detail page',
}}
color="N600"
/>
Expand Down
5 changes: 3 additions & 2 deletions src/Shared/Hooks/useStickyEvent/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

export const FALLBACK_SENTINEL_HEIGHT = '1px'
export const SENTINEL_HEIGHT_BUFFER = 2
export const FALLBACK_SENTINEL_HEIGHT = `${SENTINEL_HEIGHT_BUFFER}px`
export const OBSERVER_THRESHOLD = 1
export const OBSERVER_ROOT_MARGIN = '0px'
export const OBSERVER_ROOT_MARGIN = '1px'
6 changes: 3 additions & 3 deletions src/Shared/Hooks/useStickyEvent/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { FALLBACK_SENTINEL_HEIGHT } from './constants'
import { FALLBACK_SENTINEL_HEIGHT, SENTINEL_HEIGHT_BUFFER } from './constants'
import { UseStickyEventReturnType } from './types'

export const getHeightForStickyElementTopOffset = <T extends HTMLElement>({
Expand All @@ -30,7 +30,7 @@ export const getHeightForStickyElementTopOffset = <T extends HTMLElement>({
const doesTopOffsetContainCalc = calcRegex.test(topValue)

if (doesTopOffsetContainCalc) {
return topValue.replace(calcRegex, (match) => `calc(${match} + 1px)`)
return topValue.replace(calcRegex, (match) => `calc(${match} + ${SENTINEL_HEIGHT_BUFFER}px)`)
}

return topValue.replace(/\d+(\.\d+)?/g, (match) => {
Expand All @@ -40,6 +40,6 @@ export const getHeightForStickyElementTopOffset = <T extends HTMLElement>({
return FALLBACK_SENTINEL_HEIGHT
}

return `${nMatch + 1}`
return `${nMatch + SENTINEL_HEIGHT_BUFFER}`
})
}
2 changes: 2 additions & 0 deletions src/Shared/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1251,6 +1251,7 @@ export interface DeploymentStatusDetailsType {
timelines: DeploymentStatusDetailsTimelineType[]
wfrStatus?: WorkflowRunnerStatusDTO
isDeploymentWithoutApproval: boolean
deploymentAppType: DeploymentAppTypes
}

export type DeploymentStatusTimelineType =
Expand Down Expand Up @@ -1313,6 +1314,7 @@ export interface DeploymentStatusDetailsBreakdownDataType {
deploymentErrorMessage: string
nextTimelineToProcess: DeploymentStatusTimelineType
} | null
deploymentAppType: DeploymentAppTypes
}

export interface IntelligenceConfig {
Expand Down
7 changes: 6 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,14 @@ export interface customEnv {
*/
FEATURE_MANAGE_TRAFFIC_ENABLE?: boolean
FEATURE_INFRA_PROVISION_INFO_BLOCK_HIDE?: boolean
/**
* If true, will add flux option to deployment types in devtron apps and devtron charts
* @default false
*/
FEATURE_FLUX_DEPLOYMENTS_ENABLE?: boolean
FEATURE_LINK_EXTERNAL_FLUX_ENABLE?: boolean
/**
* If true, online/offline connectivity banner is enabled
*
* @default true
*/
FEATURE_INTERNET_CONNECTIVITY_ENABLE?: boolean
Expand Down