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

BA: Handle multiple file versions + introduce gzip size #266

Merged
merged 4 commits into from
Jul 8, 2024

Conversation

JerrySentry
Copy link
Contributor

@JerrySentry JerrySentry commented Jun 26, 2024

Create a mechanism to handle parsing of different stats file versions, depending on the version value in the JSON file it will choose the appropriate parser logic. The difference between V1 and V2 is that V2 introduces gzip sizes for assets in the JSON file. In V2 parser it will read and store that value, whereas in V1 parser it will just use the old not-smart logic by assuming the gzip size is 1/1000th of the uncompressed size; beyond that V1 and V2 is identical in logic. The gzip size is then stored into the bundle report (ie SQLite DB).

I duplicated the code instead of modularizing it because having a bunch of version specific logic littered within one parser seems more unwieldy over time when there is many versions. Also with the proposed setup it helps with deprecating old ones where we can simply just delete old parsers and older versions' parsers shouldn't be touched most of the time.

closes codecov/engineering-team#1926
closes codecov/engineering-team#1927

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.

@JerrySentry JerrySentry changed the title Handle multiple BA stats file versions BA: Handle multiple file versions + introduce gzip size Jun 26, 2024
@JerrySentry JerrySentry marked this pull request as ready for review June 26, 2024 19:04
Copy link

codecov bot commented Jul 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.24%. Comparing base (093f199) to head (40074e6).

Current head 40074e6 differs from pull request most recent head 9041846

Please upload reports for the commit 9041846 to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #266      +/-   ##
==========================================
- Coverage   90.27%   89.24%   -1.04%     
==========================================
  Files         353      324      -29     
  Lines       11149     9993    -1156     
  Branches     1982     1782     -200     
==========================================
- Hits        10065     8918    -1147     
+ Misses       1014     1005       -9     
  Partials       70       70              
Flag Coverage Δ
shared-docker-uploader ?

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JerrySentry JerrySentry added this pull request to the merge queue Jul 8, 2024
Merged via the queue into main with commit b679996 Jul 8, 2024
6 checks passed
@JerrySentry JerrySentry deleted the jun_25_process_gzip branch July 8, 2024 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants