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

[#6399] Added validation to fileset dialog #6400

Merged
merged 27 commits into from
Feb 24, 2025

Conversation

Pranaykarvi
Copy link
Contributor

@Pranaykarvi Pranaykarvi commented Feb 6, 2025

What changes were proposed in this pull request?

The validation schema for the key field within the propItems array was modified to allow hyphens in file names. The regular expression for the key was updated to:

/^[a-zA-Z_][a-zA-Z0-9_-]*$/

Why are the changes needed?

Fix: issue #6399
The UI was incorrectly rejecting file names containing hyphens when creating a fileset, even though hyphens were allowed in the name specification. The changes ensure that hyphens are properly validated as part of the file name.

Does this PR introduce any user-facing change?

Yes, this PR allows users to use hyphens in file names when creating a files

How was this patch tested?

The changes were tested by creating filesets with hyphens in the names via the UI, ensuring they were accepted correctly.

@mchades mchades requested a review from LauraXia123 February 6, 2025 07:27
@mchades
Copy link
Contributor

mchades commented Feb 6, 2025

Thanks for your PR!

Could you plz follow the format like other PR titles?

@Pranaykarvi
Copy link
Contributor Author

Thanks for your PR!

Could you plz follow the format like other PR titles?

done, please could you check now?

@Pranaykarvi Pranaykarvi changed the title Added validation to fileset dialog [#6399] Added validation to fileset dialog Feb 6, 2025
@mchades
Copy link
Contributor

mchades commented Feb 6, 2025

@justinmclean
Copy link
Member

justinmclean commented Feb 10, 2025

There's some formatting issue with your PR, to make the tests pass you'll need to run prettier with --write to format the code correctly.

@Pranaykarvi
Copy link
Contributor Author

Pranaykarvi commented Feb 10, 2025

There's some formatting issue with your PR, to make the tests pass you'll need to run prettier with --write to format the code correctly.

@justinmclean Thanks for the heads-up! I ran Prettier with --write, and the formatting should be correct now. Let me know if anything else needs fixing

@Pranaykarvi
Copy link
Contributor Author

plz make the CI pass. see: https://github.com/apache/gravitino/actions/runs/13173847662/job/36768887540?pr=6400

@mchades CI has been passed

@jerryshao
Copy link
Contributor

@LauraXia123 , can you please help to review this PR?

@jerryshao jerryshao added the branch-0.8 Automatically cherry-pick commit to branch-0.8 label Feb 11, 2025
@LauraXia123
Copy link
Collaborator

@Pranaykarvi Hi,you can update the keyRegex which from @/lib/utils/regex is ok.

@Pranaykarvi
Copy link
Contributor Author

@Pranaykarvi Hi,you can update the keyRegex which from @/lib/utils/regex is ok.

@LauraXia123 I made the changes in the regex file

@LauraXia123
Copy link
Collaborator

LauraXia123 commented Feb 12, 2025

I read the keyRegex carefully and made sure it already supports hyphens. The issue #6399 is about the fileset name.
And you need to update the nameRegex and nameRegexDesc replace keyRegex.
Note the addition of three connectors on the back end:/=-

@LauraXia123
Copy link
Collaborator

@Pranaykarvi Hi, can you run prettier to fix formatting?

@Pranaykarvi
Copy link
Contributor Author

@Pranaykarvi Hi, can you run prettier to fix formatting?

@LauraXia123 done please could you check now?

@FANNG1 FANNG1 closed this Feb 13, 2025
@FANNG1 FANNG1 reopened this Feb 13, 2025
@jerryshao
Copy link
Contributor

@Pranaykarvi @LauraXia123 can you please check build error here?

@LauraXia123
Copy link
Collaborator

@Pranaykarvi can you run pnpm lint to check the lint issue?

@Pranaykarvi
Copy link
Contributor Author

Pranaykarvi commented Feb 13, 2025

@jerryshao @LauraXia123
please could you check now?

@Pranaykarvi
Copy link
Contributor Author

@Pranaykarvi @LauraXia123 can you please check build error here?

@jerryshao passed can u check now?

@Pranaykarvi Pranaykarvi requested a review from mchades February 13, 2025 14:22
@mchades mchades requested a review from LauraXia123 February 13, 2025 14:33
@LauraXia123
Copy link
Collaborator

@Pranaykarvi Hi, the nameRegex rules should be consistent with the back end nameRegex = /^\w[\w/=-]{0,63}$/, and the description should be changed as well. Thanks

@tengqm
Copy link
Contributor

tengqm commented Feb 17, 2025

lgtm

@jerryshao
Copy link
Contributor

@Pranaykarvi Hi, the nameRegex rules should be consistent with the back end nameRegex = /^\w[\w/=-]{0,63}$/, and the description should be changed as well. Thanks

@Pranaykarvi can you please address the comments mentioned by @LauraXia123 ? If you don't have time, we can help to continue on this PR, thanks.

@Pranaykarvi
Copy link
Contributor Author

Pranaykarvi commented Feb 24, 2025

@jerryshao @LauraXia123 i have made the changes now can you check?

Co-authored-by: Qian Xia <lauraxiaqian@gmail.com>
Copy link
Collaborator

@LauraXia123 LauraXia123 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@Pranaykarvi
Copy link
Contributor Author

@jerryshao @mchades I’ve made the requested changes, and @LauraXia123 has approved them. Could you please review the PR and, if everything looks good, proceed with merging? Thanks!

@jerryshao jerryshao merged commit ee296fa into apache:main Feb 24, 2025
25 checks passed
github-actions bot pushed a commit that referenced this pull request Feb 24, 2025
### What changes were proposed in this pull request?

The validation schema for the `key` field within the `propItems` array
was modified to allow hyphens in file names. The regular expression for
the `key` was updated to:

```js
/^[a-zA-Z_][a-zA-Z0-9_-]*$/
```
### Why are the changes needed?
Fix: issue #6399
The UI was incorrectly rejecting file names containing hyphens when
creating a fileset, even though hyphens were allowed in the name
specification. The changes ensure that hyphens are properly validated as
part of the file name.

### Does this PR introduce any user-facing change?
Yes, this PR allows users to use hyphens in file names when creating a
files

### How was this patch tested?
The changes were tested by creating filesets with hyphens in the names
via the UI, ensuring they were accepted correctly.

---------

Co-authored-by: Qian Xia <lauraxiaqian@gmail.com>
@Pranaykarvi Pranaykarvi deleted the ui_hyphen_issue branch February 24, 2025 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch-0.8 Automatically cherry-pick commit to branch-0.8
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants