-
-
Notifications
You must be signed in to change notification settings - Fork 68
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
Some plugins always install in latest version #475
Comments
Looking at this, I initially thought it could be linked to the |
@pluspol could you try chaging your composer json file to "name": "wpackagist-plugin/cf7-grid-layout",
"version": "4.13.0",
"source": {
"type": "svn",
"url": "https://plugins.svn.wordpress.org/cf7-grid-layout/",
"reference": "tags"
}, ie reference the tags rather than the trunk. The trunk always has the latest code, the tags have the latest as well as older version. |
I've found the following file: There it states that if only the trunk gets updated wpackagist will create those timestamp urls. Using the package from SVN is also a solution but not our preferred one. |
I think I found it: If the current version (in this case 4.14.1) doesn't exist as tag (and it doesn't) the trunk will be used for this: So I think you need to add the latest version as tag @aurovrata . It's the same with the other plugin I'm having problems with: So the specific issue isn't a bug in WPackagist but one could argue that the current behaviour is kind of a footgun because you're expecting to install an exact version and only realize later that you're not. So I would suggest that installing a trunk version shouldn't be the case here. In my opinion it would be more correct to simply not provide the version if it isn't tagged correctly. Or provide it only as an explicit dev version. |
It is a common practice across the WP repo to only tag major release versions, and minor release (that fix bugs) should in any case be updated to the latest version in that major release. I have adopted that practice as it also reduces the amount of storage used by the tags svn folder. Therefore I would suggest you configure your package to use 4.X versions and not bother with sub release such 4.X.x. The sub-release always fix bugs. New features always bump the major version number. Let me know if this works. |
I think there are some separate aspects to discuss and most of them are not related to WPackagist. Related to WPackagist:
Unrelated to WPackagist:
WP also recommends tagging every release:
https://developer.wordpress.org/plugins/wordpress-org/how-to-use-subversion/#trunk
I hope I'm not being unpolite or too harsh. I just want to make clear my point of view. And if the system doesn't work as expected it could lead to major reliability and trust issues. |
In my experience this is not very common and definitely not recommended, the Plugin guidelines recommend one tag folder per version. Releases in the @pluspol As you mentioned, the problems arises from incompatibilities between how Composer works (broadly: very strict) and how the WPorg repository works (broadly: pretty relaxed, eg you can have only I do think the behavior that a plugin version without a tags folder return trunk as the download link fails in the users expectation of what they are going to download and should be changed. Because this is just incorrect behavior, eg some authors delete tags for older versions of their plugins and pointing these to trunk has very unintended consequences. If a plugin only supports |
I need to correct myself, I mean patch versions are not commonly tagged, major and minor versions are, which I follow in my plugin development. Wp Guidelines does not specifically recommend to tag patch versions as per the semantic version convention. |
this is true if one uses SVN for development, but I don't know of any plugin that does. As for my I develop on GitHub only, and deploy on WP SVN.
which is true in this case.
@khromov I agree, but isn;t the case here. The problem arose from trying to get patch versions which do not exists in the tags folder. So v4.12.10 for example does not exists, and as such defaults to trunk, but version v4.12 does exists and contains the latest patch in that minor update, v4.12.13 which is the correct version to use in that minor version 4.12 |
Sorry, I misunderstood your tag handling. When I understand it correctly you update the minor tag version with the latest patch release. This reminds me of Docker hub where besides exact versions like
But in Composer (and other package systems) things are different as pointed out by @khromov:
So this behaviour once again would break one of the central contracts of package systems like composer: Packages must be immutable.
In general this also shows that the whole WP plugin ecosystem and composer integration is a bit of a gamble because plugins are versioned as they wish and composer has strong requirements regarding versioning. Immutability for versions heavily relies on plugin authors as long as WPackagist uses the download urls provided by WP. IMHO because of this a stable and reliable handling can only be achieved by mirroring these zip files (and make them immutable) and maybe creating own versions for changed zip files. I don't know whether this is realistic or necessary as this problem doesn't seem to be as obvious, known and critical until now. |
that's a good point, however, in reality this would not happen as tagged versions do not evolve beyond the latest version. If the latest version is v4.2.1 and someone installs v4.1 (which is actually 4.1.4), this will not change going forward, only v4.2 will change but in line with the trunk. If someone install the latest version (trunk), then surely they should be able to get an update trigger the same way WordPress plugin page does? In summary,
|
Looking over your thread in the plugin support, I realise that if you request a version which does not exists in the tags folder then it simply return the trunk version. So if you request X.x versions older than the current one, you will get the versions available in the For the latest code in Would this work for you? |
I just feel that patched versions will also confuse users who want to download older versions from the WP repo, and I feel its easier for them to always download the latest patch in that minor version by simply omitting the patch versions from the tags |
I followed this interesting thread and in my opinion there should be a tag for every release and no tags should be altered afterwards. That includes bugfix release tags. I guess that is what most people would expect from semantic versioning since 4.2 is not the same as 4.2.x. |
I think it does matter in reality. It can happen everytime the lockfiles points to a minor release (without patch level) and was originally meant to provide an older version. This might happen with installations that don't get updated very often.
I'm not sure whether I understand you correctly:
I don't have any statistics from the company but I personally would (when not using WPackagist) always download the file provided by the plugin home page. Normally I wouldn't use the advanced downloads because a) SemVer use can't be expected an b) only a few plugins might support older versioning branches. So when tagging all releases the download wouldn't point to the generic file |
Some additions regarding "is it allowed to overwrite tags".
Browsing through other issues it's apparant that these problems come up regularly and that versioning is handled diversely by plugin authors:
Non SemVer-compatible versions include:
So besides avoiding unintended trunk installs I'm absolutely on board with checksums. Otherwise I think it all comes down to talking to plugin authors to stick more closely to SemVer. I don't know if its possible to get someone from the WP team on board and discuss what might change in the documentation to make these things more clear and predictable. Otherwise I think I'll scan our projects for instances where trunk versions have been installed. |
I've checked our projects for trunk installs of plugins and are quite surprised as how many different plugins (~18) this currently affects. I haven't checked them one by one whether the requested versions are tagged by now or if they just use the trunk for development. |
@pluspol sorry for the delayed response, we were off for Diwali :) Is the above proposal of using major.minor (vX.x) workable for you as all them have corresponding Wrt WordPress input, here is a blog post by Ipstenu from the plugins team on the topic, and my comment on the practice I follow. |
You're welcome. :) Thanks for the link to the blog post. IMHO it highlights a few points:
She doesn't write about immutability of tags (which also is a big must have for SemVer). Maybe we can get her thoughts on this? @Ipstenu Otherwise I think we're going in circles until we agree on something and get some more participants.
So what is realistically achievable?
Regarding your suggestionIn status quo this wouldn't help as it
Avoiding trunk installs currently is only possible by finding a version that exists in the tags folder. So e. g. for your plugin Regarding beta testingI totally understand and agree that it's important to have some kind of beta testing functionality. I think WP must provide a safe and official way for this. I'm against offering trunk/dev builds for new users because:
Unfortunately I'm not very experienced with WP plugin development so I don't have any suggestions for a feasible alternative. But some options might be:
|
As much as I would love to help it's just not enforceable from a practical level. Also the plugins team actually isn't in charge of that code, it would be the meta team. From an enforcement, there's just NO WAY to force 100k plugins to wake up and smell the SemVer as much as I try :( We try to educate all the time, to point out we want to ditch trunk, but people are super slow to change. I did make a related ticket in trac - https://meta.trac.wordpress.org/ticket/6380 - but right now the field is free-form and unless someone can write code to force that change, it's not going to be possible :/ My recommendation? I like this:
If the version is trunk, or it's not found, congrats, you're non-compliant with this service, have a nice day. As for Beta... That again would be a meta thing. They'd have to write out code to allow for a beta 'track' of some sort. |
Thanks for chipping in @Ipstenu 👍 If I understand your ticket correctly you also advise against overwriting tags. Is this correct?
This would also be in line with SemVer. I've also written an email to the plugins team and got roughly the same response:
IMHO this means that official WP standpoint is:
The limitations are:
So the most helpful thing to do might be trying to support WP Meta in implementing these changes which would bring the whole ecosystem forward and therefore also make WPackagist more reliable. I for myself have to think about whether this is possible for me. |
Reusing tags flat out won't work. No one gets updated, nothing gets pushed properly, everyone loses. Dropping trunk as stable is doable, but people will always reuse tags and wonder why it broke :( |
I think you have not read what I propose properly, since this is not what I am suggesting.
agreed, and my bone of contention is that tagging every single patch version is too much disk space on my local machine. Unfortunately, I haven't found a way (like GitHub) to retain tags only on the origin. Can you use the GitHub repo to pull patch versions? |
Another solution would be tags all versions and delete older versions as the WP handbook suggests. |
I don't know the internals of WPackagist but if this would mean that these deleted versions wouldn't be installable anymore, than this might also cause problems and would break with immutability.
How much space does this take up on your machine? These things shouldn't have an effect on end users, as "disk space" is considered cheap. However I've not used SVN in years so I'm not much help with this, sorry.
Composer allows git repos as package source, yes. However this requires the repo to be a composer package (it must have a
I'm sorry. Can you please rephrase? After rereading your proposal I understand it as follows: Is this correct? If yes, then how do users access the latest minor? Will it be through trunk? If yes, this would lead to installing trunk versions which might result in unexpected updates to even newer versions. (Because the trunk zip file always includes the latest version) |
Hey @pluspol sorry for the delayed response, was away travelling. So in summary... 1. Delete old tags/ versions
yes, that would be ideal really, but haven't figured out how to do that, couldn't find any documentation on this possibility. Even deleting the local tags folder doesn't seem to work. 2. Use git for your packaging
this is something I have not explored, if you are willing to help me figure this one out, then I feel this could be the best solution ? 3. Maintain only minor versions
Yes, you've understood that correctly. the idea here was to allow users access to latest minor version (not patch) in the tags folder. The trunk would always be 1 minor version ahead.... which would not be accessible to your WPackagist script. A little but like linbux distros which have stable versions that don't included the latest packages. Not an ideal solution, but given the maturity of the plugin, your users would not loose out on much as the minor updates have very little functionality updates. For updates that fix major issues that crop up with CF7 updates, I would release the minor updates on the tags folder on priority for your users to update. |
Hi @aurovrata , 2. Use git for your packagingJust to recap: This issue isn't specifically about your plugin but about some kinks in the whole ecosystem. So even when finding a better solution for your plugin we're left with many many others. But yes, I'm happy to help with releasing your packages via composer: One thing to keep in mind: |
ok. My plugin isn't a standalone package as such (requiring CF7 plugin as well as the WP framework), I am assuming that isn't any issue?
yes this is already the case, Major.Minor.Patch (1.0.0). I will register it and get back to you here. |
In theory you would declare CF7 as requirement via the |
This part certainly sounds like something we could consider changing, but my hunch is this could be very disruptive to existing projects to change on the existing endpoints. I'm wondering if we should think about providing a |
@pluspol greetings and a wonderful new year 2023 to you! Quick update on my progress. I am working on v5 of the plugin which has a big redesign of the UI editor as well as improvements in form rendering on the front-end. My plan is to integrate the v5 into packagist as part of this new release. I hope to have a v5 out by end of Feb if progress continues as the current speed, but will start to integrate the RC versions into packagist so that you may start to test the integration in parallel for the first release. |
To assess likely impact of #475 as we think about options
Thanks. I also wish you a great new 2023! |
Hi there,
I've experienced that some plugins always install in the latest version although an older version is specified in
composer.lock
This seems to be related to download URLs that don't include a version number but a timestamp. Because these links seem always to point to the latest version the wrong version might be installed.
I've opened an issue in the plugin support forum and the author needs some hint where to change the download url:
https://wordpress.org/support/topic/include-version-in-download-url/#post-16078572
He also points out that older versions are available through this page:
https://wordpress.org/plugins/cf7-grid-layout/advanced/#download-previous-link
So maybe it's possible to always use these "previous download links" and not the default link on the blue "Download" button.
Currently we've seen this with the following plugins:
Best regards
The text was updated successfully, but these errors were encountered: