Skip to content

List registered actions and permissions in /-/plugins (#2484) - #3058

Open
AnkitaAdvitot wants to merge 3 commits into
simonw:mainfrom
AnkitaAdvitot:feat/plugins-list-registered-actions
Open

AnkitaAdvitot wants to merge 3 commits into
simonw:mainfrom
AnkitaAdvitot:feat/plugins-list-registered-actions

Conversation

@AnkitaAdvitot

Copy link
Copy Markdown
Contributor

Summary

Fixes #2484 by tracking which actions are registered by each plugin during register_actions hook processing in Datasette.__init__, and exposing them in /-/plugins / /-/plugins.json:

  • actions: list of {"name": ..., "description": ...} objects for registered actions.
  • permissions: list of action names for convenient permission inspection.

Details

  • In Datasette.__init__, inspect pm.hook.register_actions.get_hookimpls() to map registered Actions to plugin and distribution names in self._plugin_actions.
  • In _plugins(), return sorted actions and permissions per plugin.
  • Added test test_plugins_json_lists_registered_actions in tests/test_plugins.py and updated fixtures in tests/fixtures.py.
  • Formatted and verified with ruff and black.

@codecov

codecov Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (4e70219) to head (50dd4e8).

Files with missing lines Patch % Lines
datasette/app.py 0.00% 32 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main   #3058   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files         79      79           
  Lines      13875   13894   +19     
=====================================
- Misses     13875   13894   +19     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/-/plugins should list permissions registered by each plugin

2 participants