Skip to content

Commit 8b9260b

Browse files
author
Mukul Tayal
committed
Merge remote-tracking branch 'origin' into feat/lock-config-release
2 parents 1637501 + 75ed9f8 commit 8b9260b

File tree

24 files changed

+136
-43
lines changed

24 files changed

+136
-43
lines changed

.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,5 @@ ANNOUNCEMENT_BANNER_MSG=
3838
LOGIN_PAGE_IMAGE=
3939
LOGIN_PAGE_IMAGE_BG=
4040
HIDE_DEFAULT_CLUSTER=false
41+
GLOBAL_API_TIMEOUT=60000
42+
TRIGGER_API_TIMEOUT=60000

config.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,7 @@
2828
| LOGIN_PAGE_IMAGE | "" | Login page image url |
2929
| LOGIN_PAGE_IMAGE_BG | "" | Login page image background color code |
3030
| DEFAULT_CI_TRIGGER_TYPE_MANUAL | "false" | Change default trigger behaviour of newly created ci-pipeline to manual |
31+
| GLOBAL_API_TIMEOUT | 60000 | Default timeout for all API requests in DASHBOARD |
32+
| TRIGGER_API_TIMEOUT | 60000 | Default timeout for all API requests for Trigger calls (Deploy artifacts, charts) in DASHBOARD |
3133

3234
# DASHBOARD CONFIG SECRET

src/components/CIPipelineN/YAMLScriptComponent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export function YAMLScriptComponent({
5656
components={{
5757
IndicatorSeparator: null,
5858
}}
59-
menuPortalTarget={document.getElementById('visible-modal')}
59+
menuPosition="fixed"
6060
/>
6161
)}
6262
</div>

src/components/ResourceBrowser/ResourceList/ResourceList.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ export default function ResourceList() {
310310
!isTerminal &&
311311
!isNodes
312312
) {
313-
getResourceListData()
313+
selectedResource.gvk.Kind !== SIDEBAR_KEYS.nodeGVK.Kind && getResourceListData()
314314
setSearchText('')
315315
setSearchApplied(false)
316316
} else if (isNodes) {
@@ -634,7 +634,6 @@ export default function ResourceList() {
634634
setResourceListLoader(true)
635635
setResourceList(null)
636636
setFilteredResourceList([])
637-
638637
const resourceListPayload: ResourceListPayloadType = {
639638
clusterId: Number(clusterId),
640639
k8sRequest: {

src/components/app/details/appConfig/AppComposeRouter.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export default function AppComposeRouter({
6161
configProtectionData,
6262
filteredEnvIds,
6363
isSuperAdmin,
64-
64+
,
6565
}: AppComposeRouterProps) {
6666
const { path } = useRouteMatch()
6767
const renderJobViewRoutes = (): JSX.Element => {
@@ -209,7 +209,7 @@ export default function AppComposeRouter({
209209
</Route>,
210210
<Route
211211
key={`${path}/${URLS.APP_ENV_OVERRIDE_CONFIG}`}
212-
path={`${path}/${URLS.APP_ENV_OVERRIDE_CONFIG}/:envId(\\d+)?/:name?`}
212+
path={`${path}/${URLS.APP_ENV_OVERRIDE_CONFIG}/:envId(\\d+)?`}
213213
render={(props) => (
214214
<EnvironmentOverride environments={environments} reloadEnvironments={reloadEnvironments} isSuperAdmin={isSuperAdmin}/>
215215
)}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1442,7 +1442,7 @@ export function TimeRangeSelector({
14421442
options={options.map((time) => ({ label: time, value: time }))}
14431443
value={{ label: selectedRange, value: selectedRange }}
14441444
onChange={(selected) => selectRange(selected.value)}
1445-
menuPortalTarget={document.body}
1445+
menuPosition="fixed"
14461446
components={{ IndicatorSeparator: null, ValueContainer, Option }}
14471447
styles={{
14481448
...multiSelectStyles,

src/components/app/details/cicdHistory/Sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ const Sidebar = React.memo(
133133
DropdownIndicator,
134134
}}
135135
styles={FILTER_STYLE}
136-
menuPortalTarget={document.body}
136+
menuPosition="fixed"
137137
/>
138138
</div>
139139

src/components/app/details/cicdHistory/TriggerDetails.tsx

Lines changed: 57 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -176,33 +176,58 @@ const WorkerStatus = React.memo(
176176
const ProgressingStatus = React.memo(
177177
({ status, message, podStatus, stage, type, finishedOn, workerPodName }: ProgressingStatusType): JSX.Element => {
178178
const [aborting, setAborting] = useState(false)
179-
const [abortConfirmation, setAbortConfiguration] = useState(false)
179+
const [abortConfirmation, setAbortConfirmation] = useState(false)
180+
const [abortError, setAbortError] = useState<{
181+
status: boolean
182+
message: string
183+
}>({
184+
status: false,
185+
message: '',
186+
})
180187
const { buildId, triggerId, pipelineId } = useParams<{
181188
buildId: string
182189
triggerId: string
183190
pipelineId: string
184191
}>()
185192
let abort = null
186193
if (type === HistoryComponentType.CI) {
187-
abort = () => cancelCiTrigger({ pipelineId, workflowId: buildId })
194+
abort = (isForceAbort: boolean) => cancelCiTrigger({ pipelineId, workflowId: buildId }, isForceAbort)
188195
} else if (stage !== 'DEPLOY') {
189196
abort = () => cancelPrePostCdTrigger(pipelineId, triggerId)
190197
}
191198

192199
async function abortRunning() {
193200
setAborting(true)
194-
const [error] = await asyncWrap(abort())
195-
setAborting(false)
196-
if (error) {
197-
showError(error)
198-
} else {
201+
try {
202+
await abort(abortError.status)
199203
toast.success('Build Aborted')
200-
setAbortConfiguration(false)
204+
setAbortConfirmation(false)
205+
setAbortError({
206+
status: false,
207+
message: '',
208+
})
209+
} catch (error) {
210+
setAborting(false)
211+
setAbortConfirmation(false)
212+
if (error['code'] === 400) {
213+
// code 400 is for aborting a running build
214+
const errors = error['errors']
215+
setAbortError({
216+
status: true,
217+
message: errors[0].userMessage,
218+
})
219+
}
201220
}
202221
}
203222

204223
const toggleAbortConfiguration = (): void => {
205-
setAbortConfiguration(not)
224+
setAbortConfirmation(not)
225+
}
226+
const closeForceAbortModal = (): void => {
227+
setAbortError({
228+
status: false,
229+
message: '',
230+
})
206231
}
207232
return (
208233
<>
@@ -252,6 +277,29 @@ const ProgressingStatus = React.memo(
252277
</ConfirmationDialog.ButtonGroup>
253278
</ConfirmationDialog>
254279
)}
280+
{abortError.status && (
281+
<ConfirmationDialog>
282+
<ConfirmationDialog.Icon src={warn} />
283+
<ConfirmationDialog.Body title="Could not abort build!" />
284+
<div className="w-100 bc-n50 h-36 flexbox dc__align-items-center">
285+
<span className="pl-12">Error: {abortError.message}</span>
286+
</div>
287+
<div className="fs-13 fw-6 pt-12 cn-7 lh-1-54">
288+
<span>Please try to force abort</span>
289+
</div>
290+
<div className="pt-4 fw-4 cn-7 lh-1-54">
291+
<span>Some resource might get orphaned which will be cleaned up with Job-lifecycle</span>
292+
</div>
293+
<ConfirmationDialog.ButtonGroup>
294+
<button type="button" className="cta cancel" onClick={closeForceAbortModal}>
295+
Cancel
296+
</button>
297+
<button type="button" className="cta delete" onClick={abortRunning}>
298+
{aborting ? <Progressing /> : 'Force Abort'}
299+
</button>
300+
</ConfirmationDialog.ButtonGroup>
301+
</ConfirmationDialog>
302+
)}
255303
</>
256304
)
257305
},

src/components/app/service.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
DeploymentNodeType,
1010
put,
1111
} from '@devtron-labs/devtron-fe-common-lib'
12-
import { createGitCommitUrl, handleUTCTime, ISTTimeModal } from '../common'
12+
import { createGitCommitUrl, getAPIOptionsWithTriggerTimeout, handleUTCTime, ISTTimeModal } from '../common'
1313
import moment from 'moment-timezone'
1414
import { History } from './details/cicdHistory/types'
1515
import { AppDetails, ArtifactsCiJob, EditAppRequest } from './types'
@@ -282,8 +282,8 @@ export function extractImage(image: string): string {
282282
return image ? image.split(':').pop() : ''
283283
}
284284

285-
export const cancelCiTrigger = (params) => {
286-
let URL = `${Routes.CI_CONFIG_GET}/${params.pipelineId}/workflow/${params.workflowId}`
285+
export const cancelCiTrigger = (params, isForceAbort) => {
286+
let URL = `${Routes.CI_CONFIG_GET}/${params.pipelineId}/workflow/${params.workflowId}?forceAbort=${isForceAbort}`
287287
return trash(URL)
288288
}
289289

@@ -334,7 +334,9 @@ export const triggerCDNode = (
334334
request['wfrIdForDeploymentWithSpecificTrigger'] = wfrId
335335
}
336336
}
337-
return post(Routes.CD_TRIGGER_POST, request)
337+
const options = getAPIOptionsWithTriggerTimeout()
338+
339+
return post(Routes.CD_TRIGGER_POST, request, options)
338340
}
339341

340342
export const triggerBranchChange = (appIds: number[], envId: number, value: string) => {

src/components/cdPipeline/BuildCD.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,9 @@ export default function BuildCD({
329329
<>
330330
<div className="form__row form__row--flex mt-12">
331331
<div className="w-50 mr-8">
332-
<div className="form__label">Environment*</div>
332+
<div className="form__label dc__required-field">Environment</div>
333333
<ReactSelect
334-
menuPortalTarget={isAdvanced ? null : document.getElementById('visible-modal')}
334+
menuPosition={isAdvanced ? null : "fixed"}
335335
closeMenuOnScroll={true}
336336
isDisabled={!!cdPipelineId}
337337
classNamePrefix="cd-pipeline-environment-dropdown"
@@ -549,7 +549,7 @@ export default function BuildCD({
549549
<p className="fs-14 fw-6 cn-9 mb-8 mt-16">Deployment Strategy</p>
550550
<p className="fs-13 fw-5 cn-7 mb-8">Configure deployment preferences for this pipeline</p>
551551
<ReactSelect
552-
menuPortalTarget={document.getElementById('visible-modal')}
552+
menuPosition="fixed"
553553
closeMenuOnScroll={true}
554554
classNamePrefix="deployment-strategy-dropdown"
555555
isSearchable={false}

0 commit comments

Comments
 (0)