Introducing .discourse-compatibility: pinned plugin/theme versions for older Discourse versions

Apologies in advance as I often turn to this somewhat late in the night, so I’m not sure if I’m 100% correct here, and this may well be something you’re aware of already. I’m memorialising it here partly for my own sanity as it’s tripped me up a couple of times now.

I think this mechanism is effectively unworkable for the beta branch if the plugin is used on an instance you don’t control (i.e. it’s open source) that’s being updated in the common fashion. The common fashion of updating is for the site admin to do so when prompted in the admin UI.

Given this

And this

And that tests-passed and beta have the same Discourse version but not the same code, e.g. both are currently 2.6.0.beta2:

This follows:

  1. To support the beta branch you need to pin a commit to the latest beta release, as that is the one sites on the beta branch will be using.

  2. However, if the latest beta release is in the compatability file, instances running tests-passed will also use the pinned commit.

This means you can’t support the standard usage of both tests-passed and beta at the same time in an open souce plugin. Given that the majority of people who install plugins are on tests-passed, you effectively can’t support beta via this method.

Note that it does work in practice for the stable branch as stable has a different Discourse version from beta and tests-passed.

4 Likes