a8n: Add Bitbucket Server support to burndown chart
Created by: mrnugget
This extends the existing CalcCounts function we use to calculate changeset counts (used by the burndown chart) to take Bitbucket Server changeset events into account.
Differences between Bitbucket Server and GitHub:
- On BBS a pull request is not "closed" but "declined"
- On BBS a "changes requested" review is simply called "reviewed" in the event names
- On BBS every reviewer only has one review state they can switch between
- On BBS a reviewer can unapprove their previous approval (but only an approval! You cannot undo a "changes requested")
The changes here take all of these into account.
While writing the tests it occurred to me that I could write them on an even higher level and find an abstraction layer that lets me say "changes requested event" and that layer would map it to "changes requested" on GitHub and "reviewed" events on BBS. But right now these tests are easy to read and to debug, which are nice properties to conserve right now. I might take a stab at the new abstraction layer in the future though.
Test plan:
Merge request reports
Activity
Created by: codecov[bot]
Codecov Report
Merging #6594 into master will increase coverage by
0.01%
. The diff coverage is61.7%
.@@ Coverage Diff @@ ## master #6594 +/- ## ========================================== + Coverage 39.18% 39.19% +0.01% ========================================== Files 1215 1215 Lines 62317 62346 +29 Branches 5935 5935 ========================================== + Hits 24417 24436 +19 - Misses 35664 35671 +7 - Partials 2236 2239 +3
Impacted Files Coverage Δ internal/a8n/types.go 20.89% <0%> (-0.09%)
enterprise/pkg/a8n/counts.go 74.69% <64.44%> (-0.87%)
internal/search/backend/horizontal.go 88.7% <0%> (-1.62%)
cmd/frontend/graphqlbackend/repository.go 22.59% <0%> (+0.96%)