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

fix: Environments metadata n+1 for project admin #3101

Merged
merged 2 commits into from
Dec 6, 2023

Conversation

zachaysan
Copy link
Contributor

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

A previous feature was incorrectly filtering a queryset for the get_permitted_environments_for_user in the case where the user was a project admin, where an early return misses the queryset. This does the check again and if necessary included the same prefetch_related.

How did you test this code?

I wrote a simple test with verifying the bug visually to ensure that this was the metadata issue reported on Sentry then I fixed it.

Copy link

vercel bot commented Dec 6, 2023

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

Name Status Preview Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview Dec 6, 2023 3:51pm
flagsmith-frontend-preview ✅ Ready (Inspect) Visit Preview Dec 6, 2023 3:51pm
flagsmith-frontend-staging ✅ Ready (Inspect) Visit Preview Dec 6, 2023 3:51pm

@github-actions github-actions bot added the api Issue related to the REST API label Dec 6, 2023
@zachaysan zachaysan requested a review from khvn26 December 6, 2023 15:51
Copy link
Contributor

github-actions bot commented Dec 6, 2023

Uffizzi Preview deployment-42283 was deleted.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c1c45cb) 95.92% compared to head (4f54e49) 95.92%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3101   +/-   ##
=======================================
  Coverage   95.92%   95.92%           
=======================================
  Files        1037     1037           
  Lines       30882    30897   +15     
=======================================
+ Hits        29623    29638   +15     
  Misses       1259     1259           

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

@zachaysan zachaysan added this pull request to the merge queue Dec 6, 2023
Merged via the queue into main with commit 093fa3a Dec 6, 2023
@zachaysan zachaysan deleted the fix/environments_admin_n+1 branch December 6, 2023 17:15
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.

3 participants