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

feat: [M3-8676] - Provide Customer Notice for OS Distro Nearing EOL/EOS #11253

Merged

Conversation

harsh-akamai
Copy link
Contributor

@harsh-akamai harsh-akamai commented Nov 13, 2024

Description 📝

Add Notice for OS Distro Nearing EOL/EOS

Changes 🔄

  • Added a notice for images that are nearing EOL/EOS

Target release date 🗓️

10/12

Preview 📷

Before After
image image
image image

How to test 🧪

Verification steps

  • Navigate to the Create Linode page
  • Choose an OS that is deprecated
  • You should see a notice similar to the one in Preview

As an Author, I have considered 🤔

  • 👀 Doing a self review
  • ❔ Our contribution guidelines
  • 🤏 Splitting feature into small PRs
  • ➕ Adding a changeset
  • 🧪 Providing/improving test coverage
  • 🔐 Removing all sensitive information from the code and PR description
  • 🚩 Using a feature flag to protect the release
  • 👣 Providing comprehensive reproduction steps
  • 📑 Providing or updating our documentation
  • 🕛 Scheduling a pair reviewing session
  • 📱 Providing mobile support
  • ♿ Providing accessibility support

  • I have read and considered all applicable items listed above.

As an Author, before moving this PR from Draft to Open, I confirmed ✅

  • All unit tests are passing
  • TypeScript compilation succeeded without errors
  • Code passes all linting rules

@harsh-akamai harsh-akamai self-assigned this Nov 13, 2024
@harsh-akamai harsh-akamai marked this pull request as ready for review November 13, 2024 11:06
@harsh-akamai harsh-akamai requested a review from a team as a code owner November 13, 2024 11:06
@harsh-akamai harsh-akamai requested review from hkhalil-akamai and abailly-akamai and removed request for a team November 13, 2024 11:06
Comment on lines 31 to 33
const [imageDeprecatedText, setImageDeprecatedText] = React.useState<
null | string
>(null);
Copy link
Member

@bnussman-akamai bnussman-akamai Nov 13, 2024

Choose a reason for hiding this comment

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

We may want to consider deriving state from existing state rather than creating new state for this.

For example:

  const { data: image } = useImageQuery(
    field.value ?? '',
    Boolean(field.value)
  );

  const showImageDeprecatedWarning =
    image !== undefined && isImageDeprecated(image);

Using extra state here might be fine, but deriving from the existing form state could be beneficial because it would gracefully handle things like reacting to the form being reset for example.

Copy link
Contributor Author

@harsh-akamai harsh-akamai Nov 18, 2024

Choose a reason for hiding this comment

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

What you have recommended makes sense but when I implemented it there is a visible delay for the text displayed. The delay is caused because of the call to useImageQuery. If it is not much of an issue I will push the updated changes

Screen.Recording.2024-11-18.at.1.31.45.PM.mov

Copy link
Member

Choose a reason for hiding this comment

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

That's a fair point. It is a tradeoff. You can make the final call here!

Copy link
Member

Choose a reason for hiding this comment

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

After thinking a little more, I think we should probably do it by deriving for now so that it is constant with with other parts of Linode Create like packages/manager/src/features/Linodes/LinodeCreate/Summary/Summary.tsx for example.

We can probably make some optimizations on the React Query level if we need to address the small delay

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it! Pushed the changes you've mentioned.

Comment on lines 88 to 102
{imageDeprecatedText && (
<Notice
dataTestId="os-distro-deprecated-image-notice"
spacingBottom={0}
spacingTop={16}
variant="warning"
>
<Typography fontFamily={theme.font.bold}>
{imageDeprecatedText}. After this date, this OS distribution will
no longer receive security updates or technical support. We
recommend selecting a newer supported version to ensure continued
security and stability for your linodes.
</Typography>
</Notice>
)}
Copy link
Member

Choose a reason for hiding this comment

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

Rather than having imageDeprecatedText be a string, what do you think about having a boolean control this, and putting the content directly in the JSX

Suggested change
{imageDeprecatedText && (
<Notice
dataTestId="os-distro-deprecated-image-notice"
spacingBottom={0}
spacingTop={16}
variant="warning"
>
<Typography fontFamily={theme.font.bold}>
{imageDeprecatedText}. After this date, this OS distribution will
no longer receive security updates or technical support. We
recommend selecting a newer supported version to ensure continued
security and stability for your linodes.
</Typography>
</Notice>
)}
{image && showImageDeprecatedWarning && (
<Notice
dataTestId="os-distro-deprecated-image-notice"
spacingBottom={0}
spacingTop={16}
variant="warning"
>
<Typography fontFamily={(theme) => theme.font.bold}>
{image.label} will reach its end-of-life on{' '}
{formatDate(image.eol ?? '', { format: 'MM/dd/yyyy' })}. After
this date, this OS distribution will no longer receive security
updates or technical support. We recommend selecting a newer
supported version to ensure continued security and stability for
your linodes.
</Typography>
</Notice>
)}

I find that this is a bit cleaner and more readable.

@@ -42,6 +49,16 @@ export const OperatingSystems = () => {
const onChange = async (image: Image | null) => {
field.onChange(image?.id ?? null);

let deprecatedNoticeText = null;
if (image && isImageDeprecated(image)) {
Copy link
Member

Choose a reason for hiding this comment

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

Most of the images I select seem to have EOL dates in the past. Saying "Debian will reach its end of life on xx/xx/xx" may be a bit confusing if that date is in the past.

We may need different logic or a copy change here so that is makes more sense.

Screenshot 2024-11-13 at 9 53 56 AM

Copy link
Contributor

Choose a reason for hiding this comment

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

ahh beat me to it

@hkhalil-akamai
Copy link
Contributor

A couple comments on the copy, I believe we should take these concerns to UX:

Adding a qualifier

IMO, the phrase "The selected Ubuntu 23.10 will reach ..." doesn't seem valid. It should be qualified, for example "The selected OS distribution, Ubuntu 23.10, will reach ...".

Past EOL dates

Screenshot 2024-11-13 at 10 18 46 AM

We should ask UX for a slight variation of the copy when the EOL date is in the past. As a suggestion we could say:

The selected Ubuntu 23.10 reached its end-of-life on 07/12/2024. This OS distribution no longer receives security updates or technical support. We recommend selecting a newer supported version to ensure continued security and stability for your linodes.

@hkhalil-akamai
Copy link
Contributor

Some distributions marked as deprecated have EOL dates well into the future (up to 4 years in the future in some cases). This is probably the expected behavior, it's just a little surprising.

Screenshot 2024-11-13 at 10 32 51 AM

@harsh-akamai
Copy link
Contributor Author

We should ask UX for a slight variation of the copy when the EOL date is in the past. As a suggestion we could say:
The selected Ubuntu 23.10 reached its end-of-life on 07/12/2024. This OS distribution no longer receives security updates or technical support. We recommend selecting a newer supported version to ensure continued security and stability for your linodes.

I've pushed the changes to ensure the tense matches with the eol date.
@hkhalil-akamai @bnussman-akamai

Copy link

github-actions bot commented Nov 19, 2024

Coverage Report:
Base Coverage: 86.89%
Current Coverage: 86.9%

Copy link
Contributor

@hkhalil-akamai hkhalil-akamai left a comment

Choose a reason for hiding this comment

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

Thanks for responding to feedback!

@hkhalil-akamai hkhalil-akamai added the Add'tl Approval Needed Waiting on another approval! label Nov 20, 2024
@@ -68,6 +79,34 @@ export const OperatingSystems = () => {
value={field.value}
variant="public"
/>
{image && showImageDeprecatedWarning && (
<Notice
dataTestId="os-distro-deprecated-image-notice"
Copy link
Member

Choose a reason for hiding this comment

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

Do we need this dataTestId if we don't have a unit test for this?

@bnussman-akamai bnussman-akamai added Approved Multiple approvals and ready to merge! and removed Add'tl Approval Needed Waiting on another approval! labels Nov 21, 2024
Copy link
Contributor

@abailly-akamai abailly-akamai left a comment

Choose a reason for hiding this comment

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

@harsh-akamai & @bnussman-akamai

I don't fully understand why we're doing an extra image query - why not displaying this within ImageSelect so:

  • every consumer gets the warning
  • we use the images query we already have running and use an effect in the component to conditionally display the warning

Please let me know if there is a good reason not to do this and I'll remove my request (wanted to prevent this to be merged if can be improved)

it's worth noticing the lag with the notice display, especially on a slower connection

@bnussman-akamai
Copy link
Member

bnussman-akamai commented Nov 21, 2024

Doing this within ImageSelect would be nice because we wouldn't have to worry about the useImageQuery thing.

The only "downside" I can think of moving it in there would be: ImageSelect would be less "pure", meaning it would return more than just a Select component, but that might be okay.

If we want to keep this as-is, I could push a change on the React Query level to alleviate the extra fetch

@abailly-akamai
Copy link
Contributor

I'd like to specify the ticket requirement, really - are we to add this notice on all flows? cause if so it's a no brainer

@bnussman-akamai
Copy link
Member

@abailly-akamai Yeah, you make a good point. This would be really nice to have in other flows.

@harsh-akamai
Copy link
Contributor Author

I'd like to specify the ticket requirement, really - are we to add this notice on all flows? cause if so it's a no brainer

@abailly-akamai The ticket specifically mentions to add the notice in the Linodes/Create screen.

@harsh-akamai harsh-akamai removed Do Not Merge Approved Multiple approvals and ready to merge! labels Nov 25, 2024
Comment on lines +112 to +128
<ImageSelect
textFieldProps={{
required: true,
tooltipText:
'Select which images are compatible with this StackScript. "Any/All" allows you to use private images.',
}}
anyAllOption
data-qa-stackscript-target-select
disabled={disabled}
errorText={hasErrorFor('images')}
label="Target Images"
multiple
onChange={onSelectChange}
placeholder="Select image(s)"
value={selectedImages}
variant="public"
/>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Shifted ImageSelect out of the grid so that the banner could cover full width

Copy link
Contributor

@abailly-akamai abailly-akamai left a comment

Choose a reason for hiding this comment

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

Thanks for making this change!

  • Dynamic banner and logic looks great across ImageSelect instances ✅
  • Handling of multiple deprecated images ✅

Screenshot 2024-12-09 at 09 32 28

@linode-gh-bot
Copy link
Collaborator

Cloud Manager UI test results

🎉 469 passing tests on test run #15 ↗︎

❌ Failing✅ Passing↪️ Skipped🕐 Duration
0 Failing469 Passing2 Skipped96m 40s

@jaalah-akamai jaalah-akamai added the Approved Multiple approvals and ready to merge! label Dec 11, 2024
@jaalah-akamai jaalah-akamai merged commit 4afffcb into linode:develop Dec 11, 2024
23 checks passed
Copy link

cypress bot commented Dec 11, 2024

Cloud Manager E2E    Run #6953

Run Properties:  status check passed Passed #6953  •  git commit 4afffcb742: feat: [M3-8676] - Provide Customer Notice for OS Distro Nearing EOL/EOS (#11253)
Project Cloud Manager E2E
Branch Review develop
Run status status check passed Passed #6953
Run duration 30m 01s
Commit git commit 4afffcb742: feat: [M3-8676] - Provide Customer Notice for OS Distro Nearing EOL/EOS (#11253)
Committer Harsh Shankar Rao
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 4
Tests that did not run due to a developer annotating a test with .skip  Pending 2
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 469
View all changes introduced in this branch ↗︎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Multiple approvals and ready to merge! Ready for Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants