xen-orchestra icon indicating copy to clipboard operation
xen-orchestra copied to clipboard

Encourage source user to be on latest master commit

Open olivierlambert opened this issue 3 years ago • 12 comments

This is a pretty important thing, helping both users and us to get more feedback on latest code (also avoiding useless requests on outdated XO source install).

To do that, we could have a way to detect if the current source install is not the latest one available on master, and display the information in the UI. I think that's not too hard to do, what do you think?

olivierlambert avatar Oct 06 '21 11:10 olivierlambert

I think this would be good as long as you don't make the notification obnoxious. Maybe a simple indicator that you could hover or click to get more info.

Danp2 avatar Oct 06 '21 13:10 Danp2

Yes, I didn't have in mind something that would be too bothering. It should be visible and understandable :)

olivierlambert avatar Oct 06 '21 13:10 olivierlambert

Detecting that XO is on latest commit is not an easy thing to do.

And it's even harder to check that all apps have been correctly rebuilt.

julien-f avatar Oct 07 '21 12:10 julien-f

Maybe a monthly reminder that the installation is xxx commits behind?

Danp2 avatar Oct 08 '21 12:10 Danp2

I doubt there’s a way to determine the current commit from XO itself. Version number could probably be checked but even then one might not even have internet access from their XO, depending on usecase so some other message should replace that then.

Not against making a reminder to stay up to date, but trying to make it too smart probably causes more confusion as there’s so many cornercases.

ronivay avatar Oct 11 '21 15:10 ronivay

That's easy as long you get the .git folder, which should be the case on sources installations :)

olivierlambert avatar Oct 11 '21 15:10 olivierlambert

That's easy as long you get the .git folder, which should be the case on sources installations :)

Sure technically you can. Personally I wouldn't expect a software to dig this though. You can't tell right away where the thing was cloned from and .git directory might even contain sensitive information, like passwords. Also nothing prevents to skip using git at all and then .git directory wouldn't exist. One can't make assumptions just based on the correct way of installation.

ronivay avatar Oct 11 '21 16:10 ronivay

If there's a .git folder, it's almost sure it's because it was installed via a git clone :) At least, that's the intended way we document :)

That's why we'll try to get to make a PoC on this, but obviously this won't block XO installation if it's not the case, something like "unknown" version or so.

olivierlambert avatar Oct 11 '21 16:10 olivierlambert

Yeah 9/10 it's installed following your official documentation. Trying to say that .git directory is sort of something where one doesn't expect the software to go to. I mean for example, i've forked xen-orchestra repo and have cloned it using some credentials from my own fork which are now stored inside .git directory. Do you think XO has any business to go poke inside that directory even if it wouldn't look at the config file where the credentials are? I think no. That's what i meant that there are cases which you can't predict just because there's a .git directory.

ronivay avatar Oct 11 '21 16:10 ronivay

There's already existing Open Source software fetching the latest git commit from git log, so I'm sure it will be trivial to do it :)

olivierlambert avatar Oct 11 '21 17:10 olivierlambert

It is indeed quite trivial to do, and git allows to even correctly format the latest commit hash to only get the hash back without the commit message.

The code should exclusively check current hash version, query what is the latest commit hash in origin/ and if it differs, tell the user he is not up-to-date with the git repository.

Maybe a (1) badge in the same page XOA people can register their emails for updates, as it is already a dedicated "fetch updates" page.

hregibo avatar Apr 11 '22 05:04 hregibo

Telling users they are outdated might be doable yes :) (as long they have the .git folder)

olivierlambert avatar Apr 11 '22 08:04 olivierlambert

We might wanna use the GitHub REST API for this: https://api.github.com/repos/vatesfr/xen-orchestra/commits/master

julien-f avatar Jan 13 '23 10:01 julien-f

Sounds like a great option indeed.

olivierlambert avatar Jan 13 '23 10:01 olivierlambert

  1. Remove xo-web/server version number
  2. Fetch commit number and compare to see if up to date

olivierlambert avatar Sep 18 '23 09:09 olivierlambert