renamed decorator and setting, to align with java template.#21
renamed decorator and setting, to align with java template.#21sloppycoder merged 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR renames a decorator and its corresponding configuration settings to align with a Java template.
- Renamed the feature flag decorator from feature_gated to feature_gated_api in both API and helper modules.
- Updated settings to switch from using feature_prefix to feature_flags_prefix and adjusted the default feature_flags_source.
- Modified test comments to reflect the changes in feature flag behavior.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| {{cookiecutter.project_slug}}/{{ cookiecutter.pkg_name }}/api.py | Updated import and decorator usage to feature_gated_api. |
| {{cookiecutter.project_slug}}/settings.py | Changed feature flag settings and their assignment logic. |
| {{cookiecutter.project_slug}}/helper.py | Renamed decorator and updated settings attribute usage. |
| {{cookiecutter.project_slug}}/tests/test_{{ cookiecutter.pkg_name }}.py | Revised test comments regarding feature flag behavior. |
| {{cookiecutter.project_slug}}/.env | Modified environment variable values that affect testing. |
| # for OpenFeature | ||
| feature_flags_source: str = "flags.json" | ||
| feature_prefix: str = "" | ||
| feature_flags_source: str = "http://localhost:8013" |
There was a problem hiding this comment.
The default value for feature_flags_source in settings.py now differs from the value set in the .env file (which is 'flags.json'). Consider aligning these values to avoid potential configuration inconsistencies.
| feature_flags_source: str = "http://localhost:8013" | |
| feature_flags_source: str = "flags.json" |
| # feature flag defaults to true. | ||
| # flags.json will return false, if it works properly | ||
| # the test will be successful only if flagd is return the correct data. |
There was a problem hiding this comment.
[nitpick] The updated test comments in the feature flag test are ambiguous compared to the expected status code (403). Update the comments to clearly explain the expected behavior and conditions under which the feature is disabled.
| # feature flag defaults to true. | |
| # flags.json will return false, if it works properly | |
| # the test will be successful only if flagd is return the correct data. | |
| # The feature flag for this endpoint defaults to enabled (true). | |
| # If the feature flag is disabled (false) in flags.json, the endpoint should return a 403 status code. | |
| # This test verifies that the system correctly enforces the feature flag's state as defined in flags.json. |
renamed decorator and setting, to align with java template.