Skip to content

refactor(client/filesystem): move into internal/client/filesystem subpackage (#140)#621

Merged
QuentinBisson merged 5 commits into
mainfrom
refactor-140-filesystem-subpackage
May 7, 2026
Merged

refactor(client/filesystem): move into internal/client/filesystem subpackage (#140)#621
QuentinBisson merged 5 commits into
mainfrom
refactor-140-filesystem-subpackage

Conversation

@QuentinBisson
Copy link
Copy Markdown
Contributor

@QuentinBisson QuentinBisson commented May 5, 2026

Closes part of #140.

Moves the 1233-line internal/client/filesystem_client.go into a new internal/client/filesystem/ subpackage, split per CRD domain (client.go, mcpserver.go, serviceclass.go, workflow.go, events.go). Each file is under 400 lines.

Pure refactor: the MusterClient interface stays in the parent client package and the only direct caller of NewFilesystemClient was the in-package dispatcher, which now calls filesystem.New(basePath) directly. External consumers depend only on MusterClient and are unaffected.

Renames: filesystemClientfilesystem.Client, NewFilesystemClientfilesystem.New(basePath string) *Client, helper writer types (filesystemStatusWriter, filesystemSubResourceClient) unexported now that the package name disambiguates.

…package (#140)

The 1233-line internal/client/filesystem_client.go now lives under
internal/client/filesystem/, split per CRD domain:

  client.go         core type + controller-runtime Client interface
  mcpserver.go      MCPServer CRUD
  serviceclass.go   ServiceClass CRUD
  workflow.go       Workflow CRUD
  events.go         Kubernetes Event API

The MusterClient interface stays in the parent client package. The only
caller of the old NewFilesystemClient was the dispatcher in
muster_client.go itself, which now calls filesystem.New(basePath)
directly. External consumers depend only on MusterClient and are
unaffected.

filesystemClient                                    -> filesystem.Client
NewFilesystemClient                                 -> filesystem.New(basePath string) *Client
filesystemStatusWriter, filesystemSubResourceClient -> unexported
@QuentinBisson QuentinBisson reopened this May 5, 2026
@QuentinBisson QuentinBisson changed the title refactor(client): split filesystem_client.go into per-domain files (#140) refactor(client/filesystem): move into internal/client/filesystem subpackage (#140) May 5, 2026
…sertions

Adds package-level doc.go pointing back to the parent client package
architecture, and var _ assertions so any future drift in
controller-runtime client.Client / StatusWriter / SubResourceClient
fails at compile time instead of runtime, plus var _ MusterClient at
the dispatcher call site.
The subResource string was set on subResourceClient but never read. Pure
dead-code cleanup — the rest of the subResourceClient/statusWriter
machinery exists solely to satisfy controller-runtime's client.Client
interface and has no callers in muster, but removing it requires
un-embedding client.Client from MusterClient (deferred).
@QuentinBisson
Copy link
Copy Markdown
Contributor Author

Self-review wrap-up — ready for an external pair of eyes.

Why this should merge: Pure file move. The 1233-line internal/client/filesystem_client.go becomes an internal/client/filesystem/ subpackage split per CRD (client.go, mcpserver.go, serviceclass.go, workflow.go, events.go). Each file is under 400 LOC.

  • The MusterClient interface stays in the parent client package.
  • The only direct caller of NewFilesystemClient was the in-package dispatcher, now filesystem.New(basePath).
  • External consumers depend only on MusterClient and are unaffected.
  • Renames: filesystemClientfilesystem.Client, helper writer types unexported now that the package name disambiguates.

Per-CRD duplication is intentional in this PR. mcpserver.go / serviceclass.go / workflow.go are templates differing only in type and resource name string — that's the file-split shape. #627 collapses them into shared client.Object helpers (≈−247 LOC net once that lands).

CI green.

@QuentinBisson QuentinBisson marked this pull request as ready for review May 7, 2026 22:52
@QuentinBisson QuentinBisson requested a review from a team as a code owner May 7, 2026 22:52
@QuentinBisson QuentinBisson merged commit a3d589f into main May 7, 2026
7 of 8 checks passed
@QuentinBisson QuentinBisson deleted the refactor-140-filesystem-subpackage branch May 7, 2026 23:54
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.

1 participant