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: Update feature flag keys #1192

Merged
merged 7 commits into from
Dec 4, 2024
Merged

refactor: Update feature flag keys #1192

merged 7 commits into from
Dec 4, 2024

Conversation

abdullai-t
Copy link
Contributor

@abdullai-t abdullai-t commented Dec 2, 2024

Summary / Highlights

This pull request includes several changes to improve feature flag management, error logging, and community event handling. It also introduces a new test case for the testimonial nudge feature.

Feature Flag Management:

  • Renamed the SHARED_TESTIMONIALS_NUDGE_FF feature flag to TESTIMONIAL_AUTO_SHARE_SETTINGS_NUDGE_FEATURE_FLAG_KEY in multiple files for consistency. [1] [2] [3]

Error Logging:

  • Simplified error logging in the login method by removing the level="error" parameter from log.error calls.

Community Event Handling:

  • Improved the delete_event method to handle the case where the community of an event might be None.
  • Updated the download_data method to remove an unused parameter from the send_events_report function call.
  • Modified the info method to return None for the community if it does not exist.

Testing:

  • Added a comprehensive test case for the cadmin_testimonial_nudge feature, including setup and teardown methods, and tests for retrieving community admin names and emails, as well as preparing testimonials.

Other Changes:

  • Updated the _get_file_url function to return an empty string instead of None when an image is not present.

Details (Give details about what this PR accomplishes, include any screenshots etc)

Testing Steps (Provide details on how your changes can be tested)

Requirements (place an x in each [ ])

  • I've read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I've tested my changes manually.
  • I've added unit tests to my PR.
Transparency (Project board)
  • I've given my PR a meaningful title.
  • I linked this PR to the relevant issue.
  • I moved the linked issue from the "Sprint backlog" to "In progress" when I started this.
  • I moved the linked issue to "QA Verification" now that it is ready to merge.

@abdullai-t abdullai-t changed the title refactor: Update feature flag keys and improve error logging in AuthS… refactor: Update feature flag keys Dec 3, 2024
Copy link

codecov bot commented Dec 3, 2024

Codecov Report

Attention: Patch coverage is 73.97260% with 19 lines in your changes missing coverage. Please review.

Project coverage is 57.72%. Comparing base (38a2625) to head (8b3cd89).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
src/website/tests.py 0.00% 14 Missing ⚠️
src/api/services/auth.py 0.00% 2 Missing ⚠️
src/website/views.py 0.00% 2 Missing ⚠️
src/api/tasks.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1192      +/-   ##
==========================================
+ Coverage   57.55%   57.72%   +0.17%     
==========================================
  Files         491      493       +2     
  Lines       36027    36091      +64     
==========================================
+ Hits        20736    20835      +99     
+ Misses      15291    15256      -35     

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

@abdullai-t abdullai-t linked an issue Dec 3, 2024 that may be closed by this pull request
return None, NotAuthorizedError()

event_community = events.first().community
if event_community:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why isn't this a single condition ?

if event_community:
                if not is_admin_of_community(context, event_community.id):

Copy link
Contributor Author

Choose a reason for hiding this comment

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

did that in the latest push

@@ -310,8 +310,8 @@ def _base_community_query(is_sandbox):

def _get_file_url(image):
if not image:
return None
return image.file.url if image.file else None
return ""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add test coverage for this. @abdullai-t

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure.

@abdullai-t abdullai-t merged commit 3bddeed into main Dec 4, 2024
3 checks passed
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.

Deleting events doesnt work
2 participants