-
Notifications
You must be signed in to change notification settings - Fork 300
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
Epic: Enable preventing automatic updates on specific OS versions #3925
Comments
This story may become redundant when #4010 is implemented; let's research first what functionality we can provide by having multiple update channels. We would still want to add a diagnostic that tells the user that they are on a deprecated platform and need to upgrade before they can install further RD updates. Otherwise they might assume the auto-updater is broken and install the update manually. On Windows we could prevent installation in the MSI installer, but for macOS we don't have any way to prevent the user from dragging the new version on top of the old one. |
So when {
"appVersion": "1.6.0",
"extraInfo": {
"platform":"<platform>-<arch>"
}
} The Upgrade Responder server sends back something in the following format: {
"versions": [
{
"Name": "v1.5.0",
"ReleaseDate": "2022-07-28T11:00:00Z",
"Tags": [
"v1.5.0"
]
},
{
"Name": "v0.7.1",
"ReleaseDate": "2021-12-20T14:30:00Z",
"Tags": [
"v0.7.1"
]
},
...
]
} So there is no information about OS version at the moment. The solution that comes to my mind is to fork Upgrade Responder and make a few modifications:
If a requester doesn't include its OS version in the POST request, we know that it is from version 1.7.0 or earlier. So, we are able to treat this case specially in whatever way we choose. Maybe we allow an upgrade to 1.7.1, in which we can add code that sends the OS version? Otherwise, we can configure the Upgrade Responder with information about which versions of Rancher Desktop are supported on which OS-architecture-OS version combinations. If an instance of Rancher Desktop receives info from the Upgrade Responder that indicates that there is a newer version of Rancher Desktop, but this version is not supported for the OS, architecture and OS version indicated in the request, we can make the RD UI display a message along the lines of "please upgrade to a newer version of your OS to use the latest version of RD". |
If we choose to go the route of forking Upgrade Responder, here is what I propose. We change the "response config" that is passed to the UR to something like this: {
"Rules": [
{
"Criteria": {
"CurrentRDVersion": "<1.8.0",
"Platform": "*",
"Arch": "*",
"PlatformVersion": "*"
},
"Constraints": {
"Version": "<=1.8.0"
}
},
{
"Criteria": {
"CurrentRDVersion": "*",
"Platform": "darwin",
"Arch": "*",
"PlatformVersion": "<11.0.0"
},
"Constraints": {
"Version": "<=1.8.0"
}
},
{
"Criteria": {
"CurrentRDVersion": "*",
"Platform": "*",
"Arch": "*",
"PlatformVersion": "*"
},
"Constraints": {
"Version": ">=0.0.0"
}
},
],
"Versions": [
{
"Name": "v1.5.0",
"ReleaseDate": "2022-07-28T11:00:00Z",
"Tags": [
"v1.5.0"
]
},
{
"Name": "v0.7.1",
"ReleaseDate": "2021-12-20T14:30:00Z",
"Tags": [
"v0.7.1"
]
},
...
]
} The When a request comes in, it ideally contains info on the platform, the version of the platform, the architecture, and the current version of RD on the requestor. This info is used to find the first rule that matches. Then, using the {
"versions": [
{
"Name": "v1.5.0",
"Supported": true,
"ReleaseDate": "2022-07-28T11:00:00Z",
"Tags": [
"v1.5.0"
]
},
{
"Name": "v0.7.1",
"Supported": false,
"ReleaseDate": "2021-12-20T14:30:00Z",
"Tags": [
"v0.7.1"
]
},
...
]
} If no rules match, that is considered an error. This is why we have three rules:
I'd optimistically estimate 3 days to make these changes to Upgrade Responder, and another 3 days to get it working on the Rancher Desktop side. These estimates don't include time for reviews. |
This rule is not needed since we will never return rules to requests from versions before 1.8.0, as they have no logic to deal with them. |
We can hard-code that into the changes if you want. Though it will make the code a little messier and less flexible, given that we have to hard-code handling this case. |
Maybe I misunderstand it, but don't you have to hard-code it into the code anyways. Versions before 1.8 don't know about the Otherwise you would need another flag in your rules that says: if this rule matches, don't include unsupported versions in the response. |
Ah, you're right. We'll have to hard-code that then. Might as well eliminate the first rule while we're at it. |
The old code just looked for a |
That is a good idea, so we don't have to hardcode the version in the code. We still don't need the first rule for this though. Unless we let the server set the Similarly we could set a "newest" tag on the very newest release, so the client can tell that there is an unsupported upgrade as well because |
That's a great idea. It might be weird for people to see a "latest" tag on what will end up being a very old version of RD, but we should document all of this in the developer documentation anyways.
It's true that versions of RD before 1.8 (actually 1.9 after deferring this change) have no knowledge of |
Just re-reading the spec and discussion here, and one thing that is irritating me is that the I assume for backwards compatibility reasons that means the rules should use |
I'm wondering of the versions with Otherwise the client can only say "There is a newer version available, but it is not compatible with your system". E.g. the user upgrades from Catalina to Monterey, but it doesn't help because we really need "Ventura". But the user's machine is not compatible with Ventura, so they went through all the effort to upgrade to Monterey for nothing. |
I looked into our options here. Luckily, the current client code properly handles I am confident that we can drop the |
I think I figured out a feasible way of adding better feedback to the For a while I was trying to think of a way to autogenerate a human-readable string from I think the best way to do it is to add a field called {
"Explanation": "macOS 11.0.0 or later is required.",
"Criteria": {
"CurrentRDVersion": "*",
"Platform": "darwin",
"Arch": "*",
"PlatformVersion": "<11.0.0"
},
"Constraints": {
"Version": "<=1.8.0"
}
} This lets us easily handle cases where there are multiple {
"Explanation": "macOS 11.0.0 or later is required on M1 machines.",
"Criteria": {
"CurrentRDVersion": "*",
"Platform": "darwin",
"Arch": "arm64",
"PlatformVersion": "<11.0.0"
},
"Constraints": {
"Version": "<=1.8.0"
}
} But how would this make it through to Rancher Desktop, and then to the UI? I'd suggest adding a field to the response Upgrade Responder gives when {
"versions": [
{
"Name": "v1.5.0",
"Supported": true,
"ReleaseDate": "2022-07-28T11:00:00Z",
"Tags": [
"v1.5.0"
]
},
{
"Name": "v1.10.0",
"Supported": false,
"Explanation": "macOS 11.0.0 or later is required."
"ReleaseDate": "2021-12-20T14:30:00Z",
"Tags": [
"v0.7.1"
]
},
...
]
} This message can then be passed through to the UI. The Latest Version Not SupportedA newer version of Rancher Desktop is available, but not supported on your system. macOS 11.0.0 or later is required. For more information see the installation documentation. We can tweak this message. It might be nice to indicate which version is available for an update but unsupported. Maybe we want someone who knows about UI to weigh in here? |
There should be a story tied to docs but we'll close this. |
The story is #5028, and is about copying the information from this Epic into a permanent location inside the repo itself. |
E.g. if our new release doesn't work on macOS Catalina anymore, we must prevent the auto-updater from downloading and installing it, if the current platform is Catalina. Otherwise we are breaking a working system, with no way to recover but via Factory-Reset and re-installing the old version.
Issues:
wslVersion
field to information Rancher Desktop sends to Upgrade Responder #4561rancher-desktop
branch rancher-desktop-upgrade-responder#3Acceptance Criteria
extraInfo
. If it is not feasible to get the WSL version, wether it's not an App Store version or just not installed at all, it cannot include the WSL key to the Upgrade Responder.The text was updated successfully, but these errors were encountered: