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-8985] - High performance volume indicator #11400

Merged
merged 8 commits into from
Dec 16, 2024

Conversation

dchyrva-akamai
Copy link
Contributor

@dchyrva-akamai dchyrva-akamai commented Dec 11, 2024

Description 📝

Added high performance volume indicator to the Linode details panel and Linode volumes table.

Changes 🔄

  • Created "HighPerformanceVolumeIcon" component.
  • The icon component used to indicate high performance volume on the Linode summary panel.
  • The icon component used to indicate high performance volume in the Linode Volumes table.

Preview 📷

image
image
image

How to test 🧪

  • Create a Linode with 32GB of RAM.
  • Attach any Volume to the newly created Linode.
  • Observe whether the icon appeared or not.

As an Author, to speed up the review process, I 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

@dchyrva-akamai dchyrva-akamai requested a review from a team as a code owner December 11, 2024 13:11
@dchyrva-akamai dchyrva-akamai requested review from mjac0bs and carrillo-erik and removed request for a team December 11, 2024 13:11
@dchyrva-akamai dchyrva-akamai marked this pull request as draft December 11, 2024 13:13
Copy link

github-actions bot commented Dec 11, 2024

Coverage Report:
Base Coverage: 86.98%
Current Coverage: 86.98%

@dchyrva-akamai dchyrva-akamai marked this pull request as ready for review December 11, 2024 15:39
Copy link
Contributor

@mjac0bs mjac0bs 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 the contribution @dchyrva-akamai!

I'm missing some context on this feature. How do we get the necessary new Linode capability? Is this capability currently being returned on any production Linode with 32GB (or more?) RAM? The screenshots show a 1GB Linode. Are there any customer tags necessary for the new capability?

Following the testing steps, I created a 32GB Linode, attached a volume to that Linode, and was not seeing the new Block Storage Performance B1 returned from the linode's prod API endpoint, so therefore saw no high perf icon. (The same was true in the dev environment.)

Screenshot 2024-12-11 at 10 05 01 AM

Note to fellow reviews: On my prod account, I had to first increase my Reputation in Admin to 100 to be able to create a linode with that plan and avoid encountering an account limit error.

packages/api-v4/src/linodes/types.ts Show resolved Hide resolved
Copy link
Member

@bnussman-akamai bnussman-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 opening this PR! Looks great, I just have one stylistic suggestion

packages/manager/src/features/Volumes/VolumeTableRow.tsx Outdated Show resolved Hide resolved
@dchyrva-akamai
Copy link
Contributor Author

Thanks for the contribution @dchyrva-akamai!

I'm missing some context on this feature. How do we get the necessary new Linode capability? Is this capability currently being returned on any production Linode with 32GB (or more?) RAM? The screenshots show a 1GB Linode. Are there any customer tags necessary for the new capability?

Following the testing steps, I created a 32GB Linode, attached a volume to that Linode, and was not seeing the new Block Storage Performance B1 returned from the linode's prod API endpoint, so therefore saw no high perf icon. (The same was true in the dev environment.)

Screenshot 2024-12-11 at 10 05 01 AM

Note to fellow reviews: On my prod account, I had to first increase my Reputation in Admin to 100 to be able to create a linode with that plan and avoid encountering an account limit error.

According to the information available to me in the ticket, availability of the Block Storage Performance B1 capability should activate the icon.

There is a chance that the Back-End side of the feature has not been implemented yet, which is why "How to test" section might be misleading at the moment. The screenshots in the "Preview" section were taken from the local environment.
Unfortunately, I am not in contact with the Back-End team responsible for this part of the feature and cannot provide you with the status of the implementation from their side.

@skulpok-akamai
Copy link
Contributor

skulpok-akamai commented Dec 12, 2024

Thanks for the contribution @dchyrva-akamai!
I'm missing some context on this feature. How do we get the necessary new Linode capability? Is this capability currently being returned on any production Linode with 32GB (or more?) RAM? The screenshots show a 1GB Linode. Are there any customer tags necessary for the new capability?
Following the testing steps, I created a 32GB Linode, attached a volume to that Linode, and was not seeing the new Block Storage Performance B1 returned from the linode's prod API endpoint, so therefore saw no high perf icon. (The same was true in the dev environment.)
Screenshot 2024-12-11 at 10 05 01 AM
Note to fellow reviews: On my prod account, I had to first increase my Reputation in Admin to 100 to be able to create a linode with that plan and avoid encountering an account limit error.

