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-8467] - Improve validation rules for create bucket schema #10847

Merged
merged 3 commits into from
Aug 28, 2024

Conversation

jaalah-akamai
Copy link
Contributor

Description 📝

The API currently returns an error when creating buckets, incorrectly checking for 'name' instead of 'label'. While a fix for this issue is planned for the future, we can improve our validation in the interim.

Changes 🔄

  • Update schema to account for existing validation requirements

Target release date 🗓️

N/A

How to test 🧪

Prerequisites

  • Ensure multicluster flag is enabled

Reproduction steps

  • Try creating a bucket with a capital letter in the name
  • Observe the request silently fails

Verification steps

  • Checkout this branch
  • Follow reproduction steps
  • Test for -test, test--, test.- Test
  • Observe validation is working as intended

As an Author I have considered 🤔

Check all that apply

  • 👀 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

@jaalah-akamai jaalah-akamai added the Bug Fixes for regressions or bugs label Aug 28, 2024
@jaalah-akamai jaalah-akamai self-assigned this Aug 28, 2024
@jaalah-akamai jaalah-akamai requested a review from a team as a code owner August 28, 2024 16:38
@jaalah-akamai jaalah-akamai requested review from bnussman-akamai and carrillo-erik and removed request for a team August 28, 2024 16:38
@jaalah-akamai
Copy link
Contributor Author

cc @hkhalil-akamai @mjac0bs Thanks for change recommendations

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.

I'm able to create buckets with expected labels ✅

Unrelated to this PR, but I'm seeing the form validate immediately when I start typing. Should we make it validate onBlur to be consistent with our other forms like Linode Create and Volume Create?

Comment on lines 15 to 17
.matches(
/^[a-z0-9].*[a-z0-9]$/,
'Label must start and end with a letter or number.'
Copy link
Member

Choose a reason for hiding this comment

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

Could we somehow make matches check after the min length check?

I my opinion "d" does start and and end with a letter so I think showing Label must be between 3 and 63 characters. first would be slightly nicer.
Screenshot 2024-08-28 at 12 52 07 PM

Copy link
Contributor

Choose a reason for hiding this comment

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

I was about to say the same. 😄 🧠

Screen.Recording.2024-08-28.at.9.56.48.AM.mov

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Much better now - thanks!

@bnussman-akamai bnussman-akamai added the Add'tl Approval Needed Waiting on another approval! label Aug 28, 2024
Comment on lines 15 to 17
.matches(
/^[a-z0-9].*[a-z0-9]$/,
'Label must start and end with a letter or number.'
Copy link
Contributor

Choose a reason for hiding this comment

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

I was about to say the same. 😄 🧠

Screen.Recording.2024-08-28.at.9.56.48.AM.mov

@mjac0bs mjac0bs added Approved Multiple approvals and ready to merge! and removed Add'tl Approval Needed Waiting on another approval! labels Aug 28, 2024
Copy link

github-actions bot commented Aug 28, 2024

Coverage Report:
Base Coverage: 82.73%
Current Coverage: 82.73%

jaalah-akamai and others added 2 commits August 28, 2024 15:21
Co-authored-by: Mariah Jacobs <114685994+mjac0bs@users.noreply.github.com>
@abailly-akamai abailly-akamai merged commit 38eabf3 into linode:develop Aug 28, 2024
19 checks passed
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants