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

fix: remove some buggy validation of BaseFlow values #167

Merged
merged 2 commits into from
Nov 2, 2023

Conversation

matt-codecov
Copy link
Contributor

tl;dr

fix notification_latency and other UploadFlow metrics by ceasing to inject the flow name into the value of each checkpoint in the flow

>>> json.dumps({ MyEnum.A: 1337 })

# Before
"{ 'MyEnum.A': 1337 }"

# After:
"{ 'A': 1337 }"

explanation

when serializing MyEnum checkpoints between tasks, i tried to inject the enum name into each enum value so MyEnum.A would have a value of "MyEnum.A" instead of just "A". the idea being, when trying to continue MyEnum in the next task, we could completely validate that the checkpoints data we're deserializing really came from MyEnum

my hacky method for accomplishing this didn't work and adding further complexity to this validation is not worth it, so this PR rips it out. there is still some protection against mismatching flows: checkpoints data is put into kwargs with a key that includes the flow name

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.

Copy link

codecov bot commented Nov 2, 2023

Codecov Report

Merging #167 (f3a351c) into main (164ee64) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Changes have been made to critical files, which contain lines commonly executed in production. Learn more

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #167   +/-   ##
=======================================
  Coverage   98.34%   98.34%           
=======================================
  Files         374      374           
  Lines       28135    28144    +9     
=======================================
+ Hits        27669    27678    +9     
  Misses        466      466           
Flag Coverage Δ
integration 98.38% <100.00%> (+<0.01%) ⬆️
latest-uploader-overall 98.38% <100.00%> (+<0.01%) ⬆️
unit 98.38% <100.00%> (+<0.01%) ⬆️

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

Components Coverage Δ
NonTestCode 96.77% <100.00%> (+<0.01%) ⬆️
OutsideTasks 98.16% <100.00%> (+<0.01%) ⬆️
Files Coverage Δ
helpers/checkpoint_logger/__init__.py Critical 94.65% <100.00%> (+0.11%) ⬆️
helpers/tests/unit/test_checkpoint_logger.py 99.62% <100.00%> (+<0.01%) ⬆️
tasks/tests/unit/test_notify_task.py 100.00% <100.00%> (ø)
tasks/tests/unit/test_upload_finisher_task.py 100.00% <100.00%> (ø)
Related Entrypoints
run/app.tasks.notify.Notify
run/app.tasks.upload.UploadFinisher
run/app.tasks.upload.Upload

@matt-codecov
Copy link
Contributor Author

upload_finisher_task and notify_task were creating a checkpoints data dict in tests and then passing it into the test. previously the task would take that dict as-is and any changes to the dict would actually be visible in the test, but now the task will create a new dict to properly cast the kwargs data into enum values. the test doesn't have a reference to that dict so we can't make asserts as to how it changes

@codecov-staging
Copy link

codecov-staging bot commented Nov 2, 2023

Codecov Report

Merging #167 (f3a351c) into main (164ee64) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #167   +/-   ##
=======================================
  Coverage   98.38%   98.38%           
=======================================
  Files         348      348           
  Lines       27639    27648    +9     
=======================================
+ Hits        27192    27201    +9     
  Misses        447      447           
Flag Coverage Δ
integration 98.38% <100.00%> (+<0.01%) ⬆️
latest-uploader-overall 98.38% <100.00%> (+<0.01%) ⬆️
unit 98.38% <100.00%> (+<0.01%) ⬆️

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

Components Coverage Δ
NonTestCode 96.87% <100.00%> (+<0.01%) ⬆️
OutsideTasks 98.16% <100.00%> (+<0.01%) ⬆️
Files Coverage Δ
helpers/checkpoint_logger/__init__.py 94.59% <100.00%> (+0.11%) ⬆️
helpers/tests/unit/test_checkpoint_logger.py 99.62% <100.00%> (+<0.01%) ⬆️
tasks/tests/unit/test_notify_task.py 100.00% <100.00%> (ø)
tasks/tests/unit/test_upload_finisher_task.py 100.00% <100.00%> (ø)

@codecov-qa
Copy link

codecov-qa bot commented Nov 2, 2023

Codecov Report

Merging #167 (f3a351c) into main (164ee64) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #167   +/-   ##
=======================================
  Coverage   98.38%   98.38%           
=======================================
  Files         348      348           
  Lines       27639    27648    +9     
=======================================
+ Hits        27192    27201    +9     
  Misses        447      447           
Flag Coverage Δ
integration 98.38% <100.00%> (+<0.01%) ⬆️
latest-uploader-overall 98.38% <100.00%> (+<0.01%) ⬆️
unit 98.38% <100.00%> (+<0.01%) ⬆️

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

Components Coverage Δ
NonTestCode 96.87% <100.00%> (+<0.01%) ⬆️
OutsideTasks 98.16% <100.00%> (+<0.01%) ⬆️
Files Coverage Δ
helpers/checkpoint_logger/__init__.py 94.59% <100.00%> (+0.11%) ⬆️
helpers/tests/unit/test_checkpoint_logger.py 99.62% <100.00%> (+<0.01%) ⬆️
tasks/tests/unit/test_notify_task.py 100.00% <100.00%> (ø)
tasks/tests/unit/test_upload_finisher_task.py 100.00% <100.00%> (ø)

Copy link

codecov-public-qa bot commented Nov 2, 2023

Codecov Report

Merging #167 (f3a351c) into main (164ee64) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #167   +/-   ##
=======================================
  Coverage   98.38%   98.38%           
=======================================
  Files         348      348           
  Lines       27639    27648    +9     
=======================================
+ Hits        27192    27201    +9     
  Misses        447      447           
Flag Coverage Δ
integration 98.38% <100.00%> (+<0.01%) ⬆️
latest-uploader-overall 98.38% <100.00%> (+<0.01%) ⬆️
unit 98.38% <100.00%> (+<0.01%) ⬆️

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

Components Coverage Δ
NonTestCode 96.87% <100.00%> (+<0.01%) ⬆️
OutsideTasks 98.16% <100.00%> (+<0.01%) ⬆️
Files Coverage Δ
helpers/checkpoint_logger/__init__.py 94.59% <100.00%> (+0.11%) ⬆️
helpers/tests/unit/test_checkpoint_logger.py 99.62% <100.00%> (+<0.01%) ⬆️
tasks/tests/unit/test_notify_task.py 100.00% <100.00%> (ø)
tasks/tests/unit/test_upload_finisher_task.py 100.00% <100.00%> (ø)

@matt-codecov matt-codecov merged commit 3f5918e into main Nov 2, 2023
29 of 30 checks passed
@matt-codecov matt-codecov deleted the matt/simplify-baseflow-values branch November 2, 2023 17: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
Development

Successfully merging this pull request may close these issues.

2 participants