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

DI-23961 - Fix schema types and validations in cloudpulse alerting create and edit flow #11868

Draft
wants to merge 15 commits into
base: develop
Choose a base branch
from

Conversation

venkymano-akamai
Copy link
Contributor

@venkymano-akamai venkymano-akamai commented Mar 18, 2025

Description 📝

Changes to fix schema types and form validation in cloudpulse alerting create and edit flow to avoid type assertions while maintaining same validations and functionalities

Changes 🔄

List any change(s) relevant to the reviewer.

  1. Enhanced existing validation in cloudpulse-schema.ts to match the CreateAlertDefinitionPayload and EditAlertDefinitionPayload.
  2. Enhanced form level validations, that uses null for initialization but not for submitting.
  3. Enhanced existing function to compute max selection validation for entity_ids by more unique functions.

Target release date 🗓️

25--03-2025

Preview 📷

Here , this is just the schema enhancements to avoid type assertions, the validations and the functionalities in the create alert flow that was working previously should work now also seamlessly.

Before After
Screenshot 2025-03-19 at 11 00 38 AM Screenshot 2025-03-19 at 11 00 38 AM
Screenshot 2025-03-19 at 11 00 50 AM Screenshot 2025-03-19 at 11 00 50 AM
Screenshot 2025-03-19 at 11 01 38 AM Screenshot 2025-03-19 at 11 01 38 AM

How to test 🧪

  1. Login as mock, as some endpoints are not available
  2. Navigate to Alerts tab in monitor section
  3. Go to create alert flow , without adding anything click on the submit button, the validations should come and not allowed to submit.
  4. In the edit flow, try submitting without any required fields, this should not be allowed as well without a required field.
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

Sorry, something went wrong.

@linode-gh-bot
Copy link
Collaborator

Cloud Manager UI test results

🔺 7 failing tests on test run #9 ↗︎

❌ Failing✅ Passing↪️ Skipped🕐 Duration
7 Failing532 Passing3 Skipped125m 8s

Details

Failing Tests
SpecTest
alerts-listing-page.spec.tsIntegration Tests for CloudPulse Alerts Listing Page » should disable and enable user alerts successfully
delete-firewall.spec.tsdelete firewall » deletes a firewall
create-firewall.spec.tscreate firewall » creates a firewall without a linode
create-firewall.spec.tscreate firewall » creates a firewall assigned to a linode
alert-errors.spec.tsAlerts Listing Page - Error Handling » should display correct error messages when disabling or enabling alerts fails
edit-user-alert.spec.tsIntegration Tests for Edit Alert » successfully updated alert details and verified that the API request matches the expected test data.
edit-system-alert.spec.tsIntegration Tests for Edit Alert » should correctly display and update the details of the alert in the edit alert page

Troubleshooting

Use this command to re-run the failing tests:

pnpm cy:run -s "cypress/e2e/core/cloudpulse/alerts-listing-page.spec.ts,cypress/e2e/core/firewalls/delete-firewall.spec.ts,cypress/e2e/core/firewalls/create-firewall.spec.ts,cypress/e2e/core/cloudpulse/alert-errors.spec.ts,cypress/e2e/core/cloudpulse/edit-user-alert.spec.ts,cypress/e2e/core/cloudpulse/edit-system-alert.spec.ts"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants