-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: don't eager merge sessions into report (#336)
context: https://l.codecov.dev/xvGZaM Because we eagerly merge sessions when processing a report the following scenario can happen: 1. You upload an empty report with a flag set to carryforward 2. There will be a new session for that upload (even though it's empty) 3. In the next commit the session will be carried forward If no real upload was made to clean up old carriedforward sessions from empty uploads they would accumulate in the report (because `_adjust_sessions` only runs *after* the processing is done, and *doesn't run* if it's an empty upload). What prompted this investigation is that a customer was fund with thousands of carryforward session in some of their commits. So I'm exploiting the fact that merges into the report need to be made from within a lock and getting the ID for the session _without_ actually adding it to the original report. If the report is successful we add it and run `_adjust_sessions`. If the report was empty, we just never add it to the report, as if it didn't existed. OBS.: Even though I use the litle exploit I believe that passing the `sessionid` to `ReportBuilder` is unecessary. We can likely not get a sessionid at all when processin the report and it would still work. I decided to leave this for it's own change tho. Also I decided to bump the severity of the messages that indicate a report is empty. Users are not expected to upload empty reports, so it's at least sensible it should be a warning.
- Loading branch information
1 parent
97ce1f7
commit 77e34ba
Showing
4 changed files
with
71 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters