Skip to content

Conversation

@keelerm84
Copy link
Contributor

This PR

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.

Related Issues

First set of changes pulled off from #560.

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]>
@keelerm84 keelerm84 requested review from a team as code owners January 13, 2026 18:34
@gemini-code-assist
Copy link

Summary of Changes

Hello @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 ProviderRegistry by implementing a crucial validation check. It ensures that when a provider is registered using set_provider, a valid domain is always provided, preventing potential runtime issues from None values. The changes also introduce a dedicated suite of tests for the ProviderRegistry, significantly improving test coverage and verifying its expected behavior across various scenarios, including the lifecycle of providers.

Highlights

  • Validation for set_provider domain: Added a validation check to the ProviderRegistry.set_provider method to ensure that the domain argument is not None. If None is passed, a GeneralError will now be raised.
  • New unit tests for ProviderRegistry: Introduced a new test file, test_registry.py, which includes comprehensive unit tests for the ProviderRegistry. These tests cover the new domain validation, default provider behavior, provider registration, replacement, initialization, and shutdown mechanisms.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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
Copy link

codecov bot commented Jan 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.01%. Comparing base (7c27c7a) to head (86d8421).
⚠️ Report is 1 commits behind head on main.

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     
Flag Coverage Δ
unittests 98.01% <100.00%> (+0.17%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Matthew Keeler <[email protected]>
@federicobond federicobond changed the title fix: Validate domain is present when calling set_provider on registry fix: validate domain is present when calling set_provider on registry Jan 14, 2026
@federicobond federicobond merged commit 9fc6121 into open-feature:main Jan 15, 2026
16 checks passed
@keelerm84 keelerm84 deleted the feat/require-domain branch January 15, 2026 17:25
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.

2 participants