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 reverse dependencies by using distinct #5566

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

federicoaldunate
Copy link

Fix reverse dependencies bug

Another example: https://rubygems.org/gems/rspec/reverse_dependencies

Description

Reverse dependencies are being repeated.
Linked issue: #5199

Tried to solve this at least in the user facing controller side of things.

Copy link

codecov bot commented Mar 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.35%. Comparing base (b827011) to head (a1c473f).
Report is 12 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #5566       +/-   ##
===========================================
+ Coverage   71.71%   94.35%   +22.63%     
===========================================
  Files         453      453               
  Lines        9609     9470      -139     
===========================================
+ Hits         6891     8935     +2044     
+ Misses       2718      535     -2183     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@segiddins
Copy link
Member

I'm a bit concerned if this will have a performance impact, can you share the generated queries and I can explain analyze them?

@simi
Copy link
Member

simi commented Mar 31, 2025

I'm a bit concerned if this will have a performance impact, can you share the generated queries and I can explain analyze them?

I'll check.

@@ -9,6 +9,8 @@ def index
@reverse_dependencies = @rubygem.reverse_dependencies
.by_downloads
.preload(:gem_download, :latest_version)
.distinct(:id)
Copy link
Member

Choose a reason for hiding this comment

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

Why is :id needed? Seems distinct supports only true/false arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants