-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Connect My Computer: Keeping compatibility promise #31951
Conversation
bdeb65d
to
dd2bbab
Compare
@roraback WDYT of the proposed designs? |
dd2bbab
to
fad2508
Compare
fad2508
to
bfacfa0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking if there's a way to simplify the logic by having an enum instead of a bool to answer the question "is the agent compatible?", like "compatible" | "agentTooOld" | "agentTooNew"
, but I don't think it'd help much here.
I'm still not sure about recommending the downgrade of the app, but I guess it makes sense in a scenario where the user uses our cloud and cannot downgrade the cluster.
In all other cases I'd assume that the person using Connect My Computer is also the cluster admin in some sense and has control over the version.
web/packages/teleterm/src/ui/ConnectMyComputer/CompatibilityPromise.tsx
Outdated
Show resolved
Hide resolved
web/packages/teleterm/src/ui/ConnectMyComputer/CompatibilityPromise.tsx
Outdated
Show resolved
Hide resolved
web/packages/teleterm/src/ui/ConnectMyComputer/CompatibilityPromise.tsx
Outdated
Show resolved
Hide resolved
.../ConnectMyComputer/DocumentConnectMyComputerStatus/DocumentConnectMyComputerStatus.story.tsx
Show resolved
Hide resolved
web/packages/teleterm/src/ui/ConnectMyComputer/connectMyComputerContext.tsx
Outdated
Show resolved
Hide resolved
...ui/ConnectMyComputer/DocumentConnectMyComputerSetup/DocumentConnectMyComputerSetup.story.tsx
Outdated
Show resolved
Hide resolved
web/packages/teleterm/src/ui/ConnectMyComputer/CompatibilityPromise.tsx
Outdated
Show resolved
Hide resolved
web/packages/teleterm/src/ui/ConnectMyComputer/CompatibilityPromise.tsx
Outdated
Show resolved
Hide resolved
web/packages/teleterm/src/ui/ConnectMyComputer/CompatibilityPromise.tsx
Outdated
Show resolved
Hide resolved
…eRootCluster`/`makeLeafCluster`
Yeah, I thought exactly about the cloud case. |
runtimeSettings: Pick<RuntimeSettings, 'appVersion' | 'isLocalBuild'> | ||
): boolean { | ||
const { appVersion, isLocalBuild } = runtimeSettings; | ||
const isClusterOnOlderVersion = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const isClusterOnOlderVersion = | |
const isAgentOnOlderVersion = |
web/packages/teleterm/src/ui/ConnectMyComputer/CompatibilityPromise.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really solid now. I submitted one more suggestion to indicate incompatibility issues in the navigation menu icon.
@@ -283,7 +283,7 @@ export const ConnectMyComputerContextProvider: FC<{ | |||
const shouldAutoStartAgent = | |||
isAgentConfigured && | |||
canUse && | |||
!isNonCompatibleAgent && | |||
isAgentCompatible && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This made me realize: if the agent has been configured but it wasn't started because it's no longer compatible with the proxy, maybe we could display a warning indicator in the icon?
It should be a matter of doing this but please double check this:
diff --git a/web/packages/teleterm/src/ui/ConnectMyComputer/NavigationMenu.tsx b/web/packages/teleterm/src/ui/ConnectMyComputer/NavigationMenu.tsx
index ac8405ceda..25d92d7d55 100644
--- a/web/packages/teleterm/src/ui/ConnectMyComputer/NavigationMenu.tsx
+++ b/web/packages/teleterm/src/ui/ConnectMyComputer/NavigationMenu.tsx
@@ -112,15 +112,28 @@ export function NavigationMenu() {
function getIndicatorStatus(
currentAction: CurrentAction,
- isAgentConfiguredAttempt: Attempt<boolean>
+ isAgentConfiguredAttempt: Attempt<boolean>,
+ isAgentCompatible: boolean
): IndicatorStatus {
if (isAgentConfiguredAttempt.status === 'error') {
return 'error';
}
+ const isAgentConfigured =
+ isAgentConfiguredAttempt.status === 'success' &&
+ isAgentConfiguredAttempt.data;
+
+ if (!isAgentConfigured) {
+ return '';
+ }
+
if (currentAction.kind === 'observe-process') {
switch (currentAction.agentProcessState.status) {
case 'not-started': {
+ if (!isAgentCompatible) {
+ return 'error';
+ }
+
return '';
}
case 'error': {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! We should definitely show it on the icon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realized that in an ideal world, the error indicator would only show up if autostart was prevented due to incompatibility issues. Otherwise if you configure the agent, stop it and compatibility issues occur in the future, you're going to see the error indicator even though you're not actively using the agent.
Anyways, I think we can keep it as it is, at least it'll nudge those users towards an upgrade of Connect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it would be better, but IMO it's still not bad, at least users will be more aware that they are using an incompatible version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran into another issue with the indicator.
isAgentCompatible
looks at rootCluster.proxyVersion
, but this information is not immediately available. So if I configure my agent and then restart the app, the indicator will show a warning color until the app fetches detailed information about the cluster.
I think we should be able to fix this by replacing isAgentCompatible
with agentCompatibility
that can be one of three values: compatible, incompatible, unknown. I'll attempt to fix it next week.
Also, during the review I forgot that differentiating between success & error states with just color is usually not enough for users with red-green confusion.
Screen.Recording.2023-09-22.at.15.57.05.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I didn't think of it 😞
I think we should be able to fix this by replacing isAgentCompatible with agentCompatibility that can be one of three values: compatible, incompatible, unknown.
👍
As for colors, probably we should use an icon? I can take a look at it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, an icon would be a good solution.
, clusters don't support clients that are on a newer major version. If | ||
you wish to connect your computer,{' '} | ||
{isAppDowngradePossible && ( | ||
<>downgrade the app to {downgradeAppTo} or </> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed also in the upgrade suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can also cut out "If you wish" and say To connect your computer, downgrade...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, now it says: To use Connect My Computer, downgrade...
(we already changed the copy a bit).
I think the designs work well for now. Thanks for pinging me! FYI, longer term I'd love to move to a different error message style that Rishi has been working on, and that handles CTAs and two levels of text more gracefully, but the designs are quite new and aren't implemented, yet. |
@@ -283,7 +283,7 @@ export const ConnectMyComputerContextProvider: FC<{ | |||
const shouldAutoStartAgent = | |||
isAgentConfigured && | |||
canUse && | |||
!isNonCompatibleAgent && | |||
isAgentCompatible && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realized that in an ideal world, the error indicator would only show up if autostart was prevented due to incompatibility issues. Otherwise if you configure the agent, stop it and compatibility issues occur in the future, you're going to see the error indicator even though you're not actively using the agent.
Anyways, I think we can keep it as it is, at least it'll nudge those users towards an upgrade of Connect.
# Conflicts: # web/packages/teleterm/src/ui/ConnectMyComputer/DocumentConnectMyComputerSetup/DocumentConnectMyComputerSetup.tsx # web/packages/teleterm/src/ui/ConnectMyComputer/DocumentConnectMyComputerStatus/DocumentConnectMyComputerStatus.tsx # web/packages/teleterm/src/ui/ConnectMyComputer/connectMyComputerContext.tsx
* Add server version to cluster * Add components to display compatibility promise * Show compatibility promise on status page * Show compatibility promise on setup page * Rename `serverVersion` -> `proxyVersion`, make all places to use `makeRootCluster`/`makeLeafCluster` * Move `UpgradeAgentSuggestion` to a new file, make it stateless * Return `isAgentCompatible` instead of `isNonCompatibleAgent` from context * Add // DELETE IN comments * Improve copies * Add a story for too old client in Setup * Extract CONNECT_MY_COMPUTER_RELEASE_MAJOR_VERSION * Run prettier * Fix license * Show an error on the CMC icon when the agent is not compatible * Always say "version" before the version number * Adjust tests * Drop "if you wish" from the copies (cherry picked from commit 81c352c)
* Add server version to cluster * Add components to display compatibility promise * Show compatibility promise on status page * Show compatibility promise on setup page * Rename `serverVersion` -> `proxyVersion`, make all places to use `makeRootCluster`/`makeLeafCluster` * Move `UpgradeAgentSuggestion` to a new file, make it stateless * Return `isAgentCompatible` instead of `isNonCompatibleAgent` from context * Add // DELETE IN comments * Improve copies * Add a story for too old client in Setup * Extract CONNECT_MY_COMPUTER_RELEASE_MAJOR_VERSION * Run prettier * Fix license * Show an error on the CMC icon when the agent is not compatible * Always say "version" before the version number * Adjust tests * Drop "if you wish" from the copies (cherry picked from commit 81c352c)
Contributes to #27881
This PR adds a compatibility information when the agent is not compatible with the cluster or is on a lower version and can be upgraded.
You can read more about it in the RFD [Agent versioning].
Short example: when the cluster is on version v15 it supports components (clients, nodes) that are on versions v15 and v14.
Setup
Status
Not compatible
Upgrade suggestion (I'm not sure if the copy reads well here, any recommendations are welcome)