From 6b504a229d61073d538b1d7526737902e4c4d118 Mon Sep 17 00:00:00 2001 From: Fabien FLEUREAU Date: Tue, 27 Jan 2026 14:40:07 +0100 Subject: [PATCH 1/2] feat(services): add git webhook status badge QOV-1504 QOV-1499 --- .../src/lib/domains-services-data-access.ts | 17 ++ libs/domains/services/feature/src/index.ts | 4 + .../auto-deploy-section.spec.tsx | 145 ++++++++++++++++++ .../auto-deploy-section.tsx | 49 ++++++ .../src/lib/auto-deploy-section/index.ts | 1 + .../git-webhook-status-badge.spec.tsx | 124 +++++++++++++++ .../git-webhook-status-badge.tsx | 85 ++++++++++ .../use-git-webhook-status.spec.tsx | 33 ++++ .../use-git-webhook-status.ts | 19 +++ .../use-sync-git-webhook.ts | 27 ++++ .../page-settings-general.tsx | 21 +-- package.json | 2 +- yarn.lock | 10 +- 13 files changed, 522 insertions(+), 15 deletions(-) create mode 100644 libs/domains/services/feature/src/lib/auto-deploy-section/auto-deploy-section.spec.tsx create mode 100644 libs/domains/services/feature/src/lib/auto-deploy-section/auto-deploy-section.tsx create mode 100644 libs/domains/services/feature/src/lib/auto-deploy-section/index.ts create mode 100644 libs/domains/services/feature/src/lib/git-webhook-status-badge/git-webhook-status-badge.spec.tsx create mode 100644 libs/domains/services/feature/src/lib/git-webhook-status-badge/git-webhook-status-badge.tsx create mode 100644 libs/domains/services/feature/src/lib/hooks/use-git-webhook-status/use-git-webhook-status.spec.tsx create mode 100644 libs/domains/services/feature/src/lib/hooks/use-git-webhook-status/use-git-webhook-status.ts create mode 100644 libs/domains/services/feature/src/lib/hooks/use-sync-git-webhook/use-sync-git-webhook.ts diff --git a/libs/domains/services/data-access/src/lib/domains-services-data-access.ts b/libs/domains/services/data-access/src/lib/domains-services-data-access.ts index 7003afbdc5d..50436d61994 100644 --- a/libs/domains/services/data-access/src/lib/domains-services-data-access.ts +++ b/libs/domains/services/data-access/src/lib/domains-services-data-access.ts @@ -35,6 +35,7 @@ import { EnvironmentActionsApi, EnvironmentMainCallsApi, type EnvironmentServiceIdsAllRequest, + type GitWebhookStatusResponse, HelmActionsApi, type HelmAdvancedSettings, HelmConfigurationApi, @@ -58,6 +59,7 @@ import { type JobRequest, JobsApi, type RebootServicesRequest, + ServiceMainCallsApi, type Status, TerraformActionsApi, type TerraformAdvancedSettings, @@ -136,6 +138,8 @@ const customDomainHelmApi = new HelmCustomDomainApi() const deploymentQueueActionsApi = new DeploymentQueueActionsApi() +const serviceMainCallsApi = new ServiceMainCallsApi() + // Prefer this type in param instead of ServiceTypeEnum // to suppport string AND enum as param. // ServiceTypeEnum still exist mainly for compatibility reason (to use redux and react-query fetched services in data-access). @@ -600,8 +604,17 @@ export const services = createQueryKeys('services', { return response.data.results }, }), + gitWebhookStatus: (serviceId: string) => ({ + queryKey: [serviceId], + async queryFn() { + const response = await serviceMainCallsApi.getServiceGitWebhookStatus(serviceId) + return response.data + }, + }), }) +export type { GitWebhookStatusResponse } + type CloneServiceRequest = { serviceId: string serviceType: ServiceType @@ -1240,6 +1253,10 @@ export const mutations = { const response = await environmentActionApi.cleanFailedJobs(environmentId, payload) return response.data }, + async syncGitWebhook({ serviceId }: { serviceId: string }) { + const response = await serviceMainCallsApi.syncServiceGitWebhook(serviceId) + return response.data + }, } export type ServicesKeys = inferQueryKeys diff --git a/libs/domains/services/feature/src/index.ts b/libs/domains/services/feature/src/index.ts index b9fccde3be9..d0f5c2488ca 100644 --- a/libs/domains/services/feature/src/index.ts +++ b/libs/domains/services/feature/src/index.ts @@ -1,4 +1,8 @@ export * from './lib/auto-deploy-setting/auto-deploy-setting' +export * from './lib/auto-deploy-section' +export * from './lib/git-webhook-status-badge/git-webhook-status-badge' +export * from './lib/hooks/use-git-webhook-status/use-git-webhook-status' +export * from './lib/hooks/use-sync-git-webhook/use-sync-git-webhook' export * from './lib/advanced-settings/advanced-settings' export * from './lib/general-setting/general-setting' export * from './lib/build-settings/build-settings' diff --git a/libs/domains/services/feature/src/lib/auto-deploy-section/auto-deploy-section.spec.tsx b/libs/domains/services/feature/src/lib/auto-deploy-section/auto-deploy-section.spec.tsx new file mode 100644 index 00000000000..16d379e8b1c --- /dev/null +++ b/libs/domains/services/feature/src/lib/auto-deploy-section/auto-deploy-section.spec.tsx @@ -0,0 +1,145 @@ +import { wrapWithReactHookForm } from '__tests__/utils/wrap-with-react-hook-form' +import { renderWithProviders, screen } from '@qovery/shared/util-tests' +import { useGitWebhookStatus } from '../hooks/use-git-webhook-status/use-git-webhook-status' +import { useSyncGitWebhook } from '../hooks/use-sync-git-webhook/use-sync-git-webhook' +import { AutoDeploySection } from './auto-deploy-section' + +jest.mock('../hooks/use-git-webhook-status/use-git-webhook-status') +jest.mock('../hooks/use-sync-git-webhook/use-sync-git-webhook') +jest.mock('../auto-deploy-setting/auto-deploy-setting', () => ({ + AutoDeploySetting: () =>
AutoDeploySetting
, +})) +jest.mock('../git-webhook-status-badge/git-webhook-status-badge', () => ({ + GitWebhookStatusBadge: () =>
WebhookStatusBadge
, +})) + +const mockUseGitWebhookStatus = useGitWebhookStatus as jest.MockedFunction +const mockUseSyncGitWebhook = useSyncGitWebhook as jest.MockedFunction + +describe('AutoDeploySection', () => { + const mockMutate = jest.fn() + + beforeEach(() => { + jest.clearAllMocks() + mockUseSyncGitWebhook.mockReturnValue({ + mutate: mockMutate, + isLoading: false, + } as unknown as ReturnType) + mockUseGitWebhookStatus.mockReturnValue({ + data: { status: 'ACTIVE' }, + isLoading: false, + isError: false, + refetch: jest.fn(), + } as ReturnType) + }) + + it('renders auto-deploy setting', () => { + renderWithProviders( + wrapWithReactHookForm(, { + defaultValues: { auto_deploy: true }, + }) + ) + + expect(screen.getByTestId('auto-deploy-setting')).toBeInTheDocument() + }) + + it('shows webhook section when auto-deploy is enabled and source is GIT', () => { + renderWithProviders( + wrapWithReactHookForm(, { + defaultValues: { auto_deploy: true }, + }) + ) + + expect(screen.getByTestId('webhook-status-badge')).toBeInTheDocument() + }) + + it('hides webhook section when auto-deploy is disabled', () => { + renderWithProviders( + wrapWithReactHookForm(, { + defaultValues: { auto_deploy: false }, + }) + ) + + expect(screen.queryByTestId('webhook-status-badge')).not.toBeInTheDocument() + }) + + it('hides webhook section for CONTAINER_REGISTRY source', () => { + renderWithProviders( + wrapWithReactHookForm(, { + defaultValues: { auto_deploy: true }, + }) + ) + + expect(screen.queryByTestId('webhook-status-badge')).not.toBeInTheDocument() + }) + + it('shows "Update Webhook" button when webhook status is NOT_CONFIGURED', () => { + mockUseGitWebhookStatus.mockReturnValue({ + data: { status: 'NOT_CONFIGURED' }, + isLoading: false, + isError: false, + refetch: jest.fn(), + } as ReturnType) + + renderWithProviders( + wrapWithReactHookForm(, { + defaultValues: { auto_deploy: true }, + }) + ) + + expect(screen.getByRole('button', { name: /update webhook/i })).toBeInTheDocument() + }) + + it('shows "Update Webhook" button when webhook status is MISCONFIGURED', () => { + mockUseGitWebhookStatus.mockReturnValue({ + data: { status: 'MISCONFIGURED' }, + isLoading: false, + isError: false, + refetch: jest.fn(), + } as ReturnType) + + renderWithProviders( + wrapWithReactHookForm(, { + defaultValues: { auto_deploy: true }, + }) + ) + + expect(screen.getByRole('button', { name: /update webhook/i })).toBeInTheDocument() + }) + + it('hides "Update Webhook" button when webhook status is ACTIVE', () => { + mockUseGitWebhookStatus.mockReturnValue({ + data: { status: 'ACTIVE' }, + isLoading: false, + isError: false, + refetch: jest.fn(), + } as ReturnType) + + renderWithProviders( + wrapWithReactHookForm(, { + defaultValues: { auto_deploy: true }, + }) + ) + + expect(screen.queryByRole('button', { name: /update webhook/i })).not.toBeInTheDocument() + }) + + it('calls syncWebhook when clicking "Update Webhook" button', async () => { + mockUseGitWebhookStatus.mockReturnValue({ + data: { status: 'NOT_CONFIGURED' }, + isLoading: false, + isError: false, + refetch: jest.fn(), + } as ReturnType) + + const { userEvent } = renderWithProviders( + wrapWithReactHookForm(, { + defaultValues: { auto_deploy: true }, + }) + ) + + await userEvent.click(screen.getByRole('button', { name: /update webhook/i })) + + expect(mockMutate).toHaveBeenCalled() + }) +}) diff --git a/libs/domains/services/feature/src/lib/auto-deploy-section/auto-deploy-section.tsx b/libs/domains/services/feature/src/lib/auto-deploy-section/auto-deploy-section.tsx new file mode 100644 index 00000000000..f234bdb7b71 --- /dev/null +++ b/libs/domains/services/feature/src/lib/auto-deploy-section/auto-deploy-section.tsx @@ -0,0 +1,49 @@ +import { useFormContext } from 'react-hook-form' +import { Button } from '@qovery/shared/ui' +import { AutoDeploySetting, type AutoDeploySettingProps } from '../auto-deploy-setting/auto-deploy-setting' +import { GitWebhookStatusBadge } from '../git-webhook-status-badge/git-webhook-status-badge' +import { useGitWebhookStatus } from '../hooks/use-git-webhook-status/use-git-webhook-status' +import { useSyncGitWebhook } from '../hooks/use-sync-git-webhook/use-sync-git-webhook' + +export interface AutoDeploySectionProps extends AutoDeploySettingProps { + serviceId: string +} + +export function AutoDeploySection({ serviceId, source, className }: AutoDeploySectionProps) { + const { watch } = useFormContext() + const autoDeployEnabled = watch('auto_deploy') + const supportsWebhook = source !== 'CONTAINER_REGISTRY' + + const { data: webhookStatus } = useGitWebhookStatus({ serviceId, enabled: supportsWebhook }) + const { mutate: syncWebhook, isLoading: isSyncing } = useSyncGitWebhook({ serviceId }) + + const shouldShowWebhook = supportsWebhook && autoDeployEnabled + const showSyncButton = webhookStatus && webhookStatus.status !== 'ACTIVE' + + return ( +
+
+ +
+ {shouldShowWebhook && ( +
+ + {showSyncButton && ( + + )} +
+ )} +
+ ) +} + +export default AutoDeploySection diff --git a/libs/domains/services/feature/src/lib/auto-deploy-section/index.ts b/libs/domains/services/feature/src/lib/auto-deploy-section/index.ts new file mode 100644 index 00000000000..e1a622d5f17 --- /dev/null +++ b/libs/domains/services/feature/src/lib/auto-deploy-section/index.ts @@ -0,0 +1 @@ +export * from './auto-deploy-section' diff --git a/libs/domains/services/feature/src/lib/git-webhook-status-badge/git-webhook-status-badge.spec.tsx b/libs/domains/services/feature/src/lib/git-webhook-status-badge/git-webhook-status-badge.spec.tsx new file mode 100644 index 00000000000..f639e5e2dcf --- /dev/null +++ b/libs/domains/services/feature/src/lib/git-webhook-status-badge/git-webhook-status-badge.spec.tsx @@ -0,0 +1,124 @@ +import { renderWithProviders, screen } from '@qovery/shared/util-tests' +import { useGitWebhookStatus } from '../hooks/use-git-webhook-status/use-git-webhook-status' +import { GitWebhookStatusBadge } from './git-webhook-status-badge' + +jest.mock('../hooks/use-git-webhook-status/use-git-webhook-status') + +const mockUseGitWebhookStatus = useGitWebhookStatus as jest.MockedFunction + +describe('GitWebhookStatusBadge', () => { + const mockRefetch = jest.fn() + + beforeEach(() => { + jest.clearAllMocks() + }) + + it('shows loading state with "Checking..." badge', () => { + mockUseGitWebhookStatus.mockReturnValue({ + data: undefined, + isLoading: true, + isError: false, + refetch: mockRefetch, + } as ReturnType) + + renderWithProviders() + + expect(screen.getByText('Checking...')).toBeInTheDocument() + }) + + it('shows error state with error badge', () => { + mockUseGitWebhookStatus.mockReturnValue({ + data: undefined, + isLoading: false, + isError: true, + refetch: mockRefetch, + } as ReturnType) + + renderWithProviders() + + expect(screen.getByText('Error')).toBeInTheDocument() + expect(screen.getByRole('button')).toBeInTheDocument() + }) + + it('calls refetch when clicking error retry button', async () => { + mockUseGitWebhookStatus.mockReturnValue({ + data: undefined, + isLoading: false, + isError: true, + refetch: mockRefetch, + } as ReturnType) + + const { userEvent } = renderWithProviders() + + await userEvent.click(screen.getByRole('button')) + + expect(mockRefetch).toHaveBeenCalled() + }) + + it('shows green "Working" badge for ACTIVE status', () => { + mockUseGitWebhookStatus.mockReturnValue({ + data: { status: 'ACTIVE' }, + isLoading: false, + isError: false, + refetch: mockRefetch, + } as ReturnType) + + renderWithProviders() + + expect(screen.getByText('Working')).toBeInTheDocument() + }) + + it('shows red "Not Configured" badge for NOT_CONFIGURED status', () => { + mockUseGitWebhookStatus.mockReturnValue({ + data: { status: 'NOT_CONFIGURED' }, + isLoading: false, + isError: false, + refetch: mockRefetch, + } as ReturnType) + + renderWithProviders() + + expect(screen.getByText('Not Configured')).toBeInTheDocument() + }) + + it('shows yellow "Misconfigured" badge for MISCONFIGURED status', () => { + mockUseGitWebhookStatus.mockReturnValue({ + data: { status: 'MISCONFIGURED', missing_events: ['push', 'pull_request'] }, + isLoading: false, + isError: false, + refetch: mockRefetch, + } as ReturnType) + + renderWithProviders() + + expect(screen.getByText('Misconfigured')).toBeInTheDocument() + }) + + it('shows neutral "Unable to Verify" badge for UNABLE_TO_VERIFY status', () => { + mockUseGitWebhookStatus.mockReturnValue({ + data: { status: 'UNABLE_TO_VERIFY' }, + isLoading: false, + isError: false, + refetch: mockRefetch, + } as ReturnType) + + renderWithProviders() + + expect(screen.getByText('Unable to Verify')).toBeInTheDocument() + }) + + it('has tooltip present for status badge', async () => { + mockUseGitWebhookStatus.mockReturnValue({ + data: { status: 'ACTIVE' }, + isLoading: false, + isError: false, + refetch: mockRefetch, + } as ReturnType) + + const { userEvent } = renderWithProviders() + + await userEvent.hover(screen.getByText('Working')) + + expect(await screen.findByRole('tooltip')).toBeInTheDocument() + }) +}) diff --git a/libs/domains/services/feature/src/lib/git-webhook-status-badge/git-webhook-status-badge.tsx b/libs/domains/services/feature/src/lib/git-webhook-status-badge/git-webhook-status-badge.tsx new file mode 100644 index 00000000000..8a647af3496 --- /dev/null +++ b/libs/domains/services/feature/src/lib/git-webhook-status-badge/git-webhook-status-badge.tsx @@ -0,0 +1,85 @@ +import { type IconName } from '@fortawesome/fontawesome-common-types' +import { type GitWebhookStatusResponse } from '@qovery/domains/services/data-access' +import { Badge, Icon, LoaderSpinner, Tooltip } from '@qovery/shared/ui' +import { useGitWebhookStatus } from '../hooks/use-git-webhook-status/use-git-webhook-status' + +export interface GitWebhookStatusBadgeProps { + serviceId: string +} + +const statusConfig: Record< + GitWebhookStatusResponse['status'], + { + color: 'green' | 'yellow' | 'red' | 'neutral' + icon: IconName + label: string + tooltip: string + } +> = { + ACTIVE: { + color: 'green', + icon: 'check', + label: 'Working', + tooltip: 'Webhook is correctly configured. Auto-deploy will trigger on git events.', + }, + NOT_CONFIGURED: { + color: 'red', + icon: 'circle-question', + label: 'Not Configured', + tooltip: 'No webhook found for auto-deployment. Use the Update Webhook button to configure it automatically.', + }, + MISCONFIGURED: { + color: 'yellow', + icon: 'triangle-exclamation', + label: 'Misconfigured', + tooltip: 'Webhook is missing required events. Use the Update Webhook button to fix it automatically.', + }, + UNABLE_TO_VERIFY: { + color: 'neutral', + icon: 'circle-exclamation', + label: 'Unable to Verify', + tooltip: + "Couldn't verify webhook status. This could be due to expired credentials, insufficient permissions, or git provider API unavailability.", + }, +} + +export function GitWebhookStatusBadge({ serviceId }: GitWebhookStatusBadgeProps) { + const { data, isLoading, isError, refetch } = useGitWebhookStatus({ serviceId }) + + if (isLoading) { + return ( + + + Checking... + + ) + } + + if (isError || !data) { + return ( + + + + ) + } + + const config = statusConfig[data.status] + + return ( + + + + + {config.label} + + + + ) +} + +export default GitWebhookStatusBadge diff --git a/libs/domains/services/feature/src/lib/hooks/use-git-webhook-status/use-git-webhook-status.spec.tsx b/libs/domains/services/feature/src/lib/hooks/use-git-webhook-status/use-git-webhook-status.spec.tsx new file mode 100644 index 00000000000..64e2048f53b --- /dev/null +++ b/libs/domains/services/feature/src/lib/hooks/use-git-webhook-status/use-git-webhook-status.spec.tsx @@ -0,0 +1,33 @@ +import { QueryClient, QueryClientProvider } from '@tanstack/react-query' +import { type PropsWithChildren } from 'react' +import { renderHook } from '@qovery/shared/util-tests' +import { queries } from '@qovery/state/util-queries' +import { useGitWebhookStatus } from './use-git-webhook-status' + +const createWrapper = () => { + const queryClient = new QueryClient({ + defaultOptions: { + queries: { + retry: false, + }, + }, + }) + return ({ children }: PropsWithChildren) => {children} +} + +describe('useGitWebhookStatus', () => { + it('returns query with correct key for serviceId', () => { + const queryConfig = queries.services.gitWebhookStatus('service-123') + + expect(queryConfig.queryKey).toContain('service-123') + }) + + it('returns query result when called with serviceId', () => { + const { result } = renderHook(() => useGitWebhookStatus({ serviceId: 'service-123' }), { + wrapper: createWrapper(), + }) + + expect(result.current).toBeDefined() + expect(result.current.isLoading).toBeDefined() + }) +}) diff --git a/libs/domains/services/feature/src/lib/hooks/use-git-webhook-status/use-git-webhook-status.ts b/libs/domains/services/feature/src/lib/hooks/use-git-webhook-status/use-git-webhook-status.ts new file mode 100644 index 00000000000..54ce90893c1 --- /dev/null +++ b/libs/domains/services/feature/src/lib/hooks/use-git-webhook-status/use-git-webhook-status.ts @@ -0,0 +1,19 @@ +import { useQuery } from '@tanstack/react-query' +import { queries } from '@qovery/state/util-queries' + +export interface UseGitWebhookStatusProps { + serviceId: string + enabled?: boolean +} + +export function useGitWebhookStatus({ serviceId, enabled = true }: UseGitWebhookStatusProps) { + return useQuery({ + ...queries.services.gitWebhookStatus(serviceId), + enabled: Boolean(serviceId) && enabled, + staleTime: Infinity, + refetchOnWindowFocus: false, + retry: false, + }) +} + +export default useGitWebhookStatus diff --git a/libs/domains/services/feature/src/lib/hooks/use-sync-git-webhook/use-sync-git-webhook.ts b/libs/domains/services/feature/src/lib/hooks/use-sync-git-webhook/use-sync-git-webhook.ts new file mode 100644 index 00000000000..7ed49c34e56 --- /dev/null +++ b/libs/domains/services/feature/src/lib/hooks/use-sync-git-webhook/use-sync-git-webhook.ts @@ -0,0 +1,27 @@ +import { useMutation, useQueryClient } from '@tanstack/react-query' +import { mutations } from '@qovery/domains/services/data-access' +import { toast } from '@qovery/shared/ui' +import { queries } from '@qovery/state/util-queries' + +export interface UseSyncGitWebhookProps { + serviceId: string +} + +export function useSyncGitWebhook({ serviceId }: UseSyncGitWebhookProps) { + const queryClient = useQueryClient() + + return useMutation({ + mutationFn: () => mutations.syncGitWebhook({ serviceId }), + onSuccess() { + queryClient.invalidateQueries({ + queryKey: queries.services.gitWebhookStatus(serviceId).queryKey, + }) + toast('SUCCESS', 'Webhook synchronized successfully') + }, + meta: { + notifyOnError: true, + }, + }) +} + +export default useSyncGitWebhook diff --git a/libs/pages/application/src/lib/ui/page-settings-general/page-settings-general.tsx b/libs/pages/application/src/lib/ui/page-settings-general/page-settings-general.tsx index e16fdfabd19..1aedd212a66 100644 --- a/libs/pages/application/src/lib/ui/page-settings-general/page-settings-general.tsx +++ b/libs/pages/application/src/lib/ui/page-settings-general/page-settings-general.tsx @@ -5,7 +5,7 @@ import { match } from 'ts-pattern' import { AnnotationSetting, LabelSetting } from '@qovery/domains/organizations/feature' import { DeploymentSetting, SourceSetting } from '@qovery/domains/service-helm/feature' import { type AnyService } from '@qovery/domains/services/data-access' -import { AutoDeploySetting, GeneralSetting } from '@qovery/domains/services/feature' +import { AutoDeploySection, GeneralSetting } from '@qovery/domains/services/feature' import { EditGitRepositorySettingsFeature, EntrypointCmdInputs, @@ -150,7 +150,10 @@ export function PageSettingsGeneral({ {isJobGitSource(job.source) ? 'Build and deploy' : 'Deploy'} {isJobGitSource(job.source) && blockContentBuildDeploy} {job.job_type === 'CRON' && } - +
Extra labels/annotations @@ -159,7 +162,7 @@ export function PageSettingsGeneral({
)) - .with({ serviceType: 'APPLICATION' }, () => ( + .with({ serviceType: 'APPLICATION' }, (app) => ( <>
Source @@ -169,7 +172,7 @@ export function PageSettingsGeneral({ Build and deploy {blockContentBuildDeploy} {watchBuildMode === BuildModeEnum.DOCKER && } - +
Extra labels/annotations @@ -178,7 +181,7 @@ export function PageSettingsGeneral({
)) - .with({ serviceType: 'TERRAFORM' }, () => ( + .with({ serviceType: 'TERRAFORM' }, (terraform) => ( <>
Source @@ -189,7 +192,7 @@ export function PageSettingsGeneral({
Build and deploy - +
)) @@ -202,7 +205,7 @@ export function PageSettingsGeneral({
Deploy - +
Extra labels/annotations @@ -211,7 +214,7 @@ export function PageSettingsGeneral({
)) - .with({ serviceType: 'HELM' }, () => ( + .with({ serviceType: 'HELM' }, (helm) => ( <>
Source @@ -225,7 +228,7 @@ export function PageSettingsGeneral({
Deploy - {watchFieldProvider === 'GIT' && } + {watchFieldProvider === 'GIT' && } {watchFieldProvider === 'HELM_REPOSITORY' && ( diff --git a/package.json b/package.json index 55963bc2dbe..f6ed56b2c06 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "mermaid": "^11.6.0", "monaco-editor": "0.53.0", "posthog-js": "^1.260.1", - "qovery-typescript-axios": "^1.1.813", + "qovery-typescript-axios": "^1.1.814", "react": "18.3.1", "react-country-flag": "^3.0.2", "react-datepicker": "^4.12.0", diff --git a/yarn.lock b/yarn.lock index 21ee13688b3..2e8ec7c927e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5679,7 +5679,7 @@ __metadata: prettier: ^3.2.5 prettier-plugin-tailwindcss: ^0.5.14 pretty-quick: ^4.0.0 - qovery-typescript-axios: ^1.1.813 + qovery-typescript-axios: ^1.1.814 qovery-ws-typescript-axios: ^0.1.420 react: 18.3.1 react-country-flag: ^3.0.2 @@ -24520,12 +24520,12 @@ __metadata: languageName: node linkType: hard -"qovery-typescript-axios@npm:^1.1.813": - version: 1.1.813 - resolution: "qovery-typescript-axios@npm:1.1.813" +"qovery-typescript-axios@npm:^1.1.814": + version: 1.1.814 + resolution: "qovery-typescript-axios@npm:1.1.814" dependencies: axios: 1.12.2 - checksum: f77c90f01c1db75b98da62a0bf35897d80e6a223bc36eb19e0a56653b1373ca480f557f1fa3ffc04f79bc5143fb521c81e5657c392c0763bf44590ce8f3f047f + checksum: f7ad5bb89dab893a06efaafa9b8570ff6f5a1589e4e774d2ddb2e5fced09ad6b3aa3fac24b1ae117ec8db2efd5875efc431a65683bc54f4d5dc054dfc61376c2 languageName: node linkType: hard From 86f3384098ab6ae0207eea3bc35896ebbbd8839e Mon Sep 17 00:00:00 2001 From: Fabien FLEUREAU Date: Tue, 27 Jan 2026 16:48:06 +0100 Subject: [PATCH 2/2] refactor(services): clean imports a --- .../data-access/src/lib/domains-services-data-access.ts | 3 --- libs/domains/services/feature/src/index.ts | 2 +- .../services/feature/src/lib/auto-deploy-section/index.ts | 1 - .../lib/git-webhook-status-badge/git-webhook-status-badge.tsx | 2 +- .../lib/ui/page-settings-general/page-settings-general.tsx | 4 ++-- 5 files changed, 4 insertions(+), 8 deletions(-) delete mode 100644 libs/domains/services/feature/src/lib/auto-deploy-section/index.ts diff --git a/libs/domains/services/data-access/src/lib/domains-services-data-access.ts b/libs/domains/services/data-access/src/lib/domains-services-data-access.ts index 50436d61994..cc2dd9a47bf 100644 --- a/libs/domains/services/data-access/src/lib/domains-services-data-access.ts +++ b/libs/domains/services/data-access/src/lib/domains-services-data-access.ts @@ -35,7 +35,6 @@ import { EnvironmentActionsApi, EnvironmentMainCallsApi, type EnvironmentServiceIdsAllRequest, - type GitWebhookStatusResponse, HelmActionsApi, type HelmAdvancedSettings, HelmConfigurationApi, @@ -613,8 +612,6 @@ export const services = createQueryKeys('services', { }), }) -export type { GitWebhookStatusResponse } - type CloneServiceRequest = { serviceId: string serviceType: ServiceType diff --git a/libs/domains/services/feature/src/index.ts b/libs/domains/services/feature/src/index.ts index d0f5c2488ca..815068ecfb4 100644 --- a/libs/domains/services/feature/src/index.ts +++ b/libs/domains/services/feature/src/index.ts @@ -1,5 +1,5 @@ export * from './lib/auto-deploy-setting/auto-deploy-setting' -export * from './lib/auto-deploy-section' +export * from './lib/auto-deploy-section/auto-deploy-section' export * from './lib/git-webhook-status-badge/git-webhook-status-badge' export * from './lib/hooks/use-git-webhook-status/use-git-webhook-status' export * from './lib/hooks/use-sync-git-webhook/use-sync-git-webhook' diff --git a/libs/domains/services/feature/src/lib/auto-deploy-section/index.ts b/libs/domains/services/feature/src/lib/auto-deploy-section/index.ts deleted file mode 100644 index e1a622d5f17..00000000000 --- a/libs/domains/services/feature/src/lib/auto-deploy-section/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './auto-deploy-section' diff --git a/libs/domains/services/feature/src/lib/git-webhook-status-badge/git-webhook-status-badge.tsx b/libs/domains/services/feature/src/lib/git-webhook-status-badge/git-webhook-status-badge.tsx index 8a647af3496..abd4e4c1593 100644 --- a/libs/domains/services/feature/src/lib/git-webhook-status-badge/git-webhook-status-badge.tsx +++ b/libs/domains/services/feature/src/lib/git-webhook-status-badge/git-webhook-status-badge.tsx @@ -1,5 +1,5 @@ import { type IconName } from '@fortawesome/fontawesome-common-types' -import { type GitWebhookStatusResponse } from '@qovery/domains/services/data-access' +import { type GitWebhookStatusResponse } from 'qovery-typescript-axios' import { Badge, Icon, LoaderSpinner, Tooltip } from '@qovery/shared/ui' import { useGitWebhookStatus } from '../hooks/use-git-webhook-status/use-git-webhook-status' diff --git a/libs/pages/application/src/lib/ui/page-settings-general/page-settings-general.tsx b/libs/pages/application/src/lib/ui/page-settings-general/page-settings-general.tsx index 1aedd212a66..d83b9499262 100644 --- a/libs/pages/application/src/lib/ui/page-settings-general/page-settings-general.tsx +++ b/libs/pages/application/src/lib/ui/page-settings-general/page-settings-general.tsx @@ -196,7 +196,7 @@ export function PageSettingsGeneral({
)) - .with({ serviceType: 'CONTAINER' }, () => ( + .with({ serviceType: 'CONTAINER' }, (container) => ( <>
Source @@ -205,7 +205,7 @@ export function PageSettingsGeneral({
Deploy - +
Extra labels/annotations