Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

General: Validate if current process OpenPype version is requested version #2529

Conversation

iLLiCiTiT
Copy link
Member

@iLLiCiTiT iLLiCiTiT commented Jan 13, 2022

Brief description

Added periodical checks of OpenPype version.

Description

Main change is affecting OpenPype tray application. A dialog with information about outdated OpenPype version is shown. If dialog is closed or ignore button is clicked a tray message will popup.

Ftrack event server statuser will show information if is up to date.

Changes

  • moved few functions in lib and added new for checking if version of currently running process is up to date
  • tray will check each 5 minutes if is up to date with expected version
    • will show a dialog with ability to restart tray
  • restart of tray will unset OPENPYPE_VERSION environment for new process
    • this is to trigger update if needed
  • ftrack event server statuser has new category OpenPype version with info about current OpenPype version

Testing notes:

  1. Build OpenPype
  2. Create a zip with higher version
  3. Optional: Remove versions from appdata...
  4. Set path to openpype versions to some empty directory
  5. Run tray from the build
  6. Move the created zip with higher version to openpype versions dir
  7. Wait for 5 minutes
  8. Popup should be shown
    • you can press Ignore window will close and tray message will show
    • press "Restart and Change" should trigger restart of tray and also update

Alternative to not wait 5 minutes (code modification needed)

In build go to ~/openpype/tools/tray/pype_tray.py on line 375 is method _on_version_action modify it to

def _on_version_action(self):
    self._version_check_timer.timeout.emit()
    ...

Now when you click on version action in tray menu it should trigger version validation.

Notes

  • any changes of messages are welcomed
  • we could maybe change color of tray icon or add icon to version action (e.g. exclamation mark) or just change color of action text
  • color of "Restart and Change" could be maybe changed to better color?
  • It can happen that it is not possible to validate if current version is that which should be used. Should we tell user on start?

Screenshot of dialog showed from Tray

image

@mkolar
Copy link
Member

mkolar commented Jan 13, 2022

@iLLiCiTiT iLLiCiTiT self-assigned this Jan 13, 2022
@iLLiCiTiT iLLiCiTiT added the type: enhancement Enhancements to existing functionality label Jan 13, 2022
@iLLiCiTiT iLLiCiTiT changed the title Feature/op 2360 validate if current open pype version is production version General: Validate if current process OpenPype version is requested version Jan 13, 2022
@tokejepsen
Copy link
Member

Is the wait time (5 minutes) configurable in the settings?

@@ -369,7 +369,7 @@ def __init__(self, project_name, parent):
cancel_btn = QtWidgets.QPushButton("Cancel", self)
cancel_btn.setToolTip("Cancel deletion of the project")
confirm_btn = QtWidgets.QPushButton("Permanently Delete Project", self)
confirm_btn.setObjectName("DeleteButton")
confirm_btn.setObjectName("WarningButton")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it correct that GitHub is showing these style changes for Project Manager in this PR? Or has there been a merge conflict?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed the object name because it's using same colors and has same purpose.

@iLLiCiTiT
Copy link
Member Author

Is the wait time (5 minutes) configurable in the settings?

It wasn't, added.

Does make sense to use decimal points for this validation like each 0.5 minutes?

@tokejepsen
Copy link
Member

Does make sense to use decimal points for this validation like each 0.5 minutes?

Unless its a bother to implement later, I would stick with whole minutes. Dont think anyone cant wait 1 minute for an update.

@BigRoy
Copy link
Collaborator

BigRoy commented Jan 14, 2022

Unless its a bother to implement later, I would stick with whole minutes. Dont think anyone cant wait 1 minute for an update.

I mean, if there's an Update Now button in the Version pop-up window users could always go down that route. Haven't checked myself but is that there? If not, should it be there? I guess just shutting down OP + starting it manually isn't that much effort either.

But yes, integer minutes sounds fine.

Ignore, what then?

If a user clicks Ignore. What happens? Do they get the callback again after 5 minutes?

Pop-up too aggressive message?

Also, I feel Wrong OpenPype version in the dialog bar feels wrong. It should feel more "hey, there's a new update!" than "you did something wrong / are using the wrong software"

How about changing the pop-up to something like this:

TITLE

A new version of OpenPype is available or OpenPype update available

MESSAGE

You're using OpenPype version 3.8.0-nightly.3. New studio version 3.8.0-nightly.4 is available now.

Similarly Restart & Change I think should be either just Update or Restart & Update
Ignore could also be Later? Not sure if better.

Slack reference

I also liked that e.g. Slack would have update messages come with a little wrapped present icon. As if you're about to receive something nice!" See below:

@iLLiCiTiT
Copy link
Member Author

iLLiCiTiT commented Jan 14, 2022

I mean, if there's an Update Now button in the Version pop-up window users could always go down that route. Haven't checked myself but is that there? If not, should it be there? I guess just shutting down OP + starting it manually isn't that much effort either.

It's not there, should be there, not goal of this PR. This is more for artists that start OpenPype only when PC is restarted (once in month) so they do not catch new updates at all.

Do they get the callback again after 5 minutes?

Yes.

Also, I feel Wrong OpenPype version in the dialog bar feels wrong. It should feel more "hey, there's a new update!" than "you did something wrong / are using the wrong software"

I agree it's aggresive. I wanted to avoid using "update" because you can downgrade e.g. when latest version breaks production you can in settings set older version that should be used in studio. So it's not like "Hey there is new update" but more like "You should use different version then you're using now".

Ignore could also be Later? Not sure if better.

I like "Later". Much better than "Ignore".

EDITED: Maybe Later could trigger the message in next interval and Ignore would stop the validation so there would be 3 buttons?

@iLLiCiTiT
Copy link
Member Author

I expect this notification should be modified too. This is what is shown when you hit Ignore/Later.

image

@mkolar
Copy link
Member

mkolar commented Jan 14, 2022

@BigRoy I agree with all points with a few minor tweaks.

TITLE

OpenPype update is needed

I'd use needed or required because it really shouldn't be the artist choice here, apart from possibly postponing it.

MESSAGE

Running OpenPype version is 3.8.0-nightly.3. Your production has been updated to version 3.8.0-nightly.4.


Similarly Restart & Change I think should be either just Update or Restart & Update

Restart & Update is the best I think

Ignore could also be Later? Not sure if better.

Later is great. In later PRs we can add a little dropdown with an option to postpone, so users could bypass the 5 minutes for a certain period.

I do like the idea with a little present icon. Even though you can't really choose not to unwrap it :D


Regarding the notification
Title: OpenPype version is outdated
Message: Please update your OpenPype as soon as possible. To update, restart OpenPype Tray application.

@mkolar
Copy link
Member

mkolar commented Jan 14, 2022

EDITED: Maybe Later could trigger the message in next interval and Ignore would stop the validation so there would be 3 buttons?

I'd leave this for another PR, but ideally it should postpone until next interval by (say 5 minutes by default), but give dropdown option with local override, same as with many notifications.
Something like this (without the forever option)
image

@iLLiCiTiT
Copy link
Member Author

Current state

Dialog

image

Notification

image

Tray menu

  • added action Restart & Update to tray menu which is visible when the validation do not pass
    image

Copy link
Collaborator

@BigRoy BigRoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't done a full code review nor tested locally but just going based on the screenshots. Looking good to me!

@64qam
Copy link
Member

64qam commented Jan 17, 2022

The action Restart & Update doesn't show up in the tray menu. Everything else is ok

@iLLiCiTiT
Copy link
Member Author

The action Restart & Update doesn't show up in the tray menu. Everything else is ok

What a shame. I didn't push last commit.

@64qam
Copy link
Member

64qam commented Jan 17, 2022

All good now

@iLLiCiTiT iLLiCiTiT merged commit 44505cc into develop Jan 17, 2022
@iLLiCiTiT iLLiCiTiT deleted the feature/OP-2360_Validate-if-current-OpenPype-version-is-production-version branch January 19, 2022 10:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: enhancement Enhancements to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants