chore(silo): add root package.xml and migrate to SDK APIs #373

Closed
opened 2026-03-03 14:11:25 +00:00 by forbes · 0 comments
Owner

Summary

The silo mod has a non-standard structure compared to all other Kindred addons (sdk, gears, datums, solver). It needs a root-level package.xml and should migrate from direct FreeCADGui.* calls to SDK APIs.

Current Problems

1. Non-standard package.xml location

Silo's package.xml lives at mods/silo/freecad/package.xml (depth 2) instead of mods/silo/package.xml (depth 1). Every other addon places it at the mod root:

  • mods/sdk/package.xml
  • mods/gears/package.xml
  • mods/datums/package.xml
  • mods/solver/package.xml

The addon loader accepts depth 2 as a fallback, but this is fragile and inconsistent.

2. Duplicate initialization in Create core

Silo-specific setup is split between mods/silo/freecad/InitGui.py and src/Mod/Create/InitGui.py. The core module registers:

  • Silo document observer (600ms deferred)
  • Silo origin (1500ms — duplicate, already registered in silo's own InitGui.py)
  • Silo auth dock panel (2000ms)
  • Silo first-start check (3000ms)
  • Silo activity panel (4000ms)

This couples Create core to Silo implementation details. All of this should live in the silo addon itself.

3. Direct FreeCADGui.* calls instead of SDK APIs

Silo registers its origin via FreeCADGui.addOrigin() and dock panels through Create core, instead of using SDK functions:

  • kindred_sdk.register_origin() — for origin registration
  • kindred_sdk.register_dock_panel() — for auth and activity panels
  • kindred_sdk.register_overlay() — already used (one call)

4. CMake install targets miss package.xml

The current CMake install only copies freecad/ and silo-client/:

install(DIRECTORY ${CMAKE_SOURCE_DIR}/mods/silo/freecad/ DESTINATION mods/silo/freecad)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/mods/silo/silo-client/ DESTINATION mods/silo/silo-client)

No root-level package.xml or Init.py is installed.

Proposed Changes

In mods/silo (silo-mod repo)

  1. Add root package.xml at mods/silo/package.xml:
<?xml version="1.0" encoding="UTF-8"?>
<package format="1" xmlns="https://wiki.freecad.org/Package_Metadata">
  <name>silo</name>
  <description>PLM workbench for Kindred Create</description>
  <version>0.1.0</version>
  <maintainer email="development@kindred-systems.com">Kindred Systems</maintainer>
  <license file="LICENSE">MIT</license>
  <url type="repository">https://git.kindred-systems.com/kindred/silo-mod</url>
  <content>
    <workbench>
      <classname>SiloWorkbench</classname>
      <subdirectory>freecad</subdirectory>
    </workbench>
  </content>
  <kindred>
    <min_create_version>0.1.0</min_create_version>
    <load_priority>60</load_priority>
    <pure_python>true</pure_python>
    <dependencies>
      <dependency>sdk</dependency>
    </dependencies>
  </kindred>
</package>
  1. Add root Init.py — thin wrapper that adds silo-client/ to sys.path then delegates to freecad/Init.py logic.

  2. Migrate silo InitGui.py to use SDK APIs:

    • kindred_sdk.register_origin(silo_origin) instead of FreeCADGui.addOrigin()
    • kindred_sdk.register_dock_panel() for auth and activity panels
    • Move all deferred Silo setup from src/Mod/Create/InitGui.py into silo's own InitGui.py
  3. Remove old freecad/package.xml (or keep as secondary metadata if needed).

In create repo

  1. Remove Silo-specific setup from src/Mod/Create/InitGui.py:

    • _register_silo_origin() (duplicate)
    • _register_silo_document_observer()
    • _setup_silo_auth_panel()
    • _check_silo_first_start()
    • _setup_silo_activity_panel()
  2. Update CMake install targets in src/Mod/Create/CMakeLists.txt:

install(FILES ${CMAKE_SOURCE_DIR}/mods/silo/package.xml
              ${CMAKE_SOURCE_DIR}/mods/silo/Init.py
        DESTINATION mods/silo)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/mods/silo/freecad/ DESTINATION mods/silo/freecad)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/mods/silo/silo-client/ DESTINATION mods/silo/silo-client)

Acceptance Criteria

  • mods/silo/package.xml exists at mod root following the standard pattern
  • Addon loader discovers silo at depth 1 (standard path)
  • All Silo-specific deferred setup removed from src/Mod/Create/InitGui.py
  • Silo registers origin via kindred_sdk.register_origin()
  • Silo registers dock panels via kindred_sdk.register_dock_panel()
  • CMake installs package.xml and Init.py at mod root
  • No duplicate origin registration
  • Silo loads correctly through addon loader with SDK dependency resolved

Reference

Standard addon structure (e.g. datums):

mods/datums/
├── package.xml          ← addon manifest (root)
├── Init.py              ← console bootstrap
├── InitGui.py           ← GUI bootstrap
└── datums/              ← workbench code (subdirectory)
    ├── __init__.py
    ├── command.py
    └── ...
## Summary The silo mod has a non-standard structure compared to all other Kindred addons (sdk, gears, datums, solver). It needs a root-level `package.xml` and should migrate from direct `FreeCADGui.*` calls to SDK APIs. ## Current Problems ### 1. Non-standard `package.xml` location Silo's `package.xml` lives at `mods/silo/freecad/package.xml` (depth 2) instead of `mods/silo/package.xml` (depth 1). Every other addon places it at the mod root: - `mods/sdk/package.xml` - `mods/gears/package.xml` - `mods/datums/package.xml` - `mods/solver/package.xml` The addon loader accepts depth 2 as a fallback, but this is fragile and inconsistent. ### 2. Duplicate initialization in Create core Silo-specific setup is split between `mods/silo/freecad/InitGui.py` **and** `src/Mod/Create/InitGui.py`. The core module registers: - Silo document observer (600ms deferred) - Silo origin (1500ms — **duplicate**, already registered in silo's own InitGui.py) - Silo auth dock panel (2000ms) - Silo first-start check (3000ms) - Silo activity panel (4000ms) This couples Create core to Silo implementation details. All of this should live in the silo addon itself. ### 3. Direct `FreeCADGui.*` calls instead of SDK APIs Silo registers its origin via `FreeCADGui.addOrigin()` and dock panels through Create core, instead of using SDK functions: - `kindred_sdk.register_origin()` — for origin registration - `kindred_sdk.register_dock_panel()` — for auth and activity panels - `kindred_sdk.register_overlay()` — already used (one call) ### 4. CMake install targets miss `package.xml` The current CMake install only copies `freecad/` and `silo-client/`: ```cmake install(DIRECTORY ${CMAKE_SOURCE_DIR}/mods/silo/freecad/ DESTINATION mods/silo/freecad) install(DIRECTORY ${CMAKE_SOURCE_DIR}/mods/silo/silo-client/ DESTINATION mods/silo/silo-client) ``` No root-level `package.xml` or `Init.py` is installed. ## Proposed Changes ### In `mods/silo` (silo-mod repo) 1. **Add root `package.xml`** at `mods/silo/package.xml`: ```xml <?xml version="1.0" encoding="UTF-8"?> <package format="1" xmlns="https://wiki.freecad.org/Package_Metadata"> <name>silo</name> <description>PLM workbench for Kindred Create</description> <version>0.1.0</version> <maintainer email="development@kindred-systems.com">Kindred Systems</maintainer> <license file="LICENSE">MIT</license> <url type="repository">https://git.kindred-systems.com/kindred/silo-mod</url> <content> <workbench> <classname>SiloWorkbench</classname> <subdirectory>freecad</subdirectory> </workbench> </content> <kindred> <min_create_version>0.1.0</min_create_version> <load_priority>60</load_priority> <pure_python>true</pure_python> <dependencies> <dependency>sdk</dependency> </dependencies> </kindred> </package> ``` 2. **Add root `Init.py`** — thin wrapper that adds `silo-client/` to `sys.path` then delegates to `freecad/Init.py` logic. 3. **Migrate silo InitGui.py** to use SDK APIs: - `kindred_sdk.register_origin(silo_origin)` instead of `FreeCADGui.addOrigin()` - `kindred_sdk.register_dock_panel()` for auth and activity panels - Move all deferred Silo setup from `src/Mod/Create/InitGui.py` into silo's own `InitGui.py` 4. **Remove old `freecad/package.xml`** (or keep as secondary metadata if needed). ### In `create` repo 5. **Remove Silo-specific setup from `src/Mod/Create/InitGui.py`**: - `_register_silo_origin()` (duplicate) - `_register_silo_document_observer()` - `_setup_silo_auth_panel()` - `_check_silo_first_start()` - `_setup_silo_activity_panel()` 6. **Update CMake install targets** in `src/Mod/Create/CMakeLists.txt`: ```cmake install(FILES ${CMAKE_SOURCE_DIR}/mods/silo/package.xml ${CMAKE_SOURCE_DIR}/mods/silo/Init.py DESTINATION mods/silo) install(DIRECTORY ${CMAKE_SOURCE_DIR}/mods/silo/freecad/ DESTINATION mods/silo/freecad) install(DIRECTORY ${CMAKE_SOURCE_DIR}/mods/silo/silo-client/ DESTINATION mods/silo/silo-client) ``` ## Acceptance Criteria - [ ] `mods/silo/package.xml` exists at mod root following the standard pattern - [ ] Addon loader discovers silo at depth 1 (standard path) - [ ] All Silo-specific deferred setup removed from `src/Mod/Create/InitGui.py` - [ ] Silo registers origin via `kindred_sdk.register_origin()` - [ ] Silo registers dock panels via `kindred_sdk.register_dock_panel()` - [ ] CMake installs `package.xml` and `Init.py` at mod root - [ ] No duplicate origin registration - [ ] Silo loads correctly through addon loader with SDK dependency resolved ## Reference Standard addon structure (e.g. datums): ``` mods/datums/ ├── package.xml ← addon manifest (root) ├── Init.py ← console bootstrap ├── InitGui.py ← GUI bootstrap └── datums/ ← workbench code (subdirectory) ├── __init__.py ├── command.py └── ... ```
forbes added this to the Silo Workbench project 2026-03-03 14:11:58 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kindred/create#373