According to the information available to me in the ticket, availability of the Block Storage Performance B1 capability should activate the icon.

There is a chance that the Back-End side of the feature has not been implemented yet, which is why "How to test" section might be misleading at the moment. The screenshots in the "Preview" section were taken from the local environment. Unfortunately, I am not in contact with the Back-End team responsible for this part of the feature and cannot provide you with the status of the implementation from their side.

Hi mjac0bs, most likely the feature has not been rolled out yet on the API side (I'm trying to find out if that's the case). We decided to create a PR for this feature to get early feedback, and also because these are non-breaking changes - there are no visual changes in the UI when Block Storage Performance B1 is not present, so it's not crucial for the API part to be implemented first. I understand that it's hard to test this feature in this state (an instance object must be altered from the browser console to include Block Storage Performance B1), so we can wait with merging the changes into develop until we know that the API part is ready.

Comment on lines 16 to 30
return (
isHighPerformanceVolume && (
<Tooltip arrow title="High Performance">
<IconButton
sx={{
border: '1px solid',
borderRadius: '50%',
padding: 0,
}}
>
<BoltIcon sx={{ fontSize: 12 }} />
</IconButton>
</Tooltip>
)
);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return (
isHighPerformanceVolume && (
<Tooltip arrow title="High Performance">
<IconButton
sx={{
border: '1px solid',
borderRadius: '50%',
padding: 0,
}}
>
<BoltIcon sx={{ fontSize: 12 }} />
</IconButton>
</Tooltip>
)
);
if (!isHighPerformanceVolume) {
return null;
}
return (
<Tooltip arrow title="High Performance">
<IconButton
sx={{
border: '1px solid',
borderRadius: '50%',
padding: 0,
}}
>
<BoltIcon sx={{ fontSize: 12 }} />
</IconButton>
</Tooltip>
);

);
}

export default HighPerformanceVolumeIcon;
Copy link
Member

Choose a reason for hiding this comment

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

Let's remove this default export and export the function instead. We prefer named exports in our codebase. (docs)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bnussman-akamai Should also be resolved.

linodeCapabilities?: LinodeCapabilities[];
}

function HighPerformanceVolumeIcon({ linodeCapabilities }: Props) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
function HighPerformanceVolumeIcon({ linodeCapabilities }: Props) {
export function HighPerformanceVolumeIcon({ linodeCapabilities }: Props) {

packages/manager/src/features/Volumes/VolumeTableRow.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@mjac0bs mjac0bs left a comment

Choose a reason for hiding this comment

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

Left a couple comments on spacing and below. Approving pending feedback is addressed; Banks had some good thoughts as well.

We decided to create a PR for this feature to get early feedback, and also because these are non-breaking changes

++ We appreciate this - it's helpful to be able to provide early feedback!

I understand that it's hard to test this feature in this state (an instance object must be altered from the browser console to include Block Storage Performance B1), so we can wait with merging the changes into develop until we know that the API part is ready.

We often mock API data and use our Mock Service Worker dev tool when doing development; I wanted to be sure that was what we'd need to do to test. We can modify code like the linodeSeeder to mock a linode with the new capability.

      seedEntities: linodeFactory.buildList(count, {
        capabilities: ['Block Storage Performance B1'],
      }),
Screen.Recording.2024-12-12.at.9.27.57.AM.mov

I recommend adding test coverage. For example, adding on to our existing VolumeTableRow.test.tsx:

describe('Volume table row - for linodes detail page', () => {
  it('should show a high performance icon tooltip if Linode has the capability', async () => {
    const { getByLabelText, getByText } = await renderWithThemeAndRouter(
      wrapWithTableBody(
        <VolumeTableRow
          handlers={handlers}
          isDetailsPageRow
          linodeCapabilities={['Block Storage Performance B1']}
          volume={attachedVolume}
        />
      )
    );

    const highPerformanceIcon = getByLabelText('High Performance');

    expect(highPerformanceIcon).toBeVisible();
    await userEvent.click(highPerformanceIcon);
    await waitFor(() => expect(getByText('High Performance')).toBeVisible());
  });

@mjac0bs mjac0bs added the Add'tl Approval Needed Waiting on another approval! label Dec 12, 2024
@bnussman-akamai bnussman-akamai changed the title feat: [M3-8985] - High performance volume indicator added. feat: [M3-8985] - High performance volume indicator Dec 12, 2024
@bnussman-akamai bnussman-akamai added the Volumes Relating to Volumes (aka Block Storage) label Dec 12, 2024
@@ -20,7 +20,7 @@ export interface Linode {
id: number;
alerts: LinodeAlerts;
backups: LinodeBackups;
capabilities?: LinodeCapabilities[]; // @TODO BSE: Remove optionality once BSE is fully rolled out
Copy link
Member

@bnussman-akamai bnussman-akamai Dec 13, 2024

Choose a reason for hiding this comment

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

I went ahead and pushed f80e9e9 to improve some types. I also removed the optionality here.

@dwiley-akamai @hkhalil-akamai Do you guys think this change is okay? From what I can see, capabilities is fully rolled out

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, we should be good to go with that. I'll circle back to review other instances as part of M3-8405

@dwiley-akamai dwiley-akamai self-requested a review December 13, 2024 17:07
packages/api-v4/.changeset/pr-11400-added-1733998451458.md Outdated Show resolved Hide resolved
@@ -20,7 +20,7 @@ export interface Linode {
id: number;
alerts: LinodeAlerts;
backups: LinodeBackups;
capabilities?: LinodeCapabilities[]; // @TODO BSE: Remove optionality once BSE is fully rolled out
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, we should be good to go with that. I'll circle back to review other instances as part of M3-8405

Copy link
Contributor

@mjac0bs mjac0bs left a comment

Choose a reason for hiding this comment

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

Just noticed a couple more things.

(And pushed updates for them in cd87815. cc @dchyrva-akamai )

@linode-gh-bot
Copy link
Collaborator

Cloud Manager UI test results

🔺 1 failing test on test run #8 ↗︎

❌ Failing✅ Passing↪️ Skipped🕐 Duration
1 Failing465 Passing5 Skipped103m 43s

Details

Failing Tests
SpecTest
smoke-delete-linode.spec.tsdelete linode » "before all" hook for "deletes linode from linode details page"

Troubleshooting

Use this command to re-run the failing tests:

yarn cy:run -s "cypress/e2e/core/linodes/smoke-delete-linode.spec.ts"

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

We often mock API data and use our Mock Service Worker dev tool when doing development; I wanted to be sure that was what we'd need to do to test. We can modify code like the linodeSeeder to mock a linode with the new capability.

That's very useful, thanks for sharing!

@mjac0bs
Copy link
Contributor

mjac0bs commented Dec 16, 2024

Feedback has been addressed and the last CI run had a test failure that is unrelated to this PR - looks like flake. I'm going to merge this now. Thanks @dchyrva-akamai and @skulpok-akamai 🚀

@mjac0bs mjac0bs merged commit b703190 into linode:develop Dec 16, 2024
22 of 23 checks passed
Copy link

cypress bot commented Dec 16, 2024

Cloud Manager E2E    Run #6975

Run Properties:  status check failed Failed #6975  •  git commit b703190465: feat: [M3-8985] - High performance volume indicator (#11400)
Project Cloud Manager E2E
Branch Review develop
Run status status check failed Failed #6975
Run duration 29m 41s
Commit git commit b703190465: feat: [M3-8985] - High performance volume indicator (#11400)
Committer Dmytro Chyrva
View all properties for this run ↗︎

Test results
Tests that failed  Failures 1
Tests that were flaky  Flaky 0
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 465
View all changes introduced in this branch ↗︎

Tests for review

Failed  cypress/e2e/core/linodes/clone-linode.spec.ts • 1 failed test

View Output Video

Test Artifacts
clone linode > can clone a Linode from Linode details page Screenshots Video

@dchyrva-akamai dchyrva-akamai deleted the feature/M3-8985 branch December 17, 2024 08:28
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! Volumes Relating to Volumes (aka Block Storage)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants