Add API/ UI support for Patch/PackageCommitPatch#2179
Conversation
b9d4b05 to
9381258
Compare
65506e3 to
d1b139f
Compare
02f0910 to
fef275d
Compare
227c0df to
20b2637
Compare
e5aa2a0 to
a0db697
Compare
|
@ziadhany thanks for this, please rebase and change your approach according to the latest code. Thanks! |
Add a test Signed-off-by: ziad hany <ziadhany2016@gmail.com>
Signed-off-by: ziad hany <ziadhany2016@gmail.com>
a0db697 to
f0cbcbc
Compare
Signed-off-by: ziad hany <ziadhany2016@gmail.com>
Signed-off-by: ziad hany <ziadhany2016@gmail.com>
Add a test for member advisory Simplify the code to use one query Signed-off-by: ziad hany <ziadhany2016@gmail.com>
|
@TG1999 I just updated the code as we discussed. For the smaller query: For the larger query: |
| fixed_commit_hash=F("impacted_package__fixed_by_package_commit_patches__commit_hash"), | ||
| fixed_vcs_url=F("impacted_package__fixed_by_package_commit_patches__vcs_url"), | ||
| ) | ||
| .distinct() |
There was a problem hiding this comment.
Try removing distinct and remove seen data in the for loop and compare the performance once
There was a problem hiding this comment.
Let's have 2 separate queries for affected anf fixed that's fine
There was a problem hiding this comment.
introduced_rows = (
ImpactedPackageAffecting.objects
...
.filter(
impacted_package__introduced_by_package_commit_patches__isnull=False
)
.values(...)
)
fixed_rows = (
ImpactedPackageAffecting.objects
...
.filter(
impacted_package__fixed_by_package_commit_patches__isnull=False
)
.values(...)
)
There was a problem hiding this comment.
after remove the distinct and remove seen, the query slightly faster on large query, but it results in duplicate patches.
There was a problem hiding this comment.
What I meant is use seen approach in loop without distinct,
Remove dupes from loop and see how it goes
There was a problem hiding this comment.
There is no obvious difference in performance. I just dropped distinct and kept the seen loop.
Simplify the code structure Prepare the patch data outside the loop Signed-off-by: ziad hany <ziadhany2016@gmail.com>
|
@TG1999, your idea was brilliant 🚀🚀 . The performance of the larger query is now: This means: also: For reachability, Please let me know if you have any other suggestions. |
Issue: