Settings → Plugins: an installed plugin never shows where it came from #603
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo#603
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found on 2026-09-29 in a read-only review of postulo at
95348908d, by comparing the keyspolicy.overview()looks up with the keysinstalling.status()writes, and rendering both in a test.Checked again on 2026-10-01 against
mainat0a5cad587: still present.status()moved fromplugins/installing.pytoplugins/provenance.py(#248), so the code is now atplugins/policy.py:274(marks = {row["name"]: row for row in provenance.status()}) and:285, andplugins/provenance.py:214-218(**asdict(entry)) against:198for built-ins. Thepackages_by_distribution()andcanonicalisenamed in the fix now live inplugins/record.py:146and:213;installingstill hands outcanonicalisebut no longerpackages_by_distribution.overview()looks up each plugin's origin by the name the plugin registers (imap,paperless,helloworld), butstatus()keys installed plugins by their distribution name from the record (postulo-imap,postulo-paperless). The two never match for an installed plugin, so its row on a person's Settings → Plugins has no origin tag. Built-ins match, because their status row is named after the class'sname. The page therefore labels exactly the plugins that need no warning (Internal) and leaves out the ones the tag exists for (Uploaded, Custom).plugins/policy.py:283(marks = {row["name"]: row for row in installing.status()}) and:294(mark = marks.get(plugin.name, {}));plugins/installing.py:1303-1307(status():**asdict(entry), sonameis the record's distribution name) against:1287for built-ins (name=getattr(plugin_class, "name", "")).postulo-imapand a sync plugin namedimap,status()returned the rowpostulo-imapandoverview()gave that pluginprovenance_label == "".dist, asregistry._distribution_ofalready does, kept on the instance when it is loaded, orinstalling.packages_by_distribution()on the top-level package oftype(plugin).__module__; compare withinstalling.canonicalise. Built-ins keep matching byname.Related to #184 (closed), which added the origin tag to this page; it works for built-ins only.
Done when
tests/test_plugin_provenance.pywith a record line whose distribution name differs from the plugin'sname(as every official plugin's does) that asserts the person'ssettings:pluginspage shows Uploaded for it.