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

feat: Add metadata fields to core entities (API) #3315

Merged
merged 32 commits into from May 15, 2024

Conversation

novakzaballa
Copy link
Contributor

@novakzaballa novakzaballa commented Jan 23, 2024

Thanks for submitting a PR! Please check the boxes below:

  • I have run pre-commit to check linting
  • I have added information to docs/ if required so people know about the feature!
  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?
  • I have used a Conventional Commit title for this Pull Request

Changes

FE changes:

BE changes:

  • Support metadata for segments, and Flags
  • Support required metadata model fields for segments, and Flags

How did you test this code?

Tests added

@github-actions github-actions bot added the api Issue related to the REST API label Jan 23, 2024
Copy link

vercel bot commented Jan 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 13, 2024 9:47pm
flagsmith-frontend-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 13, 2024 9:47pm
flagsmith-frontend-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 13, 2024 9:47pm

Copy link
Contributor

github-actions bot commented Jan 23, 2024

Uffizzi Preview deployment-44924 was deleted.

@codecov-commenter
Copy link

codecov-commenter commented Jan 23, 2024

Codecov Report

Attention: Patch coverage is 98.06763% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 96.00%. Comparing base (92e3e9f) to head (100f8eb).

Files Patch % Lines
api/segments/serializers.py 91.66% 2 Missing ⚠️
api/features/serializers.py 94.11% 1 Missing ⚠️
api/metadata/views.py 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3315      +/-   ##
==========================================
+ Coverage   95.99%   96.00%   +0.01%     
==========================================
  Files        1135     1135              
  Lines       36185    36361     +176     
==========================================
+ Hits        34735    34909     +174     
- Misses       1450     1452       +2     

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

api/conftest.py Outdated Show resolved Hide resolved
api/conftest.py Outdated Show resolved Hide resolved
api/features/serializers.py Outdated Show resolved Hide resolved
api/metadata/models.py Outdated Show resolved Hide resolved
api/segments/serializers.py Outdated Show resolved Hide resolved
api/segments/serializers.py Outdated Show resolved Hide resolved
api/metadata/models.py Outdated Show resolved Hide resolved
api/segments/serializers.py Outdated Show resolved Hide resolved
api/tests/unit/features/test_unit_features_views.py Outdated Show resolved Hide resolved
api/tests/unit/metadata/test_views.py Outdated Show resolved Hide resolved
@@ -2878,7 +3011,7 @@ def test_feature_list_last_modified_values(
Feature.objects.create(name=f"feature_{i}", project=project)

# When
with django_assert_num_queries(16): # TODO: reduce this number of queries!
with django_assert_num_queries(19): # TODO: reduce this number of queries!
Copy link
Contributor

Choose a reason for hiding this comment

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

What are the extra queries we're adding here, and have we confirmed that we don't have any N+1 issues?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, I found an N+1 problem. I've fixed it by adding metadata to the prefetch_related used in the queryset.

@novakzaballa novakzaballa added this pull request to the merge queue May 15, 2024
Merged via the queue into main with commit 06eb8a4 May 15, 2024
23 of 24 checks passed
@novakzaballa novakzaballa deleted the feat/add-metadata-fields-to-core-entities-api branch May 15, 2024 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the REST API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants