Skip to content

cc-addon-dashboard components: use the new client instead of hardcoded endpoints#1724

Merged
florian-sanders-cc merged 7 commits into
masterfrom
cc-addon-dashboards/use-new-client
Jun 2, 2026
Merged

cc-addon-dashboard components: use the new client instead of hardcoded endpoints#1724
florian-sanders-cc merged 7 commits into
masterfrom
cc-addon-dashboards/use-new-client

Conversation

@florian-sanders-cc
Copy link
Copy Markdown
Contributor

@florian-sanders-cc florian-sanders-cc commented Apr 16, 2026

What does this PR do?

  • Updates @clevercloud/client to 12.1.0 to benefit from the newly added Operator commands,
  • Refactors every cc-addon-*.smart component to rely on the new client as much as possible,
  • Some component could not be migrated since the client does not expose the necessary commands: kubernetes & cellar,
  • Inlines the cc-addon-header.client.js file in the only place where it's now used: cc-addon-header.smart-cellar.js.

How to review?

  • Check the commits,
  • Play with the components in demo-smart (random testing a few of them should be enough, I've run LLM with playwright-cli to test success & error cases + I've tested all success cases manually),
  • 2 reviewers should be enough for this one.

TODO

  • Merge #212 and release the client,
  • Edit the client update commit.

@florian-sanders-cc florian-sanders-cc self-assigned this Apr 16, 2026
@florian-sanders-cc florian-sanders-cc force-pushed the cc-addon-dashboards/use-new-client branch 5 times, most recently from 3753a9a to 23ae39f Compare April 16, 2026 14:36
@github-actions
Copy link
Copy Markdown
Contributor

🔎 A preview has been automatically published : https://clever-components-preview.cellar-c2.services.clever-cloud.com/cc-addon-dashboards/use-new-client/index.html.

This preview will be deleted once this PR is closed.

@florian-sanders-cc florian-sanders-cc force-pushed the cc-addon-dashboards/use-new-client branch from 23ae39f to 0d63085 Compare April 17, 2026 07:37
@florian-sanders-cc florian-sanders-cc force-pushed the cc-addon-dashboards/use-new-client branch 2 times, most recently from 822b4e7 to c1d52b5 Compare May 20, 2026 16:35
@florian-sanders-cc florian-sanders-cc force-pushed the cc-addon-dashboards/use-new-client branch from c1d52b5 to c160713 Compare May 20, 2026 16:50
@florian-sanders-cc florian-sanders-cc marked this pull request as ready for review May 20, 2026 16:51
@florian-sanders-cc florian-sanders-cc force-pushed the cc-addon-dashboards/use-new-client branch 3 times, most recently from d42a1b5 to 9ba4ead Compare May 21, 2026 08:42
Copy link
Copy Markdown
Contributor

@HeleneAmouzou HeleneAmouzou left a comment

Choose a reason for hiding this comment

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

LGTM ! 👏

Copy link
Copy Markdown
Contributor

@pdesoyres-cc pdesoyres-cc left a comment

Choose a reason for hiding this comment

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

Well done Florian. I have just questions about the use of a 1 second ttl cache. I'm wondering if it is really necessary, knowing that we have a dedup mechanism now.

Comment thread src/components/cc-addon-info/cc-addon-info.smart-pulsar.js Outdated
Comment thread src/components/cc-addon-info/cc-addon-info.smart-otoroshi.js Outdated
Comment thread src/components/cc-addon-info/cc-addon-info.smart-metabase.js Outdated
Comment thread src/components/cc-addon-info/cc-addon-info.smart-matomo.js Outdated
Comment thread src/components/cc-addon-info/cc-addon-info.smart-materia-kv.js Outdated
Comment thread src/components/cc-addon-info/cc-addon-info.smart-keycloak.js Outdated
Comment thread src/components/cc-addon-info/cc-addon-info.smart-jenkins.js Outdated
Comment thread src/components/cc-addon-info/cc-addon-info.smart-elastic.js Outdated
@florian-sanders-cc florian-sanders-cc force-pushed the cc-addon-dashboards/use-new-client branch 2 times, most recently from 950df3f to fbe6aeb Compare June 2, 2026 09:06
Remove hardcoded endpoints and use the new client instead
Remove hardcoded endpoints and use the new client instead
Remove hardcoded endpoints and use the new client instead
Since most dashboard components now use types coming 
from the new client, we no local need to maintain 
types for API payloads
Since the `@clevercloud/client` package returns `null` instead of 
throwing when facing a `404` response, we need to make sure the code 
stops after setting the component state to `error` if data is null
@florian-sanders-cc florian-sanders-cc force-pushed the cc-addon-dashboards/use-new-client branch from fbe6aeb to ed5e0f6 Compare June 2, 2026 09:08
@florian-sanders-cc florian-sanders-cc merged commit c51985d into master Jun 2, 2026
20 of 21 checks passed
@florian-sanders-cc florian-sanders-cc deleted the cc-addon-dashboards/use-new-client branch June 2, 2026 09:22
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

🔎 The preview has been automatically deleted.

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