Skip to content
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

Encourage source user to be on latest master commit #5934

Closed
olivierlambert opened this issue Oct 6, 2021 · 15 comments · Fixed by #7091
Closed

Encourage source user to be on latest master commit #5934

olivierlambert opened this issue Oct 6, 2021 · 15 comments · Fixed by #7091

Comments

@olivierlambert
Copy link
Member

olivierlambert commented Oct 6, 2021

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?

@Danp2
Copy link
Collaborator

Danp2 commented Oct 6, 2021

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.

@olivierlambert
Copy link
Member Author

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

@julien-f
Copy link
Member

julien-f commented Oct 7, 2021

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.

@Danp2
Copy link
Collaborator

Danp2 commented Oct 8, 2021

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

@ronivay
Copy link
Contributor

ronivay commented Oct 11, 2021

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.

@olivierlambert
Copy link
Member Author

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

@ronivay
Copy link
Contributor

ronivay commented Oct 11, 2021

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.

@olivierlambert
Copy link
Member Author

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.

@ronivay
Copy link
Contributor

ronivay commented Oct 11, 2021

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.

@olivierlambert
Copy link
Member Author

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 :)

@hregibo
Copy link

hregibo commented Apr 11, 2022

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.

@olivierlambert
Copy link
Member Author

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

@julien-f
Copy link
Member

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

@olivierlambert
Copy link
Member Author

Sounds like a great option indeed.

@olivierlambert
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment