Skip to content

Automate instance-folder type mapping and add regression check for warning-free InstanceLibrary instantiation #84

@ehennestad

Description

@ehennestad

Summary

InstanceLibrary.createInstanceTable currently relies on hardcoded folder-name branching and emits warnings for unmapped folders:

  • File: code/internal/+openminds/+internal/@InstanceLibrary/InstanceLibrary.m
  • Warning ID: OPENMINDS:InstanceLibrary:createInstanceTable:MissingTypeMapping

This should be made more automatic and covered by CI to catch regressions earlier.

Current pain point

When a new instance folder appears without an explicit mapping, runtime warnings are raised instead of the mapping being handled by a formalized mechanism. This is easy to miss until late and can drift over time.

Requested improvements

  1. Formalize mapping
  • Replace/augment ad-hoc branching with a formalized mapping source (e.g., JSON config and/or deterministic mapping rules).
  • Ensure mapping updates are maintainable and reviewable outside deeply nested conditionals.
  1. Add regression workflow
  • Add automated workflow/test that regularly verifies this class can be instantiated without emitting MissingTypeMapping warnings for supported data layouts.
  • Fail CI when new unmapped folders introduce this warning unexpectedly.

Acceptance criteria

  • Mapping behavior is driven by explicit config/rules, not only hardcoded conditional branches.
  • InstanceLibrary instantiation path is exercised in automated checks.
  • CI detects and fails on unexpected OPENMINDS:InstanceLibrary:createInstanceTable:MissingTypeMapping warnings.
  • Documentation (or comments) explains how to extend mapping when new folders are introduced.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions