Skip to content

Conversation

@pggb25
Copy link
Collaborator

@pggb25 pggb25 commented Dec 30, 2025

… qovery admin)

Summary

Issue:

Screenshots / Recordings

Testing

  • Changes tested locally in the relevant Console's pages and Storybooks
  • yarn test or yarn test -u (if you need to regenerate snapshots)
  • yarn format
  • yarn lint

PR Checklist

  • I followed naming, styling, and TypeScript rules (see .cursor/rules)
  • I performed a self-review (diff inspected, dead code removed)
  • I titled the PR using Conventional Commits with a scope when possible (e.g. feat(service): add new Terraform service) - required for semantic-release
  • I only kept necessary comments, written in English (watch for useless AI comments)
  • I involved a designer to validate UI changes if I am not a designer
  • I covered new business logic with tests (unit)
  • I confirmed CI is green (Codecov red can be accepted)
  • I reviewed and executed locally any AI-assisted code

@RemiBonnet
Copy link
Member

Qovery Preview

Qovery can create a Preview Environment for this PR.
To trigger its creation, please post a comment with one of the following command.

Command Blueprint environment
/qovery preview cc1de7de-94e5-40f8-8e45-bc8986d9dfec storybook
/qovery preview 28c47145-c8e7-4b9d-8d9e-c65c95b48425 staging
/qovery preview {all|UUID1,UUID2,...} To preview multiple environments

This comment has been generated from Qovery AI 🤖.
Below, a word from its wisdom :

Help yourself at 2AM by putting some metrics to help observability

@codecov
Copy link

codecov bot commented Dec 31, 2025

Codecov Report

❌ Patch coverage is 33.22148% with 199 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.58%. Comparing base (8145d6f) to head (ca8c872).
⚠️ Report is 2 commits behind head on staging.

Files with missing lines Patch % Lines
...ources-feature/page-settings-resources-feature.tsx 11.42% 24 Missing and 7 partials ⚠️
...re/src/lib/keda/components/keda-scalers-fields.tsx 0.00% 28 Missing ⚠️
...tings-resources/application-settings-resources.tsx 40.42% 19 Missing and 9 partials ⚠️
...src/lib/keda/components/instances-range-inputs.tsx 33.33% 18 Missing and 4 partials ⚠️
...keda/scaled-object-status/scaled-object-status.tsx 0.00% 22 Missing ⚠️
...ture/src/lib/keda/components/hpa-metric-fields.tsx 0.00% 19 Missing ⚠️
...ib/keda/autoscaling-payload/autoscaling-payload.ts 65.38% 2 Missing and 16 partials ⚠️
...ture/step-summary-feature/step-summary-feature.tsx 5.88% 14 Missing and 2 partials ⚠️
...age-settings-resources/page-settings-resources.tsx 40.00% 2 Missing and 4 partials ⚠️
.../feature/src/lib/keda/components/keda-settings.tsx 0.00% 2 Missing ⚠️
... and 4 more
Additional details and impacted files
@@             Coverage Diff             @@
##           staging    #2265      +/-   ##
===========================================
+ Coverage    47.45%   47.58%   +0.13%     
===========================================
  Files         1249     1260      +11     
  Lines        22896    22967      +71     
  Branches      6703     6751      +48     
===========================================
+ Hits         10865    10929      +64     
+ Misses        9956     9937      -19     
- Partials      2075     2101      +26     
Flag Coverage Δ
unittests 47.58% <33.22%> (+0.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pggb25 pggb25 force-pushed the feat/keda-cluster branch 10 times, most recently from 041a81e to aed396c Compare January 7, 2026 08:29
@pggb25 pggb25 force-pushed the feat/keda-cluster branch 7 times, most recently from bf0d6ba to 9d0dfd3 Compare January 14, 2026 16:54
Copy link
Member

@RemiBonnet RemiBonnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Pierre 🙏

I added a few comments, but I think it would be better if I rewrite this part
The logic feels too complex for what are just small settings, and it currently affects some sensitive parts of the codebase. I think this logic should be isolated, as it is now, it’s hard to maintain and risky. Let’s talk about it tomorrow!

if (onChange) onChange(e)
setCurrentValue(e.currentTarget.value)
}}
onKeyDown={(e) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can't change UI component need to remove it

* sanitizeKubernetesName('app__with--special!!!chars') // 'app-with-special-chars'
* sanitizeKubernetesName('-leading-and-trailing-') // 'leading-and-trailing'
*/
export function sanitizeKubernetesName(name: string): string {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not used ?

autoscaling_scaler_type: __,
autoscaling_polling_interval: ___,
autoscaling_cooldown_period: ____,
scalers: _____,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to remove the fields field below?

min_running_instances: number
max_running_instances: number

// Autoscaling mode selection
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have an specific interface for keda and extends this one? (you can probably extends from the api doc)

</Section>

{!['JOB', 'TERRAFORM'].includes(service?.serviceType || '') && displayInstanceLimits && (
<Section className="gap-4">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For all "keda" part we need to have an field KedaSettings inside the domain services

payload,
},
{
onSuccess: () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to have an try catch instead of add it inside the onSuccess


editAdvancedSettings({
serviceId: service.id,
payload: advancedPayload as any,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't have any type


// HPA fields
hpa_metric_type: (() => {
const settings = advancedSettings as Record<string, any> | undefined
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't use any

return 'CPU'
})(),
hpa_cpu_average_utilization_percent: (() => {
const settings = advancedSettings as Record<string, any> | undefined
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't use any

return 60
})(),
hpa_memory_average_utilization_percent: (() => {
const settings = advancedSettings as Record<string, any> | undefined
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't use any

@pggb25 pggb25 force-pushed the feat/keda-cluster branch from 9d0dfd3 to 1f8d71f Compare January 15, 2026 16:40
@pggb25 pggb25 force-pushed the feat/keda-cluster branch 5 times, most recently from c84918e to 48658e9 Compare January 16, 2026 11:00
@pggb25 pggb25 force-pushed the feat/keda-cluster branch 6 times, most recently from f4af56a to b6ef302 Compare January 16, 2026 11:52
@pggb25 pggb25 force-pushed the feat/keda-cluster branch from b6ef302 to ce41f2a Compare January 16, 2026 11:54
@pggb25 pggb25 force-pushed the feat/keda-cluster branch from c03a9b5 to 7195bf1 Compare January 16, 2026 12:22
Copy link
Member

@RemiBonnet RemiBonnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Pierre!

I added few comments and if you can all new files inside console-shared should be in your folder keda same for new files inside the util-services 🙏

@@ -0,0 +1,88 @@
import type { ScaledObjectStatusDto } from 'qovery-ws-typescript-axios/dist/api'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add an folder keda and add files associated inside ?

  • keda
    - scaled-object-status/scaled-object-status
    - keda-settings/keda-settings
    - autoscaling-payload/autoscaling-payload

@@ -0,0 +1,88 @@
import type { ScaledObjectStatusDto } from 'qovery-ws-typescript-axios/dist/api'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import type { ScaledObjectStatusDto } from 'qovery-ws-typescript-axios/dist/api'
import type { ScaledObjectStatusDto } from 'qovery-ws-typescript-axios'

import { isHelmGitSource, isHelmRepositorySource, isJobContainerSource, isJobGitSource } from '@qovery/shared/enums'
import { type ApplicationGeneralData, type JobGeneralData } from '@qovery/shared/interfaces'
import { joinArgsWithQuotes, parseCmd } from '@qovery/shared/util-js'
import { convertAutoscalingResponseToRequest } from '@qovery/shared/util-services'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment below. It would be better to add it directly inside the keda folder.

Keeping a dedicated keda folder makes sense because we’re not sure about the future of this feature, the design may change, so having the file in a single place is safer and easier to maintain

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

extractAndProcessAutoscaling,
} from './autoscaling-payload'

type TestAutoscalingRequest = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can't have a type here, should be import from the .ts and not the spec

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

const gpu = Number(resourcesData['gpu'])
const variableImportRequest = prepareVariableImportRequest(variablesData)

// Parse KEDA autoscaling if autoscaling mode is KEDA (or legacy autoscaling_enabled for backward compatibility)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you create an util in the folder keda of your domain?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

],
}

const result = convertAutoscalingResponseToRequest(response as any)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to remove all as any in your PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

})

it('should use default values for KEDA when not provided', () => {
const formData: any = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to remove all any in your PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

runningPods?: number
}

export function KedaSettings({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

console-shared will be deprecated so you need to add KedaSettings in a folder keda in the services. See the comment below !

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

<div className="mb-5">
<label className="mb-3 block text-sm font-medium text-neutral-400">Autoscaling metric</label>
<div className="flex flex-col gap-3">
<InputRadio
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This component InputRadio is deprecated you need to use RadioGroup

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants