GateNLP / gate-core

The GATE Embedded core API and GATE Developer application
GNU Lesser General Public License v3.0
75 stars 29 forks source link

Double check SNAPSHOT version plugins are the latests #74

Open greenwoodma opened 5 years ago

greenwoodma commented 5 years ago

Currently, a new SNAPSHOT of a plugin can be available via (say) repo.g.a.u but not get loaded into GATE because it's not been 24 hours since GATE last checked for a new version. Should we force a check to make sure we have the latest version, but only when we actually are asked to load the plugin.

johann-petrak commented 5 years ago

Why not? What would be the disadvantage of always making sure the user gets the latest version? On the other hand, there are severe disadvantages of having that 24 hours limit for a snapshot version, most importantly that it makes it very difficult to let users test changes. Especially users who are not familiar with deleting their maven cache etc. In my opinion, snapshot versions from our repo should always be used at their latest version at the moment of use.

ianroberts commented 5 years ago

Nice idea in theory but it means that every installation of GATE (Developer and Embedded) would have to contact repo.g.a.u every time it attempts to query any snapshot version of any plugin. The standard Maven defaults are a compromise between freshness for users and bandwidth for the repository.

greenwoodma commented 5 years ago

A compromise, might be a button in the plugin manager allowing you to flush the maven cache of a given plugin. This would allow the user to hit a button before loading the plugin to ensure they got the latest version.

It would also solve the related problem that occurs if a jar gets corrupted on download (and yes I've seen this a few times) which stops the plugin loading. Currently the only way to fix that is to manually delete the maven cache files.

johann-petrak commented 5 years ago

I still do not see the problem. We are talking about snapshot versions only, or actually snapshot versions of plugins from the uk.ac.gate group only and contacting means querying for a hash. We discourage (I think) using snapshot version, we do not offer them in the plugin manager of GATE releases, so how big an impact would that actually be? My suggestion would be to simply allow checking every time now, look at the logs and if this actually ever becomes a problem the work to implement the button and tell people about this can still be done then.

But having that button to deal with a corrupted jar would definitely be useful, apparently this is something maven (or whichever library is responsible) oddly does allow to happen, many decades after people figured out how to deal with transactions and make sure that something is downloaded completely or not at all.

greenwoodma commented 5 years ago

Given we need the button to clear out the cached copy for the more problematic situation of corrupt plugins, I think it makes more sense to just make it clear the same button can be used to force the latest snapshot version.

To be honest both cases are rather rare, and forcing the extra check in every time we load a snapshot plugun seems like taking a sledgehammer to a nut.

johann-petrak commented 5 years ago

Still cannot see why checking the hash for a rare snapshot version would be a sledgehammer, do we have any data about how often anyone outside the GATE team actually uses uk.ac.gate.plugins plugin snapshots? This is essentially the same strategy as used for checking the browser cache for a larg part of web pages. In my opinion, making stuff just work as expected should be the default, rather than having to tell people about cache-clearing and other technical details which they should not be aware of in most cases.