Page 1 of 1

updateSite.xml not triggering update

Posted: Thu Apr 22, 2021 2:01 am
by jtakeda
Hi there,

I'm trying to create a very simple framework, packaged as an add-on, and distribute it using GitHub Releases. I'm able to package it and release it perfectly well; downloading the add-on works, too, but the add on won't update: I've tried manually checking for updates as well as restarting oXygen and checking again, but it always says that an update isn't available.

I have a process whereby on every push event, GitHub actions creates the add on ZIP file and updates the version number for both the zip and the add on version by appending the `current-dateTime()` to the base version number; that ZIP file and the updateSite.xml are pushed as release assets into GitHub (so framework-0.1.0.1.202104211525141240700.zip, for instance). A user installs the plugin by using the /releases/latest/ version of update site:

https://github.com/username/repository/ ... teSite.xml

Which has something like this in it:

Code: Select all

 <xt:location href="https://github.com/user/repository/releases/latest/download/framework-0.1.202104211525141240700.zip"/>
      <xt:version>0.1.202104211525141240700</xt:version>
I'm not sure what's happening behind the scenes, though, in terms of how oXygen is determining what the new version is, so any advice on what I might be doing wrong is very much appreciated!

Thanks,
Joey

Re: updateSite.xml not triggering update

Posted: Thu Apr 22, 2021 1:41 pm
by alex_jitianu
Hi Joey,

It's probably related with the update site. We consider the update site as a sort of namespace. Once you install from an update site, we look for updates to that exact update site. It might be related with this behavior. If you go to Help->Manager installed add-ons... and you hover over the add-on, the update site URL is the same as the one from where the new versions are published? I'm asking because Git redirects the latest release add-on to an URL with the current version in it:

https://github.com/username/repository/ ... teSite.xml

Looking back, I don't think it was a great idea, but now we have one more incentive to change it. I will add an issue to remove the update site URL as a requirement for new versions detection.

Best regards,
Alex

Re: updateSite.xml not triggering update

Posted: Fri Apr 23, 2021 12:35 am
by jtakeda
Hi Alex,

Thanks for this (I didn't realize hovering over the update gave the full information; I kept overthinking it, trying to resize the columns etc, so that's very helpful :-) !

Hovering over the update yields the "releases/latest" URL, which is the same one where the new ones would be accessible before Git redirects it. Just as a bit of background: I was inspired a bit by the way the TEI framework uses Jenkins to release their plugin; I presume that works because Jenkins /lastSuccessfulArtifacts/ URL is an actual URL, and not a redirect to the latest release.

Best,
Joey

Re: updateSite.xml not triggering update

Posted: Fri Apr 23, 2021 1:29 pm
by alex_jitianu
Hi Joey,

Is it a public github repository? I want to install the add-on myself and put some log into Oxygen afterwards.

Best regards,
Alex

Re: updateSite.xml not triggering update

Posted: Fri Apr 23, 2021 9:00 pm
by jtakeda
Hi Alex,

Here's the link to the GitHub repo:

https://github.com/sfu-dhil/lim-schema

The update site link is:

https://github.com/sfu-dhil/lim-schema/ ... teSite.xml

Best,
Joey

Re: updateSite.xml not triggering update

Posted: Mon Apr 26, 2021 12:54 pm
by alex_jitianu
Hi Joey,

It has something to do with the version: 0.1.20210425230253798

When we compare the installed version with remote version we try to parse each version part as an integer. That last timestamp results in a number too large that goes over the integer maximum. We can do things better on our part... we could parse the number as a long, for example.

Meanwhile, perhaps you can use a different environment variable when generating the version, for example GITHUB_RUN_NUMBER ?


Best regards,
Alex

Re: updateSite.xml not triggering update

Posted: Tue Apr 27, 2021 8:43 pm
by jtakeda
Ah ha! That makes a lot of sense. I’ll change that and see if it fixes things. Thanks!