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

refactor(groupsValidation): throw BadRequestException on invalid treeDepth input #582

Merged
merged 4 commits into from
Oct 23, 2024

Conversation

sanieni6
Copy link
Contributor

@sanieni6 sanieni6 commented Oct 21, 2024

Description

This pull request adds validation to ensure that the treeDepth parameter is within the supported range of 16 to 32 inclusive when creating new groups. If an invalid treeDepth is provided, the API now returns a clear and descriptive error message by throwing a BadRequestException.

Related Issue

This pull request addresses #579

Does this introduce a breaking change?

  • Yes
  • No

Other information

  1. treeDepth == 15
    badRequest15

  2. treeDepth == 33
    badRequest33

  3. treeDepth == 18
    goodRequest

Copy link

vercel bot commented Oct 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
bandada-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 23, 2024 7:17pm
bandada-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 23, 2024 7:17pm

@vplasencia
Copy link
Member

vplasencia commented Oct 22, 2024

Hey @sanieni6 it looks great! Thank you very much! Could you also update the api-sdk so that when people use it to create one or many groups, they get the same error message?

@sanieni6
Copy link
Contributor Author

@vplasencia of course yes!!!

@vplasencia
Copy link
Member

Thank you @sanieni6! Please, let us know if you have any questions.

@sanieni6
Copy link
Contributor Author

Hi @vplasencia it is done, please let me know if you need something else!! 😄

@vplasencia
Copy link
Member

vplasencia commented Oct 23, 2024

Thank you very much @sanieni6! 🙏

Could you add tests for the changes and also run yarn prettier:write and push the changes?

@sanieni6
Copy link
Contributor Author

Hi @vplasencia tests just created!! I ran yarn prettier:write but so many files got formatted, should i push them anyways?
I ran prettier for the individuals files where i worked on btw
image

@vplasencia
Copy link
Member

Hey @sanieni6 thank you very much for creating the tests, I will take a look asap.

Regarding prettier, it's fine now, no need to push those other changes. Thank you for asking.

Copy link
Member

@vplasencia vplasencia left a comment

Choose a reason for hiding this comment

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

Hey @sanieni6 great work! Thank you very much. I just left one comment.

libs/api-sdk/src/index.test.ts Show resolved Hide resolved
Copy link
Member

@vplasencia vplasencia left a comment

Choose a reason for hiding this comment

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

Great work! Thank you very much! 🙏

@vplasencia vplasencia changed the base branch from main to dev October 23, 2024 19:35
@vplasencia vplasencia changed the base branch from dev to main October 23, 2024 19:37
@vplasencia vplasencia changed the base branch from main to dev October 23, 2024 19:37
@vplasencia vplasencia merged commit a9e6146 into bandada-infra:dev Oct 23, 2024
5 checks passed
Copy link

gitpoap-bot bot commented Oct 23, 2024

Congrats, your important contribution to this open-source project has earned you a GitPOAP!

GitPOAP: 2024 Bandada Contributor:

GitPOAP: 2024 Bandada Contributor GitPOAP Badge

Head to gitpoap.io & connect your GitHub account to mint!

Learn more about GitPOAPs here.

@sripwoud
Copy link

sripwoud commented Oct 24, 2024

Thanks @sanieni6 ❤️

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

Successfully merging this pull request may close these issues.

Throw an error when trying to create a group with tree depth < 16 or > 32
3 participants