Skip to content

Bug: parseCategory drops unknown YAML fields (e.g. datasets:) via rest spread, dropping MIMIC-IV Demo from build #83

@mmcdermott

Description

@mmcdermott

Summary

`parseCategory` destructures only `name, description, icon, packages` and shoves every other key into a "subcategories" rest spread. Any non-recognized field whose value isn't another category-shaped object gets logged as `Invalid subcategory format` and silently dropped.

Repro

`npm run build` currently emits:
```
Invalid subcategory format for physionet_repo: https://physionet.org/content/mimic-iv-demo-meds/0.0.1/
```

Code pointers

  • `src/lib/ecosystem/utils.ts` line 58 — destructure that creates the rest-spread of "subcategories":
    ```ts
    const { name, description, icon, packages: rawPackages, ...rawSubcategories } = rawCategory;
    ```
  • `src/lib/ecosystem/utils.ts` line 124 — the warn:
    ```ts
    console.warn(`Invalid subcategory format for ${key}:`, rawSubcategory);
    ```
  • `static/data/ecosystem.yaml` lines 81–87 — the trigger:
    ```yaml
    publicly_available_datasets:
    name: 'Public Datasets'
    description: '...'
    datasets: # <-- not in the destructure; treated as a subcategory map
    - name: 'MIMIC-IV Demo'
    physionet_repo: https://physionet.org/content/mimic-iv-demo-meds/0.0.1/
    ```

Symptom

`MIMIC-IV Demo` (and any future `datasets:` entries) never reach the rendered ecosystem page. The build logs the warning but nothing surfaces it as a failure, so this regression can land silently.

Suggested fix

Two layers:

  1. Parser: explicitly recognize `datasets:` (and any other intentional non-package keys), or replace the rest-spread with an explicit `subcategories:` field, so unknown keys are caught at parse time rather than treated as silent subcategory maps.
  2. CI: consider failing the build on these warnings (or surfacing them as console errors) so future drift is caught.

Found while doing a repo health pass; reproduced via `npm run build` on `main`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions