Skip to content

tech-story: [M3-10019] - Reroute CloudPulse - #12262

Merged
abailly-akamai merged 10 commits into
linode:developfrom
abailly-akamai:M3-10019
Jun 2, 2025
Merged

tech-story: [M3-10019] - Reroute CloudPulse#12262
abailly-akamai merged 10 commits into
linode:developfrom
abailly-akamai:M3-10019

Conversation

@abailly-akamai

@abailly-akamai abailly-akamai commented May 21, 2025

Copy link
Copy Markdown
Contributor

Description 📝

Rerouting the /metrics and /alerts name spaces, and CloudPulse as a whole.

This one is a little more straight forward due to the lack of modals/dialogs to route. There are only a couple, which could (or not) be addressed later.

Changes 🔄

  • Replace routing utils
  • Adjust landing components code structure accordingly
  • Update unit tests
  • Update e2e

Preview 📷

There should be no visual or functional regression as a result of this PR

How to test 🧪

Verification steps

Confirm no regression (UI/routing) with

  • /metrics
  • /alerts
    • alert detail
    • edit alert
    • create alert
Author Checklists

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

ascending: [1, 2, 3, 4],
column: 'service_type',
descending: [4, 3, 2, 1],
descending: [3, 4, 1, 2],

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The previous assertion was actually wrong. Since we only have two service types it's hard to be accurate anyway, and the order here also depends on what was just right before. Not the most reliable assertion overall.

Typography,
} from '@linode/ui';
import React from 'react';
// eslint-disable-next-line no-restricted-imports

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is also use within the /linodes namespace. Will be addressed along with other residual react-router-dom history instances

@abailly-akamai
abailly-akamai marked this pull request as ready for review May 27, 2025 18:22
@abailly-akamai
abailly-akamai requested review from a team as code owners May 27, 2025 18:22
@abailly-akamai
abailly-akamai requested review from coliu-akamai, dmcintyr-akamai and hkhalil-akamai and removed request for a team May 27, 2025 18:22

@coliu-akamai coliu-akamai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

awesome thanks @abailly-akamai!

✅ when feature flag is off, NotFound is shown for metrics/alerts related routes
✅ /metrics
✅ /alerts landing + order by

  • ✅ alert detail
  • ✅ edit alert
  • ✅ create alert

✅ code review

Comment on lines +233 to +241
<Paginate data={sortedData ?? []}>
{({
count,
data: paginatedAndOrderedAlerts,
handlePageChange,
handlePageSizeChange,
page,
pageSize,
}) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

optional: do we want to update pagination to usePaginationV2 to use routing too?

@abailly-akamai abailly-akamai May 29, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good question! Not really because <Paginate /> is client-side only and does not contain any react-router-dom utils. It can stay for those use cases 👍

@coliu-akamai coliu-akamai added the Add'tl Approval Needed Waiting on another approval! label May 28, 2025

@hkhalil-akamai hkhalil-akamai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Did not observe any loss of functionality.

@github-project-automation github-project-automation Bot moved this from Review to Approved in Cloud Manager May 28, 2025
@hkhalil-akamai hkhalil-akamai added Approved Multiple approvals and ready to merge! and removed Add'tl Approval Needed Waiting on another approval! labels May 28, 2025
@venkymano-akamai

venkymano-akamai commented May 29, 2025

Copy link
Copy Markdown
Contributor

@abailly-akamai , Quick question, In our prod/alpha lets say, if we put the below URL in the browser, a wrong URL to details page
https://cloud.dev.linode.com/alerts/definitions/detailss/dbaas/36

It redirects to https://cloud.dev.linode.com/alerts/definitions and in the browser correct URL is shown as (https://cloud.dev.linode.com/alerts/definitions)

but in my localhost in this branch if I ping http://localhost:3000/alerts/definitions/detailss/dbaas/36

It again redirects to list page, but the URL in the browser remains http://localhost:3000/alerts/definitions/detailss/dbaas/36, which is quiet confusing, I would try to replicate the production behaviour in this case as well since it is nice without wrong URL's

Like this we need to take care of the metrics endpoints as well.

@venkymano-akamai venkymano-akamai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@abailly-akamai , I have left a comment here, please look

@abailly-akamai

Copy link
Copy Markdown
Contributor Author

@venkymano-akamai thx I added handling for this. Quite an edge case but at least there's parity there.

Like this we need to take care of the metrics endpoints as well.

Not sure I follow about metrics, i don't think it applies there

@venkymano-akamai venkymano-akamai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving with a comment,

@abailly-akamai , I checked and the alerts part works fine. Since we have touched /metrics also in CloudPulseDashboardLanding.tsx, While pinging like this prod
https://cloud.linode.com/metrics/sss

It redirects to https://cloud.linode.com/metrics and lands in dashboards page.

Where is in our PR branch pinging http://localhost:3000/metrics/sss, show Not Found page. Lets make this consistent as well.

Rest of the PR looks good for me.

@abailly-akamai

abailly-akamai commented Jun 2, 2025

Copy link
Copy Markdown
Contributor Author

@venkymano-akamai getting a not found page is in general a better behavior than a redirect, so will keep this as is.

The case with alerts was a bit different since it was dealing with params, but in the case of metrics it is a pure non-existent route.

@linode-gh-bot

Copy link
Copy Markdown

Cloud Manager UI test results

🎉 625 passing tests on test run #14 ↗︎

❌ Failing✅ Passing↪️ Skipped🕐 Duration
0 Failing625 Passing4 Skipped115m 2s

@abailly-akamai
abailly-akamai merged commit 28a7765 into linode:develop Jun 2, 2025
@github-project-automation github-project-automation Bot moved this from Approved to Merged in Cloud Manager Jun 2, 2025
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! Routing Refactor

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants