Skip to content

renamed decorator and setting, to align with java template.#21

Merged
sloppycoder merged 1 commit intomainfrom
feature-tweak
May 12, 2025
Merged

renamed decorator and setting, to align with java template.#21
sloppycoder merged 1 commit intomainfrom
feature-tweak

Conversation

@sloppycoder
Copy link
Contributor

renamed decorator and setting, to align with java template.

@sloppycoder sloppycoder requested a review from Copilot May 9, 2025 13:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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"
Copy link

Copilot AI May 9, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
feature_flags_source: str = "http://localhost:8013"
feature_flags_source: str = "flags.json"

Copilot uses AI. Check for mistakes.
Comment on lines +28 to +30
# 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.
Copy link

Copilot AI May 9, 2025

Choose a reason for hiding this comment

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

[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.

Suggested change
# 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.

Copilot uses AI. Check for mistakes.
@sloppycoder sloppycoder merged commit ec5b795 into main May 12, 2025
1 check passed
@sloppycoder sloppycoder deleted the feature-tweak branch May 12, 2025 15:13
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