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: add validation on email and discord handle in cli #2805

Closed
wants to merge 3 commits into from

Conversation

phy-chain
Copy link

@phy-chain phy-chain commented Mar 4, 2024

Describe your changes

Indicate on which release or other PRs this topic is based on

This has been reported in : #2800

Checklist before merging to draft

  • I have added a changelog
  • Git history is in acceptable state
  • Add a test for email validation
  • Add a test for discord handle validation

@phy-chain phy-chain force-pushed the fix-email-discord-validation branch from 4cbe5c5 to d2948e6 Compare March 4, 2024 16:10
Copy link

codecov bot commented Mar 4, 2024

Codecov Report

Attention: Patch coverage is 0% with 66 lines in your changes are missing coverage. Please review.

Project coverage is 53.91%. Comparing base (2535c9c) to head (d2948e6).

❗ Current head d2948e6 differs from pull request most recent head 1e33228. Consider uploading reports for the commit 1e33228 to get more accurate results

Files Patch % Lines
crates/apps/src/lib/cli.rs 0.00% 66 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2805      +/-   ##
==========================================
- Coverage   53.95%   53.91%   -0.04%     
==========================================
  Files         308      308              
  Lines      100018   100084      +66     
==========================================
- Hits        53967    53965       -2     
- Misses      46051    46119      +68     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@brentstone
Copy link
Collaborator

brentstone commented Mar 4, 2024

@phy-chain thanks for starting this. It is more correct and appropriate to enforce these constraints in the user VP (vp_user.rs) rather than exclusively in the client, however.

We do a similar thing already in the native Governance VP with the restriction of the size of a governance proposal content. Check out is_valid_content_key insde the Gov VP (crates::namada::src::ledger::governance::mod.rs) for some guidance.

Make sure to include a test as well.

@brentstone brentstone added the PoS label Mar 4, 2024
@phy-chain
Copy link
Author

@phy-chain thanks for starting this. It is more correct and appropriate to enforce these constraints in the user VP (vp_user.rs) rather than exclusively in the client, however.

We do a similar thing already in the native Governance VP with the restriction of the size of a governance proposal content. Check out is_valid_content_key insde the Gov VP (crates::namada::src::ledger::governance::mod.rs) for some guidance.

Make sure to include a test as well.

Ah yes, I did see that, That was my source of inspiration for the MetadataValidation structure actually. But I didnt get how that worked with VP thing.
Ok for the test, I'll keep that in mind to implement it

@brentstone
Copy link
Collaborator

@phy-chain I'm happy to help at some point soon since this is important, but I don't have the bandwidth for probably a couple days.

@phy-chain
Copy link
Author

@phy-chain I'm happy to help at some point soon since this is important, but I don't have the bandwidth for probably a couple days.

@brentstone No rush, Im glad to help, even though Im a total newby at Rust (Im a frontend dev first and foremost).
I've pushed a new commit to try and go in the right direction. Let me know if it looks better or if Im heading into troubles :D

I've started a test case but on that, it's a complete mystery how to generate "test data" that's relevant, and test against it. So, i've copied and existing test and added some TODOs as a reflexion basis.

Feel free to ping me when you have time (better to do so on Discord cause I might not see notifications here). It can also be after the SE if you're too busy.

@brentstone
Copy link
Collaborator

hey @phy-chain, in some planning today we decided that the priority for this is higher than previously thought, so I went ahead and made a quick PR #2845 to complete this. I'll close this PR for now, but perhaps keep your branch around in case. Thanks for the effort and for identifying #2800!

@brentstone brentstone closed this Mar 7, 2024
@phy-chain
Copy link
Author

Lol ok, that's a way to go at it 😅 500 chars limit for all. Still better than nothing I guess :D
Feel free to keep that around and ping me if need be.

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

Successfully merging this pull request may close these issues.

2 participants