-
Notifications
You must be signed in to change notification settings - Fork 31
fix: validate domain is present when calling set_provider on registry
#561
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: validate domain is present when calling set_provider on registry
#561
Conversation
It is incorrect to call `ProviderRegister.set_provider` without a provider AND a domain. A validation check exists for the provider, but none for the domain. In this commit, we introduce that domain validation and introduce tests to capture this expected behavior. Signed-off-by: Matthew Keeler <[email protected]>
Summary of ChangesHello @keelerm84, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the robustness of the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request correctly adds a validation check to set_provider to ensure a domain is provided, preventing calls with a None domain. The accompanying tests effectively cover this new validation. My feedback focuses on improving the new tests by using pytest.raises for exception testing, which is more idiomatic and readable, and also fixes a minor bug in the exception handling of the tests.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #561 +/- ##
==========================================
+ Coverage 97.83% 98.01% +0.17%
==========================================
Files 40 41 +1
Lines 1849 1913 +64
==========================================
+ Hits 1809 1875 +66
+ Misses 40 38 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Matthew Keeler <[email protected]>
set_provider on registryset_provider on registry
This PR
It is incorrect to call
ProviderRegister.set_providerwithout a provider AND a domain. A validation check exists for the provider, but none for the domain.In this commit, we introduce that domain validation and introduce tests to capture this expected behavior.
Related Issues
First set of changes pulled off from #560.