Implement faster resolver for global campaign diff stat
Created by: eseliger
Before we had to load all the changesets, which including metadata can take quite a while for larger campaigns (quite some data to be sent). This approach asks the DB directly, while respecting repo permissions, and is close to instant, removing the need to lazy-load the diff stat on the campaigns page.
TODO: I can't figure out why the test fails, if you have an idea, please comment :) Otherwise I'll debug that next. Opening up for review anyways, since I assume the test fix won't change much.
Merge request reports
Activity
Created by: sourcegraph-bot
Notifying subscribers in CODENOTIFY files for diff ab487c716a4c1392f6cad8e914b0819bea711b06...a370572f1b899a1bd3eba6bc2a402b2bf97824b7.
Notify File(s) @LawnGnome enterprise/internal/campaigns/resolvers/campaign.go
enterprise/internal/campaigns/store/campaigns.go
enterprise/internal/campaigns/store/campaigns_test.go
enterprise/internal/campaigns/testing/changeset.go
enterprise/internal/campaigns/testing/repos.go
internal/db/repos.go
internal/db/repos_perm.go
internal/db/repos_perm_test.go@asdine internal/db/repos.go
internal/db/repos_perm.go
internal/db/repos_perm_test.go@unknwon internal/db/repos_perm.go
internal/db/repos_perm_test.goCreated by: codecov[bot]
Codecov Report
Merging #17529 (a370572) into main (ab487c7) will decrease coverage by
0.00%
. The diff coverage is75.00%
.@@ Coverage Diff @@ ## main #17529 +/- ## ========================================== - Coverage 50.32% 50.32% -0.01% ========================================== Files 1715 1715 Lines 85183 85183 Branches 7805 7805 ========================================== - Hits 42871 42865 -6 - Misses 38443 38447 +4 - Partials 3869 3871 +2
Flag Coverage Δ *Carryforward flag go 50.50% <75.00%> (-0.01%)
integration 30.68% <ø> (ø)
Carriedforward from ab487c7 typescript 49.87% <ø> (ø)
Carriedforward from ab487c7 unit 34.59% <ø> (ø)
Carriedforward from ab487c7 *This pull request uses carry forward flags. Click here to find out more.
Impacted Files Coverage Δ internal/db/repos_perm.go 90.90% <ø> (ø)
enterprise/internal/campaigns/store/campaigns.go 88.81% <66.66%> (-1.79%)
...nterprise/internal/campaigns/resolvers/campaign.go 76.92% <100.00%> (-0.67%)
internal/db/repos.go 70.48% <100.00%> (ø)
...ternal/campaigns/resolvers/changeset_connection.go 69.23% <0.00%> (-3.85%)
...terprise/internal/campaigns/resolvers/changeset.go 58.53% <0.00%> (-0.82%)