Skip to content

[Improvement-18249][DAO] Route ClusterMapper and K8sNamespaceMapper access through repository Dao#18257

Merged
SbloodyS merged 3 commits into
apache:devfrom
ruanwenjun:dao/cluster-and-k8s-namespace
May 15, 2026
Merged

[Improvement-18249][DAO] Route ClusterMapper and K8sNamespaceMapper access through repository Dao#18257
SbloodyS merged 3 commits into
apache:devfrom
ruanwenjun:dao/cluster-and-k8s-namespace

Conversation

@ruanwenjun
Copy link
Copy Markdown
Member

Was this PR generated or assisted by AI?

YES, gpt-5.5

Purpose of the pull request

Introduce ClusterDao and K8sNamespaceDao to encapsulate the two K8s-related mappers so the api layer depends only on the repository abstraction. The two mappers are bundled together because they share call sites in ClusterServiceImpl and K8SNamespaceServiceImpl.

ClusterDao mirrors the mapper API and packages deleteByCode as boolean (returning row count > 0) to match the IDao convention.

K8sNamespaceDao mirrors the mapper API; existNamespace returns primitive boolean via Boolean.TRUE.equals, and countByClusterCode encapsulates the LambdaQueryWrapper that previously leaked into ClusterServiceImpl.

Tracking issue: #18249

Brief change log

Verify this pull request

This pull request is code cleanup without any test coverage.

(or)

This pull request is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(or)

Pull Request Notice

Pull Request Notice

If your pull request contains incompatible change, you should also add it to docs/docs/en/guide/upgrade/incompatible.md

…ccess through repository Dao

Introduce ClusterDao and K8sNamespaceDao to encapsulate the two
K8s-related mappers so the api layer depends only on the repository
abstraction. The two mappers are bundled together because they share
call sites in ClusterServiceImpl and K8SNamespaceServiceImpl.

ClusterDao mirrors the mapper API and packages deleteByCode as boolean
(returning row count > 0) to match the IDao convention.

K8sNamespaceDao mirrors the mapper API; existNamespace returns primitive
boolean via Boolean.TRUE.equals, and countByClusterCode encapsulates the
LambdaQueryWrapper that previously leaked into ClusterServiceImpl.

Tracking issue: apache#18249
@ruanwenjun ruanwenjun added this to the 3.4.2 milestone May 13, 2026
@ruanwenjun ruanwenjun added refactor improvement make more easy to user or prompt friendly labels May 13, 2026
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 60%)

See analysis details on SonarQube Cloud

@SbloodyS SbloodyS merged commit 5c5dd90 into apache:dev May 15, 2026
121 of 123 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend improvement make more easy to user or prompt friendly refactor test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants