refactor: rewire silo submodule for monorepo split #19

Merged
forbes merged 1 commits from refactor/silo-split into main 2026-02-06 17:23:10 +00:00
Owner

Summary

Rewire the mods/silo submodule to point at the new silo-mod repository, part of splitting the silo monorepo into four focused repos.

Changes (Create repo -- this PR)

3 files changed, 3 insertions, 3 deletions:

  • .gitmodules: silo.git -> silo-mod.git
  • src/Mod/Create/Init.py: bootstrap path silo/pkg/freecad -> silo/freecad
  • src/Mod/Create/InitGui.py: same path update

Background

The mods/silo submodule was a monorepo containing a Go server, a FreeCAD workbench, and a LibreOffice Calc extension. These three components have zero code coupling -- they communicate only via REST API. Splitting them enables independent deployment and version tracking.

New repository structure

Repo URL Contents
silo (existing) kindred/silo.git Go server only (cmd/, internal/, migrations/, deployments/)
silo-client (new) kindred/silo-client.git Shared Python API client (SiloClient, SiloSettings adapter pattern)
silo-mod (new) kindred/silo-mod.git FreeCAD workbench (this submodule)
silo-calc (new) kindred/silo-calc.git LibreOffice Calc extension

Dependency graph

create (this repo)
  └── mods/silo -> silo-mod.git
        └── silo-client/ [submodule -> silo-client.git]

silo-calc.git (standalone)
  └── silo-client/ [submodule -> silo-client.git]

silo.git (standalone server, no longer a Create submodule)

Architecture: SiloSettings adapter pattern

The shared silo-client package defines an abstract SiloSettings base class:

class SiloSettings:
    def get_api_url(self) -> str: ...
    def get_api_token(self) -> str: ...
    def get_ssl_verify(self) -> bool: ...
    def get_ssl_cert_path(self) -> str: ...
    def save_auth(self, username, role, source, token): ...
    def clear_auth(self): ...

Each consumer provides an adapter for its config storage:

  • FreeCADSiloSettings (silo-mod) -- wraps FreeCAD.ParamGet() preferences
  • CalcSiloSettings (silo-calc) -- wraps ~/.config/silo/calc-settings.json

What was extracted from silo_commands.py

The FreeCAD workbench silo_commands.py went from 3592 to 2976 lines:

Moved to silo-client (~680 lines):

  • SiloClient class (all HTTP methods, auth flow, file upload/download)
  • CATEGORY_NAMES dict (169 part number category entries)
  • SSL context builder (build_ssl_context)
  • Utility functions: sanitize_filename, parse_part_number, get_category_folder_name

Kept in silo-mod (unchanged):

  • All 14 command classes (Silo_Open through Silo_Auth)
  • SiloSync class
  • SiloAuthDockWidget
  • FreeCAD-specific path utilities (get_projects_dir, get_cad_file_path, etc.)
  • Document property helpers

Staged content

New repo content is staged in .staging/ (not part of this PR):

.staging/
  silo-client/   -> push to kindred/silo-client.git
  silo-mod/      -> push to kindred/silo-mod.git
  silo-calc/     -> push to kindred/silo-calc.git

Merge order

  1. Push silo-client to its remote (dependency for both consumers)
  2. Push silo-mod to its remote
  3. Push silo-calc to its remote
  4. Merge this PR (updates Create to point at silo-mod)
  5. Clean up server-only silo.git (remove pkg/, client Makefile targets)

Verification

# silo-client imports cleanly
python3 -c "from silo_client import SiloClient, SiloSettings, CATEGORY_NAMES; print(OK)"

# silo-mod has no SiloClient class (moved to silo-client)
grep -c "class SiloClient" .staging/silo-mod/freecad/silo_commands.py  # 0

# silo-mod imports from shared package
grep "from silo_client import" .staging/silo-mod/freecad/silo_commands.py  # matches

# silo-calc imports from shared package
grep "from silo_client import" .staging/silo-calc/pythonpath/silo_calc/client.py  # matches

# Create bootstrap paths updated
grep "silo/freecad" src/Mod/Create/Init.py     # matches
grep "silo/freecad" src/Mod/Create/InitGui.py  # matches

All checks pass.

## Summary Rewire the `mods/silo` submodule to point at the new `silo-mod` repository, part of splitting the silo monorepo into four focused repos. ## Changes (Create repo -- this PR) 3 files changed, 3 insertions, 3 deletions: - **`.gitmodules`**: `silo.git` -> `silo-mod.git` - **`src/Mod/Create/Init.py`**: bootstrap path `silo/pkg/freecad` -> `silo/freecad` - **`src/Mod/Create/InitGui.py`**: same path update ## Background The `mods/silo` submodule was a monorepo containing a Go server, a FreeCAD workbench, and a LibreOffice Calc extension. These three components have zero code coupling -- they communicate only via REST API. Splitting them enables independent deployment and version tracking. ## New repository structure | Repo | URL | Contents | |------|-----|----------| | **silo** (existing) | `kindred/silo.git` | Go server only (cmd/, internal/, migrations/, deployments/) | | **silo-client** (new) | `kindred/silo-client.git` | Shared Python API client (`SiloClient`, `SiloSettings` adapter pattern) | | **silo-mod** (new) | `kindred/silo-mod.git` | FreeCAD workbench (this submodule) | | **silo-calc** (new) | `kindred/silo-calc.git` | LibreOffice Calc extension | ### Dependency graph ``` create (this repo) └── mods/silo -> silo-mod.git └── silo-client/ [submodule -> silo-client.git] silo-calc.git (standalone) └── silo-client/ [submodule -> silo-client.git] silo.git (standalone server, no longer a Create submodule) ``` ## Architecture: SiloSettings adapter pattern The shared `silo-client` package defines an abstract `SiloSettings` base class: ```python class SiloSettings: def get_api_url(self) -> str: ... def get_api_token(self) -> str: ... def get_ssl_verify(self) -> bool: ... def get_ssl_cert_path(self) -> str: ... def save_auth(self, username, role, source, token): ... def clear_auth(self): ... ``` Each consumer provides an adapter for its config storage: - **`FreeCADSiloSettings`** (silo-mod) -- wraps `FreeCAD.ParamGet()` preferences - **`CalcSiloSettings`** (silo-calc) -- wraps `~/.config/silo/calc-settings.json` ## What was extracted from silo_commands.py The FreeCAD workbench `silo_commands.py` went from 3592 to 2976 lines: **Moved to silo-client (~680 lines):** - `SiloClient` class (all HTTP methods, auth flow, file upload/download) - `CATEGORY_NAMES` dict (169 part number category entries) - SSL context builder (`build_ssl_context`) - Utility functions: `sanitize_filename`, `parse_part_number`, `get_category_folder_name` **Kept in silo-mod (unchanged):** - All 14 command classes (`Silo_Open` through `Silo_Auth`) - `SiloSync` class - `SiloAuthDockWidget` - FreeCAD-specific path utilities (`get_projects_dir`, `get_cad_file_path`, etc.) - Document property helpers ## Staged content New repo content is staged in `.staging/` (not part of this PR): ``` .staging/ silo-client/ -> push to kindred/silo-client.git silo-mod/ -> push to kindred/silo-mod.git silo-calc/ -> push to kindred/silo-calc.git ``` ## Merge order 1. Push `silo-client` to its remote (dependency for both consumers) 2. Push `silo-mod` to its remote 3. Push `silo-calc` to its remote 4. Merge this PR (updates Create to point at silo-mod) 5. Clean up server-only `silo.git` (remove pkg/, client Makefile targets) ## Verification ```bash # silo-client imports cleanly python3 -c "from silo_client import SiloClient, SiloSettings, CATEGORY_NAMES; print(OK)" # silo-mod has no SiloClient class (moved to silo-client) grep -c "class SiloClient" .staging/silo-mod/freecad/silo_commands.py # 0 # silo-mod imports from shared package grep "from silo_client import" .staging/silo-mod/freecad/silo_commands.py # matches # silo-calc imports from shared package grep "from silo_client import" .staging/silo-calc/pythonpath/silo_calc/client.py # matches # Create bootstrap paths updated grep "silo/freecad" src/Mod/Create/Init.py # matches grep "silo/freecad" src/Mod/Create/InitGui.py # matches ``` All checks pass.
forbes added 1 commit 2026-02-06 17:20:27 +00:00
refactor: rewire silo submodule for silo-mod split
Some checks failed
Build and Test / build (pull_request) Has been cancelled
c59c704da3
- .gitmodules: silo.git -> silo-mod.git (FreeCAD workbench only)
- Init.py: silo/pkg/freecad -> silo/freecad (new repo layout)
- InitGui.py: same path update

The silo monorepo has been split into:
- silo-client: shared Python API client (submodule of silo-mod)
- silo-mod: FreeCAD workbench (this submodule)
- silo-calc: LibreOffice Calc extension (separate repo)
- silo: server only (no longer a Create submodule)
forbes merged commit 6649372f7b into main 2026-02-06 17:23:10 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kindred/create#19