Skip to content

Update schema validation to disallow multiple commands with the same ID #375

@DragaDoncila

Description

@DragaDoncila

In #374 I discovered that our auto-conversion of npe1 plugins could generate multiple commands with the same ID, and this didn't run into any errors until trying to launch napari with the plugin installed, when app-model would balk at registering the second command.

Initially I thought "well that's ok users shouldn't run into this because the schema validator should error on their manifest", but it doesn't! In the current implementation, the manifest below is valid:

name: napari-demo
...
contributions:
  commands:
    - id: napari-demo.about
      title: About napari demo plugin
      python_name: napari_demo:about
    - id: napari-demo.about
      title: Other about thing
      python_name: napari_demo:hello_world

We should update our tests and our schema validator to raise an error when encountering a manifest with multiple commands with the same command ID.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions