From fde50870955e085bdb1d625cc67650c05d22bc42 Mon Sep 17 00:00:00 2001 From: Sergey Smolnikov Date: Mon, 4 Nov 2024 16:33:57 +0100 Subject: [PATCH 1/4] Added an option and indication to deploy external DNS to apply-config job --- .../pipeline-form-apply-config.tsx | 30 ++++++++++++++++--- src/components/job-overview/index.tsx | 15 +++++++++- src/store/radix-api.ts | 21 +++++++++++-- 3 files changed, 58 insertions(+), 8 deletions(-) diff --git a/src/components/create-job-form/pipeline-form-apply-config.tsx b/src/components/create-job-form/pipeline-form-apply-config.tsx index 46426b61f..4dcbbd45b 100644 --- a/src/components/create-job-form/pipeline-form-apply-config.tsx +++ b/src/components/create-job-form/pipeline-form-apply-config.tsx @@ -1,6 +1,11 @@ -import { Button, CircularProgress, Typography } from '@equinor/eds-core-react'; -import type { FormEvent } from 'react'; - +import { + Button, + Checkbox, + CircularProgress, + List, + Typography, +} from '@equinor/eds-core-react'; +import { type FormEvent, useState } from 'react'; import { useTriggerPipelineApplyConfigMutation } from '../../store/radix-api'; import { getFetchErrorMessage } from '../../store/utils'; import { Alert } from '../alert'; @@ -13,13 +18,16 @@ export function PipelineFormApplyConfig({ onSuccess, }: FormProp) { const [trigger, state] = useTriggerPipelineApplyConfigMutation(); + const [deployExternalDNS, setDeployExternalDNS] = useState(false); const handleSubmit = handlePromiseWithToast( async (e: FormEvent) => { e.preventDefault(); const response = await trigger({ appName, - pipelineParametersApplyConfig: {}, + pipelineParametersApplyConfig: { + deployExternalDNS: deployExternalDNS, + }, }).unwrap(); onSuccess(response.name); } @@ -39,6 +47,20 @@ export function PipelineFormApplyConfig({ > Apply Radix config + + + Apply changes in DNS alias, build secrets, environments (create + new or soft-delete existing) + + + setDeployExternalDNS(!deployExternalDNS)} + /> + +
{state.isLoading && ( diff --git a/src/components/job-overview/index.tsx b/src/components/job-overview/index.tsx index 726cac347..02d9089f3 100644 --- a/src/components/job-overview/index.tsx +++ b/src/components/job-overview/index.tsx @@ -1,4 +1,9 @@ -import { Button, CircularProgress, Typography } from '@equinor/eds-core-react'; +import { + Button, + Checkbox, + CircularProgress, + Typography, +} from '@equinor/eds-core-react'; import * as PropTypes from 'prop-types'; import { useState } from 'react'; import { Link } from 'react-router-dom'; @@ -240,6 +245,14 @@ export const JobOverview = ({ appName, jobName }: Props) => { )} + {job.pipeline === 'apply-config' && ( + + )} Triggered by {job.triggeredBy || 'N/A'} {job.commitID && ( diff --git a/src/store/radix-api.ts b/src/store/radix-api.ts index 6a74b1681..c20719273 100644 --- a/src/store/radix-api.ts +++ b/src/store/radix-api.ts @@ -2573,6 +2573,8 @@ export type JobSummary = { commitID?: string; /** Created timestamp */ created?: string; + /** DeployExternalDNS deploy external DNS */ + deployExternalDNS?: boolean | null; /** Ended timestamp */ ended?: string; /** Environments the job deployed to */ @@ -2586,7 +2588,7 @@ export type JobSummary = { /** OverrideUseBuildCache override default or configured build cache option */ overrideUseBuildCache?: boolean | null; /** Name of the pipeline */ - pipeline?: 'build' | 'build-deploy' | 'promote' | 'deploy'; + pipeline?: 'build' | 'build-deploy' | 'promote' | 'deploy' | 'apply-config'; /** RadixDeployment name, which is promoted */ promotedFromDeployment?: string; /** Environment name, from which the Radix deployment is promoted */ @@ -2732,7 +2734,12 @@ export type DeploymentSummary = { /** Name the unique name of the Radix application deployment */ name: string; /** Type of pipeline job */ - pipelineJobType?: 'build' | 'build-deploy' | 'promote' | 'deploy'; + pipelineJobType?: + | 'build' + | 'build-deploy' + | 'promote' + | 'deploy' + | 'apply-config'; /** Name of the environment the deployment was promoted from Applies only for pipeline jobs of type 'promote' */ promotedFromEnvironment?: string; @@ -3181,6 +3188,8 @@ export type Job = { components?: ComponentSummary[]; /** Created timestamp */ created?: string; + /** DeployExternalDNS deploy external DNS */ + deployExternalDNS?: boolean | null; /** Array of deployments */ deployments?: DeploymentSummary[]; /** Ended timestamp */ @@ -3191,8 +3200,10 @@ export type Job = { }; /** Name of the job */ name?: string; + /** OverrideUseBuildCache override default or configured build cache option */ + overrideUseBuildCache?: boolean | null; /** Name of the pipeline */ - pipeline?: 'build' | 'build-deploy' | 'promote' | 'deploy'; + pipeline?: 'build' | 'build-deploy' | 'promote' | 'deploy' | 'apply-config'; /** RadixDeployment name, which is promoted */ promotedFromDeployment?: string; /** PromotedFromEnvironment the name of the environment that was promoted from */ @@ -3395,6 +3406,8 @@ export type PipelineRunTaskStep = { statusMessage?: string; }; export type PipelineParametersApplyConfig = { + /** DeployExternalDNS deploy external DNS */ + deployExternalDNS?: boolean | null; /** TriggeredBy of the job - if empty will use user token upn (user principle name) */ triggeredBy?: string; }; @@ -3405,6 +3418,8 @@ export type PipelineParametersBuild = { /** CommitID the commit ID of the branch to build REQUIRED for "build" and "build-deploy" pipelines */ commitID?: string; + /** DeployExternalDNS deploy external DNS */ + deployExternalDNS?: boolean | null; /** ImageName of the component, without repository name and image-tag */ imageName?: string; /** ImageRepository of the component, without image name and image-tag */ From 73e3504bfe3ebe9e1c8db0f61904fb0f42c2e3a8 Mon Sep 17 00:00:00 2001 From: Sergey Smolnikov Date: Mon, 4 Nov 2024 16:45:18 +0100 Subject: [PATCH 2/4] Added an indication Override use build cache to build-deploy job --- src/components/job-overview/index.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/components/job-overview/index.tsx b/src/components/job-overview/index.tsx index 02d9089f3..7c0c2bbdb 100644 --- a/src/components/job-overview/index.tsx +++ b/src/components/job-overview/index.tsx @@ -245,6 +245,15 @@ export const JobOverview = ({ appName, jobName }: Props) => { )} + {job.pipeline === 'build-deploy' && + job.overrideUseBuildCache === true && ( + + )} {job.pipeline === 'apply-config' && ( Date: Mon, 4 Nov 2024 16:53:22 +0100 Subject: [PATCH 3/4] Added an indication Override use build cache to build-deploy and build job --- src/components/job-overview/index.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/job-overview/index.tsx b/src/components/job-overview/index.tsx index 7c0c2bbdb..dd15dfdc0 100644 --- a/src/components/job-overview/index.tsx +++ b/src/components/job-overview/index.tsx @@ -245,12 +245,13 @@ export const JobOverview = ({ appName, jobName }: Props) => { )} - {job.pipeline === 'build-deploy' && - job.overrideUseBuildCache === true && ( + {(job.pipeline === 'build-deploy' || + job.pipeline === 'build') && + job.overrideUseBuildCache !== undefined && ( )} From 872d4833ce7ae599dc164ba06300e901b136d4e8 Mon Sep 17 00:00:00 2001 From: Sergey Smolnikov Date: Mon, 11 Nov 2024 14:47:56 +0100 Subject: [PATCH 4/4] Fixed api --- src/store/radix-api.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/store/radix-api.ts b/src/store/radix-api.ts index 089457ca6..ff8b8f8f0 100644 --- a/src/store/radix-api.ts +++ b/src/store/radix-api.ts @@ -2846,7 +2846,7 @@ export type AlertingConfig = { export type UpdateSlackConfigSecrets = { /** WebhookURL the Slack webhook URL where alerts are sent Secret key for webhook URL is updated if a non-nil value is present, and deleted if omitted or set to null - + required: */ webhookUrl?: string | null; }; @@ -2900,6 +2900,8 @@ export type Deployment = { activeFrom?: string; /** ActiveTo Timestamp when the deployment ends */ activeTo?: string; + /** Name of the branch used to build the deployment */ + builtFromBranch?: string; /** Array of components */ components?: Component[]; /** Name of job creating deployment */ @@ -3185,7 +3187,7 @@ export type Job = { /** CommitID the commit ID of the branch to build */ commitID?: string; /** Components (array of ComponentSummary) created by the job - + Deprecated: Inspect each deployment to get list of components created by the job */ components?: ComponentSummary[]; /** Created timestamp */ @@ -3194,8 +3196,6 @@ export type Job = { deployExternalDNS?: boolean | null; /** DeployedToEnvironment the name of the environment that was deployed to */ deployedToEnvironment?: string; - /** DeployExternalDNS deploy external DNS */ - deployExternalDNS?: boolean | null; /** Array of deployments */ deployments?: DeploymentSummary[]; /** Ended timestamp */