Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
DragaDoncila opened this issue Feb 19, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@DragaDoncila
Copy link
Contributor

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.

@DragaDoncila DragaDoncila added the bug Something isn't working label Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant