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

bundle analysis: remove unnecessary save measurements #723

Merged
merged 4 commits into from
Sep 23, 2024

Conversation

JerrySentry
Copy link
Contributor

@JerrySentry JerrySentry commented Sep 18, 2024

closes codecov/engineering-team#1875

No need to save every bundle of a commit, just save the processed bundle instead, otherwise it is inserting duplicate measurements to timeseries

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

@@ -372,50 +374,51 @@ def save_measurements(self, commit: Commit, upload: Upload) -> ProcessingResult:
]

db_session = commit.get_db_session()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The diff is basically from:

for bundle_report in bundle_analysis_report.bundle_reports():
    <all the saving code>

to

bundle_report = bundle_analysis_report.bundle_report(bundle_name)
<all the saving code>

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for this comment, most helpful

@codecov-staging
Copy link

codecov-staging bot commented Sep 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #723   +/-   ##
=======================================
  Coverage   98.07%   98.07%           
=======================================
  Files         434      434           
  Lines       36800    36803    +3     
=======================================
+ Hits        36091    36094    +3     
  Misses        709      709           
Flag Coverage Δ
integration 98.07% <100.00%> (+<0.01%) ⬆️
latest-uploader-overall 98.07% <100.00%> (+<0.01%) ⬆️
unit 98.07% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
NonTestCode 95.97% <100.00%> (+<0.01%) ⬆️
OutsideTasks 98.09% <100.00%> (ø)
Files with missing lines Coverage Δ
services/bundle_analysis/report.py 100.00% <100.00%> (ø)
...ices/bundle_analysis/tests/test_bundle_analysis.py 98.34% <100.00%> (-0.01%) ⬇️
tasks/bundle_analysis_save_measurements.py 100.00% <100.00%> (ø)
...nit/test_bundle_analysis_save_measurements_task.py 100.00% <ø> (ø)

@codecov-qa
Copy link

codecov-qa bot commented Sep 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.07%. Comparing base (a7cb347) to head (d2e46d5).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #723   +/-   ##
=======================================
  Coverage   98.07%   98.07%           
=======================================
  Files         434      434           
  Lines       36800    36803    +3     
=======================================
+ Hits        36091    36094    +3     
  Misses        709      709           
Flag Coverage Δ
integration 98.07% <100.00%> (+<0.01%) ⬆️
latest-uploader-overall 98.07% <100.00%> (+<0.01%) ⬆️
unit 98.07% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
NonTestCode 95.97% <100.00%> (+<0.01%) ⬆️
OutsideTasks 98.09% <100.00%> (ø)
Files with missing lines Coverage Δ
services/bundle_analysis/report.py 100.00% <100.00%> (ø)
...ices/bundle_analysis/tests/test_bundle_analysis.py 98.34% <100.00%> (-0.01%) ⬇️
tasks/bundle_analysis_save_measurements.py 100.00% <100.00%> (ø)
...nit/test_bundle_analysis_save_measurements_task.py 100.00% <ø> (ø)

Copy link

codecov-public-qa bot commented Sep 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.07%. Comparing base (a7cb347) to head (d2e46d5).

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #723   +/-   ##
=======================================
  Coverage   98.07%   98.07%           
=======================================
  Files         434      434           
  Lines       36800    36803    +3     
=======================================
+ Hits        36091    36094    +3     
  Misses        709      709           
Flag Coverage Δ
integration 98.07% <100.00%> (+<0.01%) ⬆️
latest-uploader-overall 98.07% <100.00%> (+<0.01%) ⬆️
unit 98.07% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
NonTestCode 95.97% <100.00%> (+<0.01%) ⬆️
OutsideTasks 98.09% <100.00%> (ø)
Files Coverage Δ
services/bundle_analysis/report.py 100.00% <100.00%> (ø)
...ices/bundle_analysis/tests/test_bundle_analysis.py 98.34% <100.00%> (-0.01%) ⬇️
tasks/bundle_analysis_save_measurements.py 100.00% <100.00%> (ø)
...nit/test_bundle_analysis_save_measurements_task.py 100.00% <ø> (ø)

Copy link

codecov bot commented Sep 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.12%. Comparing base (a7cb347) to head (d2e46d5).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #723   +/-   ##
=======================================
  Coverage   98.12%   98.12%           
=======================================
  Files         475      475           
  Lines       38155    38158    +3     
=======================================
+ Hits        37438    37441    +3     
  Misses        717      717           
Flag Coverage Δ
integration 98.07% <100.00%> (+<0.01%) ⬆️
latest-uploader-overall 98.07% <100.00%> (+<0.01%) ⬆️
unit 98.07% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
NonTestCode 96.08% <100.00%> (+<0.01%) ⬆️
OutsideTasks 98.09% <100.00%> (ø)
Files with missing lines Coverage Δ
services/bundle_analysis/report.py 100.00% <100.00%> (ø)
...ices/bundle_analysis/tests/test_bundle_analysis.py 98.34% <100.00%> (-0.01%) ⬇️
tasks/bundle_analysis_save_measurements.py 100.00% <100.00%> (ø)
...nit/test_bundle_analysis_save_measurements_task.py 100.00% <ø> (ø)

This change has been scanned for critical changes. Learn more

@JerrySentry JerrySentry marked this pull request as ready for review September 18, 2024 19:17
Copy link
Contributor

@giovanni-guidini giovanni-guidini left a comment

Choose a reason for hiding this comment

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

LGTM, left a comment

bundle_report.name,
bundle_report.total_size(),
)
bundle_report = bundle_analysis_report.bundle_report(bundle_name)
Copy link
Contributor

Choose a reason for hiding this comment

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

it seems that this can be None. We could early-return here if that's the case

@@ -372,50 +374,51 @@ def save_measurements(self, commit: Commit, upload: Upload) -> ProcessingResult:
]

db_session = commit.get_db_session()
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for this comment, most helpful

@JerrySentry JerrySentry added this pull request to the merge queue Sep 23, 2024
Merged via the queue into main with commit f21ff1b Sep 23, 2024
26 of 27 checks passed
@JerrySentry JerrySentry deleted the sep_18_ba_simp branch September 23, 2024 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ref][Shared/Worker] Refactor ingest to return a bundle_name to know which bundle to save measurements for
2 participants