Dear Devs,
Recent work on the addons-source PR backlog (lint cleanups, dependency declarations, Py2-era import migrations on a handful of unstable addons) has given me a sense of some architectual issues with the addon mechanism. I’ve seen similar discussions by others here, so I thought the subject warrented a bigger discussion. This is some thoughts I’ve had how it could be improved and I would appreciate the input of the community that has far more experience with it then me.
Some issues I’ve seen in the past couple fo weeks
- My lint backlog campaign uncovered a class of addons (~13 directories) that are status=UNSTABLE, include_in_listing=False — neither published nor maintained.
- Every Gramps minor release triggers a cycle of bumping gramps_target_version across ~140 addons. Most of those bumps are no-op code-wise; just a string change. They’re busywork, and authors who’ve moved on can’t do them, so addons rot.
- I’ve seen questions from new addon writers how they should go about it and a suggestion to move to a similar HACS plugin process for the repo
As far as I can tell from CONTRIBUTING.md and MAINTAINERS.md in addons-source I couldn’t find some of the suggestions here. With that in mind, I would like to suggest following improvements
Introduce an API version
Today an addon declares a gramps target version (e.g. 6.0, 6.1) tying it to a release band. What the plugin actually depends on is the API contract of the plugin framework plus the bits of gramps.gen.* and gramps.gui.*; if the contract changes, the addons don’t need to be touched either. I’d therefore propose to use something like addon_api=“>=1.0,<2.0” with the contract semver-ed:
- major bump on breaking changes,
- minor bump on additions,
- patch bumps for bug-fix-only changes
Each Gramps release declares which addon-API version(s) it provides. The Addon Manager (AM) (and valid_plugin_version) checks the addon’s range against that, instead of literal version-string equality. The hard part isn’t the metadata — it’s that adopting this requires Gramps core to commit to a stable, explicitly-defined addon API surface, with semver discipline. Is this possible?
Lifecycle states
The status= field today (UNSTABLE / EXPERIMENTAL / BETA / STABLE) is overloaded. The way I understand it, it signals both code quality (UNSTABLE = experimental, in-development) and maintenance state (UNSTABLE = abandoned, needs porting). Same flag, two different intents.
Combined with include_in_listing=False, we end up with addons in an ambiguous state. Is this one being actively ported, or is it dead? The CI can’t tell. The AM UI can’t tell users. Maintainers can’t tell what to do with it. I’d suggest an explicity lifecycle field that disambiguates this
- INCUBATING — new addon under development, or an existing addon being actively ported. Not in user listing. CI gates it (active dev needs feedback). Time-bound: a year in INCUBATING without graduation triggers a review.
- PUBLISHED — released to users, actively maintained. Full CI, full listing visibility.
- DEPRECATED — still loadable; AM UI shows a banner (“going away in version X”).
- ORPHANED — This builds on the existing maintainers= field and the Addons MAINTAINERS wiki page, rather than inventing new metadata. Stays loadable for users who already have it; UI shows “no longer maintained, looking for adopter”; CI gating relaxed (warnings, not failures); explicitly catalogued so adopters can find it.
- ARCHIVED — moved to addons-source/archive//, removed from build, source preserved for history.
The maintainer-departure → ORPHANED transition is the one that needs process, not just metadata. Possibilities: a periodic cron checking last-commit date plus the maintainers= field, opening a tracking issue when an addon hasn’t moved in 18 months and no maintainer responds. Decision still human; just surfaced.
Addon Manager behavior
With API-versioned compatibility, an addon at addon_api>=1.0,<2.0 works on every Gramps release that exposes API 1.x — no per-release re-targeting, no per-Gramps-version listing files, no “you upgraded Gramps, here’s the gramps61 version of FooAddon.”
What’s still needed:
- Cross-Gramps-version persistence of installed state. If the user has FooAddon installed and upgrades Gramps, the addon stays installed and working — no re-discovery needed.
- Lifecycle banners surfaced in the UI. DEPRECATED addons show a notice with removed_in= so users know to find a replacement; ORPHANED addons show “no longer maintained, looking for adopter.”
- Declared migration paths for addon major versions. When an addon goes v1.x → v2.0 with breaking changes (DB schema, config format), declare it: migrates_from=[“1.5”,“1.6”] with a named hook function. PostgreSQLEnhanced is the textbook case where this is currently ad-hoc.
- Addon update notifications independent of Gramps update. Periodic listing checks, prompt user when a newer addon version is available.
If you see value in following the direction, I’d be happy to write up a more concrete details and necessary PRs. Thoughts?