Skip to content

problem_report: use iterator in CompressedValue.write - #638

Merged
bdrung merged 5 commits into
canonical:mainfrom
bdrung:use-iterator
Aug 20, 2026
Merged

problem_report: use iterator in CompressedValue.write#638
bdrung merged 5 commits into
canonical:mainfrom
bdrung:use-iterator

Conversation

@bdrung

@bdrung bdrung commented Jul 27, 2026

Copy link
Copy Markdown
Member

Use the iterator version decode_compressed_stream in CompressedValue.write to avoid code duplication.

This is in preparation for #639 which is not ready yet.

@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.47%. Comparing base (99176a8) to head (1657f93).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
problem_report.py 90.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #638   +/-   ##
=======================================
  Coverage   84.46%   84.47%           
=======================================
  Files         106      106           
  Lines       21066    21038   -28     
  Branches     3195     3184   -11     
=======================================
- Hits        17794    17772   -22     
+ Misses       2800     2794    -6     
  Partials      472      472           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bdrung
bdrung requested a review from Hyask July 30, 2026 09:33
@bdrung
bdrung force-pushed the use-iterator branch 3 times, most recently from 04090a3 to c44cde4 Compare August 3, 2026 23:30
@bdrung bdrung added the bug Something isn't working label Aug 19, 2026
@bdrung

bdrung commented Aug 19, 2026

Copy link
Copy Markdown
Member Author

I am marking this PR as bug fix, because "problem_report: check if eof is reached in decode_compressed_stream" fixes silently failing.

bdrung added 5 commits August 20, 2026 12:48
The method `decode_compressed_stream` is used outside of
`CompressedValue`. Move this method to a stand-alone function to ease
reusing it.
Do not rely on the implementation detail and create a real corrupted
core dump for testing `add_gdb_info` in
`test_add_gdb_info_damaged_gz_core`.
`CompressedValue.decode_compressed_stream` does not raise an `EOFError`
in case the file ended before the end-of-stream marker was reached, but
`gzip.GzipFile` would do that.
Make the code more readable and compact by instructing zlib to use
native gzip header and trailer processing.
Use the iterator version `decode_compressed_stream` in
`CompressedValue.write` to avoid code duplication.

@Hyask Hyask left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Alright, reading this commit by commit makes a lot more sense than the whole diff. LGTM.

@bdrung
bdrung merged commit 1657f93 into canonical:main Aug 20, 2026
51 of 53 checks passed
@bdrung
bdrung deleted the use-iterator branch August 20, 2026 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants