Skip to content

Commit 75fef00

Browse files
committed
Merge branch 'develop' of https://github.com/devtron-labs/dashboard into feat/deployment-status-modal
2 parents b419bfa + 8a3cbd1 commit 75fef00

File tree

73 files changed

+2657
-1657
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+2657
-1657
lines changed

.eslintignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ src/components/CIPipelineN/ciPipeline.utils.tsx
5252
src/components/ClusterNodes/ClusterEvents.tsx
5353
src/components/ClusterNodes/ClusterManifest.tsx
5454
src/components/ClusterNodes/ClusterNodeEmptyStates.tsx
55-
src/components/ClusterNodes/ClusterOverview.tsx
5655
src/components/ClusterNodes/NodeActions/EditTaintsModal.tsx
5756
src/components/ClusterNodes/NodeActions/NodeActionsMenu.tsx
5857
src/components/ClusterNodes/NodeActions/validationRules.ts
@@ -208,7 +207,6 @@ src/components/ciPipeline/ciPipeline.service.ts
208207
src/components/ciPipeline/validationRules.ts
209208
src/components/cluster/Cluster.tsx
210209
src/components/cluster/ClusterComponentModal.tsx
211-
src/components/cluster/ClusterForm.tsx
212210
src/components/cluster/ClusterInfoStepsModal.tsx
213211
src/components/cluster/ClusterInstallStatus.tsx
214212
src/components/cluster/UseNameListDropdown.tsx

.github/workflows/pr-issue-validator.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
name: Validate Pull Request
32

43
on:
@@ -141,4 +140,4 @@ jobs:
141140
gh pr edit $PRNUM --add-label "PR:Issue-verification-failed"
142141
gh pr edit $PRNUM --remove-label "PR:Ready-to-Review"
143142
exit 1
144-
fi
143+
fi

Dockerfile

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,42 @@
11
FROM node:20-alpine AS builder
22

3-
RUN apk add --no-cache git
4-
53
WORKDIR /app
6-
COPY package.json .
7-
COPY yarn.lock .
84

5+
COPY package.json yarn.lock .
6+
7+
RUN apk add --no-cache git
98
RUN yarn install --frozen-lockfile --network-timeout 600000
109

11-
COPY src/ src
12-
COPY nginx.conf .
13-
COPY tsconfig.json .
14-
COPY vite.config.mts .
1510
COPY . .
1611

17-
RUN echo `git rev-parse --short=9 HEAD` > health.html
12+
RUN echo `git rev-parse --short HEAD` > health.html && \
13+
echo "SENTRY_RELEASE_VERSION=dashboard@$(git rev-parse --short HEAD)" >> .env && \
14+
yarn build
1815

19-
RUN echo "SENTRY_RELEASE_VERSION=dashboard@$(git rev-parse --short HEAD)\n" >> .env
16+
FROM fholzer/nginx-brotli:v1.26.2
2017

21-
RUN yarn build
18+
# Install bash
19+
RUN apk add --no-cache bash shadow
2220

23-
FROM nginx:stable
21+
RUN useradd -m -s /bin/bash devtron
2422

25-
RUN useradd -ms /bin/bash devtron
2623
COPY --from=builder /app/dist/ /usr/share/nginx/html
2724
COPY ./nginx.conf /etc/nginx/nginx.conf
2825
COPY ./nginx-default.conf /etc/nginx/conf.d/default.conf
26+
2927
WORKDIR /usr/share/nginx/html
30-
COPY --from=builder /app/./env.sh .
31-
COPY --from=builder /app/.env .
32-
COPY --from=builder /app/health.html .
3328

34-
RUN chown -R devtron:devtron /usr/share/nginx/html
35-
# Make our shell script executable
36-
RUN chmod +x env.sh
29+
30+
COPY --from=builder /app/env.sh .
31+
COPY --from=builder /app/.env .
32+
COPY --from=builder /app/health.html .
33+
34+
RUN chown -R devtron:devtron /usr/share/nginx/html && \
35+
chmod +x env.sh
36+
3737
USER devtron
38-
CMD ["/bin/bash", "-c", "/usr/share/nginx/html/env.sh && nginx -g \"daemon off;\""]
38+
39+
# Override the default ENTRYPOINT to allow shell scripting as fholzer/nginx-brotli has by-default entrypoint of nginx
40+
ENTRYPOINT ["/bin/bash", "-c"]
41+
42+
CMD ["./env.sh && nginx -g 'daemon off;'"]

nginx.conf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ http {
2020
#tcp_nopush on;
2121
keepalive_timeout 65;
2222

23+
# gzip compression
2324
gzip on;
2425
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;
2526
gzip_vary on;
@@ -28,5 +29,11 @@ http {
2829
gzip_comp_level 6;
2930
gzip_static on;
3031

32+
# btrotli compression
33+
brotli on;
34+
brotli_comp_level 6;
35+
brotli_static on;
36+
brotli_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;
37+
3138
include /etc/nginx/conf.d/*.conf;
3239
}

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.13.0-beta-5",
7+
"@devtron-labs/devtron-fe-common-lib": "1.13.0-pre-5",
88
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
99
"@rjsf/core": "^5.13.3",
1010
"@rjsf/utils": "^5.13.3",

src/Pages/App/Details/ExternalFlux/ExternalFluxAppDetails.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,12 @@ const ExternalFluxAppDetails = () => {
6969
setAppDetailsError(null)
7070
}
7171

72+
/**
73+
* Throws error in case request is aborted
74+
*/
7275
const handleFetchExternalFluxCDAppDetails = () =>
7376
// NOTE: returning a promise so that we can trigger the next timeout after this api call completes
74-
new Promise<void>((resolve) => {
77+
new Promise<void>((resolve, reject) => {
7578
setIsReloadResourceTreeInProgress(true)
7679

7780
abortPreviousRequests(
@@ -87,6 +90,8 @@ const ExternalFluxAppDetails = () => {
8790
} else {
8891
setAppDetailsError(error)
8992
}
93+
} else {
94+
reject(error)
9095
}
9196
})
9297
.finally(() => {
@@ -107,7 +112,11 @@ const ExternalFluxAppDetails = () => {
107112
}
108113

109114
const handleReloadResourceTree = async () => {
110-
await handleFetchExternalFluxCDAppDetails()
115+
try {
116+
await handleFetchExternalFluxCDAppDetails()
117+
} catch {
118+
// do nothing
119+
}
111120
}
112121

113122
useEffect(() => {

src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/constants.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { EnterpriseTag, OverrideMergeStrategyType, SelectPickerOptionType } from '@devtron-labs/devtron-fe-common-lib'
17+
import { Icon, OverrideMergeStrategyType, SelectPickerOptionType } from '@devtron-labs/devtron-fe-common-lib'
1818

1919
import { importComponentFromFELibrary } from '@Components/common'
2020

@@ -37,7 +37,11 @@ export const MERGE_STRATEGY_OPTIONS: SelectPickerOptionType[] = [
3737
label: (
3838
<div className="flexbox dc__gap-8">
3939
<span>Patch</span>
40-
{!isFELibAvailable && <EnterpriseTag />}
40+
{!isFELibAvailable && (
41+
<div className="dc__fill-available-space dc__w-fit-content h-20">
42+
<Icon name="ic-enterprise-tag" size={null} color={null} />
43+
</div>
44+
)}
4145
</div>
4246
),
4347
description: 'Override values for specific keys',

src/Pages/GlobalConfigurations/ClustersAndEnvironments/ClusterEnvironmentDrawer/ClusterEnvironmentDrawer.tsx

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

1717
import { useEffect, useState } from 'react'
18+
import { generatePath } from 'react-router-dom'
1819

1920
import {
2021
Button,
@@ -32,6 +33,7 @@ import {
3233
TagType,
3334
ToastManager,
3435
ToastVariantType,
36+
Tooltip,
3537
useForm,
3638
UseFormSubmitHandler,
3739
} from '@devtron-labs/devtron-fe-common-lib'
@@ -45,6 +47,7 @@ import { ADD_ENVIRONMENT_FORM_LOCAL_STORAGE_KEY } from '@Components/cluster/cons
4547
import { importComponentFromFELibrary } from '@Components/common'
4648
import { URLS } from '@Config/routes'
4749

50+
import { CreateClusterTypeEnum } from '../CreateCluster/types'
4851
import { EnvironmentDeleteComponent } from '../EnvironmentDeleteComponent'
4952
import { clusterEnvironmentDrawerFormValidationSchema } from './schema'
5053
import { ClusterEnvironmentDrawerFormProps, ClusterEnvironmentDrawerProps, ClusterNamespacesDTO } from './types'
@@ -61,12 +64,12 @@ export const ClusterEnvironmentDrawer = ({
6164
namespace,
6265
id,
6366
clusterId,
64-
prometheusEndpoint,
6567
isProduction,
6668
description,
6769
reload,
6870
hideClusterDrawer,
6971
isVirtual,
72+
clusterName,
7073
}: ClusterEnvironmentDrawerProps) => {
7174
// STATES
7275
// Manages the loading state for create and update actions
@@ -89,6 +92,8 @@ export const ClusterEnvironmentDrawer = ({
8992
error: null,
9093
})
9194

95+
const addEnvironmentHeaderText = `Add Environment in '${clusterName}'`
96+
9297
/**
9398
* Fetches the list of namespaces from the cluster and updates the state accordingly. \
9499
* Optionally sets namespace labels after the fetch is complete.
@@ -169,7 +174,6 @@ export const ClusterEnvironmentDrawer = ({
169174
clusterId,
170175
id,
171176
namespaceLabels: namespaceLabels.labels,
172-
prometheusEndpoint,
173177
resourceVersion: namespaceLabels.resourceVersion,
174178
isVirtual,
175179
})
@@ -248,7 +252,6 @@ export const ClusterEnvironmentDrawer = ({
248252
data,
249253
clusterId,
250254
id,
251-
prometheusEndpoint,
252255
isVirtual,
253256
})
254257
await deleteEnvironment(payload)
@@ -259,7 +262,9 @@ export const ClusterEnvironmentDrawer = ({
259262
<Button
260263
dataTestId="add_cluster_button"
261264
linkProps={{
262-
to: URLS.GLOBAL_CONFIG_CREATE_CLUSTER,
265+
to: generatePath(URLS.GLOBAL_CONFIG_CREATE_CLUSTER, {
266+
type: CreateClusterTypeEnum.CONNECT_CLUSTER,
267+
}),
263268
}}
264269
component={ButtonComponentType.link}
265270
startIcon={<ICAdd />}
@@ -400,7 +405,12 @@ export const ClusterEnvironmentDrawer = ({
400405
<Drawer position="right" width="800px" onEscape={hideClusterDrawer} onClose={hideClusterDrawer}>
401406
<div className="h-100 bg__primary flexbox-col" onClick={stopPropagation}>
402407
<div className="flexbox dc__align-items-center dc__content-space dc__border-bottom bg__primary py-12 px-20">
403-
<h3 className="m-0 fs-16 fw-6 lh-1-43">{id ? 'Edit Environment' : 'Add Environment'}</h3>
408+
{/* NOTE: only in case of add environment, can we have truncation */}
409+
<Tooltip content={addEnvironmentHeaderText}>
410+
<h3 className="m-0 fs-16 fw-6 lh-1-43 dc__truncate">
411+
{id ? 'Edit Environment' : addEnvironmentHeaderText}
412+
</h3>
413+
</Tooltip>
404414
<button
405415
type="button"
406416
aria-label="close-btn"

src/Pages/GlobalConfigurations/ClustersAndEnvironments/ClusterEnvironmentDrawer/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ export interface ClusterEnvironmentDrawerFormProps {
2626
export interface ClusterEnvironmentDrawerProps extends ClusterEnvironmentDrawerFormProps {
2727
id: string
2828
clusterId: number
29-
prometheusEndpoint: string
3029
reload: () => void
3130
hideClusterDrawer: () => void
3231
isVirtual: boolean
32+
clusterName: string
3333
}
3434

3535
export type GetClusterEnvironmentUpdatePayloadType = Pick<
3636
ClusterEnvironmentDrawerProps,
37-
'clusterId' | 'id' | 'prometheusEndpoint' | 'isVirtual'
37+
'clusterId' | 'id' | 'isVirtual'
3838
> &
3939
Partial<Pick<ClusterNamespacesDTO, 'resourceVersion'>> & {
4040
data: ClusterEnvironmentDrawerFormProps

src/Pages/GlobalConfigurations/ClustersAndEnvironments/ClusterEnvironmentDrawer/utils.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import { ClusterNamespacesDTO, GetClusterEnvironmentUpdatePayloadType } from './
1919
export const getClusterEnvironmentUpdatePayload = ({
2020
id,
2121
data,
22-
prometheusEndpoint,
2322
clusterId,
2423
namespaceLabels,
2524
resourceVersion,
@@ -38,7 +37,6 @@ export const getClusterEnvironmentUpdatePayload = ({
3837
id,
3938
environment_name: data.environmentName,
4039
cluster_id: clusterId,
41-
prometheus_endpoint: prometheusEndpoint,
4240
namespace: data.namespace || '',
4341
active: true,
4442
default: data.isProduction,

0 commit comments

Comments
 (0)