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

fix: [M3-8726] - Users unable to upgrade Kubernetes version from landing page #11056

Conversation

bnussman-akamai
Copy link
Member

@bnussman-akamai bnussman-akamai commented Oct 7, 2024

Description 📝

Preview 📷

Before After
Screen.Recording.2024-10-07.at.3.49.26.PM.mov
Screen.Recording.2024-10-07.at.3.55.16.PM.mov

How to test 🧪

Reproduction steps

  • Spin up a Kubernetes cluster that is not on the latest version
  • Attempt the upgrade flow on the Kubernetes landing page
  • Observe that when clicking "Upgrade Version", the dialog will not proceed to step 2

Verification steps

  • Spin up a Kubernetes cluster that is not on the latest version
  • Test the upgrade flow on the Kubernetes landing page
  • Verify you see step 1 and step 2

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

@bnussman-akamai bnussman-akamai added the LKE Related to Linode Kubernetes Engine offerings label Oct 7, 2024
@bnussman-akamai bnussman-akamai self-assigned this Oct 7, 2024
@bnussman-akamai bnussman-akamai requested review from a team as code owners October 7, 2024 19:56
@bnussman-akamai bnussman-akamai requested review from cliu-akamai, hkhalil-akamai and jaalah-akamai and removed request for a team October 7, 2024 19:56
Copy link

github-actions bot commented Oct 7, 2024

Coverage Report:
Base Coverage: 86.95%
Current Coverage: 86.95%

@@ -98,7 +98,7 @@ export const KubernetesLanding = () => {

const isRestricted = profile?.restricted ?? false;

const { data, error, isFetching } = useKubernetesClustersQuery(
Copy link
Member Author

Choose a reason for hiding this comment

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

For context

isLoading is true whenever the first fetch for the query is in-flight
isFetching is true whenever any fetch for the query is in-flight

Explanation

In the upgrade dialog, useKubernetesClusterMutation is called, which invalidates the paginated list of Kubernets clusters, which causes useKubernetesClustersQuery's isFetching to become true, which unmounted the upgrade dialog because of the if statement below. Switching to isLoading allows the Upgrade dialog to stay mounted during the upgrade, which fixes the bug

There are probably other ways to fix this bug. For example, the UpgradeVersionModal component could probably be made more robust. I decided to go with this fix because I think isLoading is the desired loading state here rather than isFetching anyway

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the context. Agreed that the dialog is not in the best shape but that is out of scope.

@coliu-akamai
Copy link
Contributor

The recent test addition was failing on my end when I ran it locally, but I saw it passed in this run here (and then I tried rerunning the tests but received a couple errors - not sure if I'm missing permissions or something?). Will look into some more!

image

@bnussman-akamai bnussman-akamai added the Bug Fixes for regressions or bugs label Oct 8, 2024
Copy link
Contributor

@jaalah-akamai jaalah-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 catching and will keep an eye on this detail for future
Screenshot 2024-10-08 at 11 08 56 AM

@mjac0bs mjac0bs self-requested a review October 8, 2024 18:01
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 fixing this. Can we convert the internal PDI ticket to an M3 ticket, so we have it in our project, and update this PR title?

I don't know how Jaalah managed to get the tests to pass. I was seeing the same thing as Connie. Left a comment on the spec about what seems to fix it.

Other than that, this looks good for approving pending the test update!

Comment on lines 248 to 255
ui.button
.findByTitle('Upgrade Version')
.should('be.visible')
.should('be.enabled')
.click();

mockGetClusters([updatedCluster]).as('getClusters');
cy.wait(['@updateCluster', '@getClusters']);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
ui.button
.findByTitle('Upgrade Version')
.should('be.visible')
.should('be.enabled')
.click();
mockGetClusters([updatedCluster]).as('getClusters');
cy.wait(['@updateCluster', '@getClusters']);
mockGetClusters([updatedCluster]).as('getClusters');
ui.button
.findByTitle('Upgrade Version')
.should('be.visible')
.should('be.enabled')
.click();
cy.wait(['@updateCluster', '@getClusters']);

This appears to be what we actually need here to get the version to update to 1.26. I am not 100% clear on why the mock needs to go before the user action, but know that often when the right requests are being made, but the right data isn't showing, it's this kind of (timing?) issue.

Copy link
Contributor

Choose a reason for hiding this comment

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

glad I wasn't going crazy! I'm also curious to how this test managed to pass in the automatic test checks when it's been failing for us.. 😅

Copy link
Contributor

Choose a reason for hiding this comment

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

Also seeing this test fail locally.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch @mjac0bs

I knew something felt weird when I wrote that

Fixed in 1d66657

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 looking into this and adding relevant tests 🧪. Also seeing flake in the new test along with @mjac0bs. Approved pending test is fixed and fix changeset is added.

@@ -98,7 +98,7 @@ export const KubernetesLanding = () => {

const isRestricted = profile?.restricted ?? false;

const { data, error, isFetching } = useKubernetesClustersQuery(
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the context. Agreed that the dialog is not in the best shape but that is out of scope.

Comment on lines 248 to 255
ui.button
.findByTitle('Upgrade Version')
.should('be.visible')
.should('be.enabled')
.click();

mockGetClusters([updatedCluster]).as('getClusters');
cy.wait(['@updateCluster', '@getClusters']);
Copy link
Contributor

Choose a reason for hiding this comment

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

Also seeing this test fail locally.

@hkhalil-akamai hkhalil-akamai added Approved Multiple approvals and ready to merge! Missing Changeset labels Oct 8, 2024
@bnussman-akamai bnussman-akamai changed the title fix: [PDI-3057] - Users unable to upgrade Kubernetes version from landing page fix: [M3-8726] - Users unable to upgrade Kubernetes version from landing page Oct 8, 2024
@bnussman-akamai bnussman-akamai merged commit 3e6d480 into linode:develop Oct 8, 2024
20 checks passed
Copy link

cypress bot commented Oct 9, 2024

Cloud Manager E2E    Run #6644

Run Properties:  status check failed Failed #6644  •  git commit 3e6d480c7c: fix: [M3-8726] - Users unable to upgrade Kubernetes version from landing page (#...
Project Cloud Manager E2E
Run status status check failed Failed #6644
Run duration 27m 08s
Commit git commit 3e6d480c7c: fix: [M3-8726] - Users unable to upgrade Kubernetes version from landing page (#...
Committer Banks Nussman
View all properties for this run ↗︎

Test results
Tests that failed  Failures 1
Tests that were flaky  Flaky 3
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 429

Tests for review

Failed  cypress/e2e/core/placementGroups/delete-placement-groups.spec.ts • 1 failed test

View Output Video

Test Artifacts
Placement Group deletion > can delete with Linodes assigned when unexpected error show up and retry Screenshots Video
Flakiness  switch-linode-state.spec.ts • 1 flaky test

View Output Video

Test Artifacts
switch linode state > reboots a linode from details page Screenshots Video
Flakiness  linode-config.spec.ts • 1 flaky test

View Output Video

Test Artifacts
Linode Config management > End-to-End > Clones a config Screenshots Video
Flakiness  rebuild-linode.spec.ts • 1 flaky test

View Output Video

Test Artifacts
rebuild linode > cannot rebuild a provisioning linode Screenshots Video

hasyed-akamai pushed a commit to hasyed-akamai/manager that referenced this pull request Oct 9, 2024
…ing page (linode#11056)

* fix dialog unmounting during upgrade and add cypress test

* fix cypress test

* add changeset

---------

Co-authored-by: Banks Nussman <banks@nussman.us>
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! Bug Fixes for regressions or bugs LKE Related to Linode Kubernetes Engine offerings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants