Skip to content

feat(eks-anywhere): add update at specif version for an EKSA cluster#2571

Merged
RemiBonnet merged 5 commits intonew-navigationfrom
feat/powens-eks-anywhere
Apr 8, 2026
Merged

feat(eks-anywhere): add update at specif version for an EKSA cluster#2571
RemiBonnet merged 5 commits intonew-navigationfrom
feat/powens-eks-anywhere

Conversation

@pggb25
Copy link
Copy Markdown
Collaborator

@pggb25 pggb25 commented Apr 2, 2026

Summary

Can be tested here: http://localhost:4200/organization/148bff50-453d-4111-8353-915bd6ec08b3/cluster/eb77465e-a1b2-4c62-aa1c-89db4cac8bc3/overview

Only EKS anywhere cluster should be impacted

Screenshot 2026-04-03 at 13 10 08 Screenshot 2026-04-03 at 13 10 15

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
Copy Markdown
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 28c47145-c8e7-4b9d-8d9e-c65c95b48425 staging
/qovery preview d8a1b661-72ac-4c66-97c9-89bc61392356 test-prod-clone-prod
/qovery preview 8ba67a97-56f5-4655-9090-f29ba94c581f test-prod-clone
/qovery preview 964984c5-fba6-4371-88d3-a5daf99642ab test-prod
/qovery preview cc1de7de-94e5-40f8-8e45-bc8986d9dfec storybook
/qovery preview {all|UUID1,UUID2,...} To preview multiple environments

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

Don’t Sacrifice Readability, you are going to debug it in 6 months

@pggb25 pggb25 changed the base branch from staging to new-navigation April 2, 2026 15:44
@pggb25 pggb25 force-pushed the feat/powens-eks-anywhere branch 3 times, most recently from 409af52 to 8710520 Compare April 3, 2026 09:56
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 3, 2026

Codecov Report

❌ Patch coverage is 16.90141% with 59 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.53%. Comparing base (751939f) to head (550058f).
⚠️ Report is 2 commits behind head on new-navigation.

Files with missing lines Patch % Lines
...uster-actions/select-eks-anywhere-commit-modal.tsx 0.00% 39 Missing ⚠️
...eature/src/lib/cluster-actions/cluster-actions.tsx 45.00% 10 Missing and 1 partial ⚠️
...-anywhere-commit/use-update-eks-anywhere-commit.ts 33.33% 6 Missing ⚠️
...e-eks-anywhere-commits/use-eks-anywhere-commits.ts 0.00% 3 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                 @@
##           new-navigation    #2571      +/-   ##
==================================================
- Coverage           45.85%   45.53%   -0.32%     
==================================================
  Files                1125      769     -356     
  Lines               22841    18040    -4801     
  Branches             6686     5339    -1347     
==================================================
- Hits                10474     8215    -2259     
+ Misses              10458     8337    -2121     
+ Partials             1909     1488     -421     
Flag Coverage Δ
unittests 45.53% <16.90%> (-0.32%) ⬇️

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.

Comment thread package.json Outdated
"monaco-editor": "0.53.0",
"posthog-js": "1.260.1",
"qovery-typescript-axios": "1.1.851",
"qovery-typescript-axios": "^1.1.853",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@pggb25 The version needs to be a fixed number. Please get rid of the ^ symbol 🙏

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I do this command: yarn up qovery-typescript-axios
do you have another command to avoid this ^

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

const [isGitEditing, setIsGitEditing] = useState(false)
const currentGitRepository = cluster?.infrastructure_charts_parameters?.eks_anywhere_parameters?.git_repository
const currentRepository = getEksAnywhereGitFormValues(cluster).repository
const hasConfiguredInfrastructureChartsSource = Boolean(currentGitRepository?.url && currentRepository)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you memoize this variable?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

Comment on lines +60 to +73
const filterCommits: Record<string, Commit[]> = Object.fromEntries(
Object.entries(commitsByDay)
.map(([date, commitsForDate]) => {
return [
date,
commitsForDate.filter(
(commit) =>
commit.message.toLowerCase().includes(search.toLowerCase()) ||
commit.git_commit_id.toLowerCase().includes(search.toLowerCase())
),
]
})
.filter(([, commitsForDate]) => commitsForDate.length)
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you memoize this ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

Comment on lines +74 to +76
const hasSelectedCommitInResults = Object.values(filterCommits).some((commitsForDate) =>
commitsForDate.some((commit) => commit.git_commit_id === targetCommitId)
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you memoize this as well?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

Comment on lines +190 to +192
isEksAnywhereCluster &&
hasEksAnywhereGitRepository &&
(isDeployAvailable(clusterStatus.status) || isRedeployAvailable(clusterStatus.status)) && (
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please extract this condition into a memoized variable at the top of the component's function 🙏

Copy link
Copy Markdown
Collaborator Author

@pggb25 pggb25 Apr 3, 2026

Choose a reason for hiding this comment

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

I factorize but didn"t use memo because adding a hook here actually led to a hooks-order issue during deployment state transitions

Comment on lines +183 to +185
typeof clusterApiWithFallback.updateEksAnywhereCommit === 'function'
? await clusterApiWithFallback.updateEksAnywhereCommit(organizationId, clusterId, { commit_id: commitId })
: await clusterApiWithFallback.axios.put<EksAnywhereCommitResponse>(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should be extracted to a variable to improve readability

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

Comment on lines +51 to +54
const response =
typeof clusterApiWithFallback.listEksAnywhereCommits === 'function'
? await clusterApiWithFallback.listEksAnywhereCommits(organizationId, clusterId)
: await clusterApiWithFallback.axios.get<CommitResponseList>(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should be extracted to a variable to improve readability

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

const currentGitRepository = cluster?.infrastructure_charts_parameters?.eks_anywhere_parameters?.git_repository
const currentRepository = getEksAnywhereGitFormValues(cluster).repository
const hasConfiguredInfrastructureChartsSource = Boolean(currentGitRepository?.url && currentRepository)
const gitDisabled = hasConfiguredInfrastructureChartsSource && !isGitEditing
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you memoize this?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

@pggb25 pggb25 force-pushed the feat/powens-eks-anywhere branch from 88cb145 to a8f1a21 Compare April 3, 2026 15:07
const getEksAnywhereCommitsPath = (organizationId: string, clusterId: string) =>
`${getClusterApiBasePath()}/organization/${encodeURIComponent(organizationId)}/cluster/${encodeURIComponent(clusterId)}/eks-anywhere/commits`
const getEksAnywhereCommitPath = (organizationId: string, clusterId: string) =>
`${getClusterApiBasePath()}/organization/${encodeURIComponent(organizationId)}/cluster/${encodeURIComponent(clusterId)}/eks-anywhere/commit`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you use the axios package please?

})
}
const mutationUpdateEksAnywhereVersion = () => {
queryClient.removeQueries({
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this one isn't necessary or you need to do it inside the hook with the onSuccess of your mutation

enabled?: boolean
}

export function useEksAnywhereCommits(props: UseEksAnywhereCommitsProps) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
export function useEksAnywhereCommits(props: UseEksAnywhereCommitsProps) {
export function useEksAnywhereCommits({ enabled = true, organizationId, clusterId }: UseEksAnywhereCommitsProps) {

}

export function useEksAnywhereCommits(props: UseEksAnywhereCommitsProps) {
const { enabled = true, organizationId, clusterId } = props
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
const { enabled = true, organizationId, clusterId } = props

@pggb25 pggb25 force-pushed the feat/powens-eks-anywhere branch 6 times, most recently from 7b27d19 to b6387d2 Compare April 7, 2026 11:58
@pggb25 pggb25 added the V5 label Apr 7, 2026
@pggb25 pggb25 force-pushed the feat/powens-eks-anywhere branch from b6387d2 to 15667b3 Compare April 7, 2026 15:25
@pggb25 pggb25 force-pushed the feat/powens-eks-anywhere branch from 15667b3 to 550058f Compare April 8, 2026 11:29
@RemiBonnet RemiBonnet merged commit 5d43cb4 into new-navigation Apr 8, 2026
11 checks passed
@RemiBonnet RemiBonnet deleted the feat/powens-eks-anywhere branch April 8, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants