@@ -439,6 +439,7 @@ export function addQueryParamToGrafanaURL(
439
439
return url
440
440
}
441
441
442
+ // NOTE: Need to improve logic since in some cases the unknown status would leak to previous entites, can do that by not setting deploymentStatus as Failed by ourselves and let backend be source of truth of that
442
443
export const processDeploymentStatusDetailsData = (
443
444
data ?: DeploymentStatusDetailsType ,
444
445
) : DeploymentStatusDetailsBreakdownDataType => {
@@ -465,6 +466,14 @@ export const processDeploymentStatusDetailsData = (
465
466
time : '' ,
466
467
isCollapsed : true ,
467
468
} ,
469
+ ARGOCD_SYNC : {
470
+ icon : '' ,
471
+ displayText : 'Synced with Argo CD' ,
472
+ displaySubText : '' ,
473
+ timelineStatus : '' ,
474
+ time : '' ,
475
+ isCollapsed : true ,
476
+ } ,
468
477
KUBECTL_APPLY : {
469
478
icon : '' ,
470
479
displayText : 'Apply manifest to Kubernetes' ,
@@ -507,6 +516,7 @@ export const processDeploymentStatusDetailsData = (
507
516
deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . icon = 'success'
508
517
deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . isCollapsed = true
509
518
deploymentData . deploymentStatusBreakdown . APP_HEALTH . isCollapsed = true
519
+ deploymentData . deploymentStatusBreakdown . ARGOCD_SYNC . icon = 'success'
510
520
deploymentData . deploymentStatusBreakdown . GIT_COMMIT . icon = 'success'
511
521
} else if ( element [ 'status' ] === TIMELINE_STATUS . DEPLOYMENT_FAILED ) {
512
522
deploymentData . deploymentStatus = DEPLOYMENT_STATUS . FAILED
@@ -534,6 +544,7 @@ export const processDeploymentStatusDetailsData = (
534
544
for ( let item of element . resourceDetails ) {
535
545
if ( phase === item . resourcePhase ) {
536
546
tableData . currentPhase = phase
547
+ // Seems else block was forgotten to add here, TODO: Sync for this later
537
548
if ( item . resourceStatus === 'failed' ) {
538
549
}
539
550
tableData . currentTableData . push ( {
@@ -595,11 +606,22 @@ export const processDeploymentStatusDetailsData = (
595
606
}
596
607
} )
597
608
}
609
+
610
+ // TO Support legacy data have to make sure that if ARGOCD_SYNC is not available then we fill it with dummy values
611
+ const isArgoCDAvailable = data ?. timelines ?. some ( ( timeline ) =>
612
+ timeline [ 'status' ] . includes ( TIMELINE_STATUS . ARGOCD_SYNC ) ,
613
+ )
614
+ if ( ! isArgoCDAvailable ) {
615
+ deploymentData . deploymentStatusBreakdown . ARGOCD_SYNC . icon = 'success'
616
+ deploymentData . deploymentStatusBreakdown . ARGOCD_SYNC . displaySubText = ''
617
+ deploymentData . deploymentStatusBreakdown . ARGOCD_SYNC . time = element [ 'statusTime' ]
618
+ }
598
619
} else if ( element [ 'status' ] === TIMELINE_STATUS . KUBECTL_APPLY_SYNCED ) {
599
620
deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . resourceDetails = [ ]
600
621
deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . displaySubText = ''
601
622
deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . time = element [ 'statusTime' ]
602
623
deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . icon = 'success'
624
+ deploymentData . deploymentStatusBreakdown . ARGOCD_SYNC . icon = 'success'
603
625
deploymentData . deploymentStatusBreakdown . GIT_COMMIT . icon = 'success'
604
626
deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . kubeList = tableData . currentTableData
605
627
@@ -623,27 +645,87 @@ export const processDeploymentStatusDetailsData = (
623
645
deploymentData . deploymentStatusBreakdown . APP_HEALTH . isCollapsed = false
624
646
}
625
647
}
648
+ } else if ( element [ 'status' ] . includes ( TIMELINE_STATUS . ARGOCD_SYNC ) ) {
649
+ deploymentData . deploymentStatusBreakdown . ARGOCD_SYNC . time = element [ 'statusTime' ]
650
+
651
+ if ( element [ 'status' ] === TIMELINE_STATUS . ARGOCD_SYNC_FAILED ) {
652
+ deploymentData . deploymentStatusBreakdown . ARGOCD_SYNC . displaySubText = 'Failed'
653
+ deploymentData . deploymentStatusBreakdown . ARGOCD_SYNC . icon = 'failed'
654
+
655
+ deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . displaySubText = ''
656
+ deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . icon = 'unreachable'
657
+
658
+ deploymentData . deploymentStatusBreakdown . APP_HEALTH . displaySubText = ''
659
+ deploymentData . deploymentStatusBreakdown . APP_HEALTH . icon = 'unreachable'
660
+
661
+ deploymentData . deploymentStatusBreakdown . ARGOCD_SYNC . isCollapsed = false
662
+ deploymentData . deploymentStatus = DEPLOYMENT_STATUS . FAILED
663
+ deploymentData . deploymentStatusText = 'Failed'
664
+ deploymentData . deploymentStatusBreakdown . ARGOCD_SYNC . timelineStatus = element [ 'statusDetail' ]
665
+ }
666
+ else {
667
+ deploymentData . deploymentStatusBreakdown . ARGOCD_SYNC . icon = 'success'
668
+ if ( deploymentData . deploymentStatus === DEPLOYMENT_STATUS . FAILED ) {
669
+ deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . displaySubText = ''
670
+ deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . icon = 'unreachable'
671
+
672
+ deploymentData . deploymentStatusBreakdown . APP_HEALTH . displaySubText = ''
673
+ deploymentData . deploymentStatusBreakdown . APP_HEALTH . icon = 'unreachable'
674
+
675
+ if ( deploymentData . nonDeploymentError === '' ) {
676
+ deploymentData . nonDeploymentError = TIMELINE_STATUS . KUBECTL_APPLY
677
+ }
678
+ } else if (
679
+ deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . time === '' &&
680
+ deploymentData . deploymentStatus === DEPLOYMENT_STATUS . INPROGRESS
681
+ ) {
682
+ deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . icon = ''
683
+ deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . displaySubText = 'Waiting'
684
+ deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . kubeList = [
685
+ { icon : '' , message : 'Waiting to be started by Argo CD' } ,
686
+ { icon : '' , message : 'Create and update resources based on manifest' } ,
687
+ ]
688
+ deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . isCollapsed = false
689
+ }
690
+ }
626
691
} else if ( element [ 'status' ] . includes ( TIMELINE_STATUS . GIT_COMMIT ) ) {
627
692
deploymentData . deploymentStatusBreakdown . GIT_COMMIT . time = element [ 'statusTime' ]
628
693
if ( element [ 'status' ] === TIMELINE_STATUS . GIT_COMMIT_FAILED ) {
629
694
deploymentData . deploymentStatusBreakdown . GIT_COMMIT . displaySubText = 'Failed'
630
695
deploymentData . deploymentStatusBreakdown . GIT_COMMIT . icon = 'failed'
696
+
697
+ deploymentData . deploymentStatusBreakdown . ARGOCD_SYNC . displaySubText = ''
698
+ deploymentData . deploymentStatusBreakdown . ARGOCD_SYNC . icon = 'unreachable'
699
+
700
+ deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . displaySubText = ''
631
701
deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . icon = 'unreachable'
702
+
703
+ deploymentData . deploymentStatusBreakdown . APP_HEALTH . displaySubText = ''
632
704
deploymentData . deploymentStatusBreakdown . APP_HEALTH . icon = 'unreachable'
705
+
633
706
deploymentData . deploymentStatusBreakdown . GIT_COMMIT . isCollapsed = false
634
707
deploymentData . deploymentStatus = DEPLOYMENT_STATUS . FAILED
635
708
deploymentData . deploymentStatusText = 'Failed'
636
709
deploymentData . deploymentStatusBreakdown . GIT_COMMIT . timelineStatus = element [ 'statusDetail' ]
637
710
} else {
638
711
deploymentData . deploymentStatusBreakdown . GIT_COMMIT . icon = 'success'
639
712
if ( deploymentData . deploymentStatus === DEPLOYMENT_STATUS . FAILED ) {
713
+ if ( deploymentData . deploymentStatusBreakdown . ARGOCD_SYNC . icon === '' ) {
714
+ deploymentData . deploymentStatusBreakdown . ARGOCD_SYNC . displaySubText = ''
715
+ deploymentData . deploymentStatusBreakdown . ARGOCD_SYNC . icon = 'unreachable'
716
+ }
717
+
640
718
deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . displaySubText = ''
641
719
deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . icon = 'unreachable'
720
+
642
721
deploymentData . deploymentStatusBreakdown . APP_HEALTH . displaySubText = ''
643
722
deploymentData . deploymentStatusBreakdown . APP_HEALTH . icon = 'unreachable'
644
- deploymentData . nonDeploymentError = TIMELINE_STATUS . KUBECTL_APPLY
723
+
724
+ if ( deploymentData . nonDeploymentError === '' ) {
725
+ deploymentData . nonDeploymentError = TIMELINE_STATUS . ARGOCD_SYNC
726
+ }
645
727
} else if (
646
- deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . time === '' &&
728
+ deploymentData . deploymentStatusBreakdown . ARGOCD_SYNC . time === '' &&
647
729
deploymentData . deploymentStatus === DEPLOYMENT_STATUS . INPROGRESS
648
730
) {
649
731
deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . icon = ''
@@ -653,6 +735,8 @@ export const processDeploymentStatusDetailsData = (
653
735
{ icon : '' , message : 'Create and update resources based on manifest' } ,
654
736
]
655
737
deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . isCollapsed = false
738
+ deploymentData . deploymentStatusBreakdown . ARGOCD_SYNC . icon = 'inprogress'
739
+ deploymentData . deploymentStatusBreakdown . ARGOCD_SYNC . displaySubText = 'In progress'
656
740
}
657
741
}
658
742
} else if ( element [ 'status' ] === TIMELINE_STATUS . DEPLOYMENT_INITIATED ) {
@@ -662,23 +746,66 @@ export const processDeploymentStatusDetailsData = (
662
746
deploymentData . deploymentStatus === DEPLOYMENT_STATUS . INPROGRESS
663
747
) {
664
748
deploymentData . deploymentStatusBreakdown . GIT_COMMIT . icon = 'inprogress'
749
+
750
+ deploymentData . deploymentStatusBreakdown . ARGOCD_SYNC . icon = ''
751
+ deploymentData . deploymentStatusBreakdown . ARGOCD_SYNC . displaySubText = 'Waiting'
752
+
753
+ deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . icon = ''
754
+ deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . displaySubText = 'Waiting'
755
+ deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . kubeList = [
756
+ { icon : '' , message : 'Waiting to be started by Argo CD' } ,
757
+ { icon : '' , message : 'Create and update resources based on manifest' } ,
758
+ ]
759
+ deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . isCollapsed = false
665
760
}
666
761
if ( deploymentData . deploymentStatus === DEPLOYMENT_STATUS . FAILED ) {
667
762
if ( deploymentData . deploymentStatusBreakdown . GIT_COMMIT . time === '' ) {
668
763
deploymentData . deploymentStatusBreakdown . GIT_COMMIT . displaySubText = ''
669
764
deploymentData . deploymentStatusBreakdown . GIT_COMMIT . icon = 'unreachable'
765
+
766
+ deploymentData . deploymentStatusBreakdown . ARGOCD_SYNC . displaySubText = ''
767
+ deploymentData . deploymentStatusBreakdown . ARGOCD_SYNC . icon = 'unreachable'
768
+
670
769
deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . displaySubText = ''
671
770
deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . icon = 'unreachable'
771
+
672
772
deploymentData . deploymentStatusBreakdown . APP_HEALTH . displaySubText = ''
673
773
deploymentData . deploymentStatusBreakdown . APP_HEALTH . icon = 'unreachable'
774
+
674
775
deploymentData . nonDeploymentError = TIMELINE_STATUS . GIT_COMMIT
675
776
} else if ( deploymentData . deploymentStatusBreakdown . GIT_COMMIT . icon !== 'failed' ) {
676
- if ( deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . time === '' ) {
777
+ if ( deploymentData . deploymentStatusBreakdown . ARGOCD_SYNC . time === '' ) {
778
+ deploymentData . deploymentStatusBreakdown . ARGOCD_SYNC . displaySubText = 'Unknown'
779
+ deploymentData . deploymentStatusBreakdown . ARGOCD_SYNC . icon = 'unknown'
780
+
677
781
deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . displaySubText = 'Unknown'
678
782
deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . icon = 'unknown'
783
+
679
784
deploymentData . deploymentStatusBreakdown . APP_HEALTH . displaySubText = ': Unknown'
680
785
deploymentData . deploymentStatusBreakdown . APP_HEALTH . icon = 'unknown'
681
786
}
787
+ else if ( deploymentData . deploymentStatusBreakdown . ARGOCD_SYNC . icon !== 'failed' ) {
788
+ deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . displaySubText = 'Unknown'
789
+ deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . icon = 'unknown'
790
+
791
+ deploymentData . deploymentStatusBreakdown . APP_HEALTH . displaySubText = ': Unknown'
792
+ deploymentData . deploymentStatusBreakdown . APP_HEALTH . icon = 'unknown'
793
+ }
794
+ }
795
+ else {
796
+ deploymentData . deploymentStatusBreakdown . GIT_COMMIT . displaySubText = ''
797
+ deploymentData . deploymentStatusBreakdown . GIT_COMMIT . icon = 'unreachable'
798
+
799
+ deploymentData . deploymentStatusBreakdown . ARGOCD_SYNC . displaySubText = ''
800
+ deploymentData . deploymentStatusBreakdown . ARGOCD_SYNC . icon = 'unreachable'
801
+
802
+ deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . displaySubText = ''
803
+ deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . icon = 'unreachable'
804
+
805
+ deploymentData . deploymentStatusBreakdown . APP_HEALTH . displaySubText = ''
806
+ deploymentData . deploymentStatusBreakdown . APP_HEALTH . icon = 'unreachable'
807
+
808
+ deploymentData . nonDeploymentError = TIMELINE_STATUS . GIT_COMMIT
682
809
}
683
810
}
684
811
}
@@ -692,6 +819,7 @@ export const processDeploymentStatusDetailsData = (
692
819
deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . icon = 'success'
693
820
deploymentData . deploymentStatusBreakdown . KUBECTL_APPLY . isCollapsed = true
694
821
deploymentData . deploymentStatusBreakdown . APP_HEALTH . isCollapsed = true
822
+ deploymentData . deploymentStatusBreakdown . ARGOCD_SYNC . icon = 'success'
695
823
deploymentData . deploymentStatusBreakdown . GIT_COMMIT . icon = 'success'
696
824
} else if ( data ?. wfrStatus === 'Failed' || data ?. wfrStatus === 'Degraded' ) {
697
825
deploymentData . deploymentStatus = DEPLOYMENT_STATUS . FAILED
0 commit comments