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

Add seekable method for TarReader use to determine whether the current reader supports seek #1411

Merged
merged 3 commits into from
Aug 29, 2023

Conversation

zyfjeff
Copy link
Contributor

@zyfjeff zyfjeff commented Aug 29, 2023

Relevant Issue (if applicable)

#1410

Details

Add seekable method for TarReader use to determine whether the current reader supports seek

Types of changes

What types of changes does your PullRequest introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation Update (if none of the other choices apply)

Checklist

Go over all the following points, and put an x in all the boxes that apply.

  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

@zyfjeff zyfjeff requested a review from a team as a code owner August 29, 2023 03:33
@zyfjeff zyfjeff requested review from bergwolf, liubin and gaius-qi and removed request for a team August 29, 2023 03:33
@codecov
Copy link

codecov bot commented Aug 29, 2023

Codecov Report

Merging #1411 (cf6107b) into master (d54c43f) will increase coverage by 0.00%.
The diff coverage is 60.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1411   +/-   ##
=======================================
  Coverage   46.43%   46.43%           
=======================================
  Files         123      123           
  Lines       38644    38655   +11     
  Branches    38644    38655   +11     
=======================================
+ Hits        17943    17951    +8     
- Misses      19727    19730    +3     
  Partials      974      974           
Files Changed Coverage Δ
builder/src/tarball.rs 62.69% <60.00%> (+0.02%) ⬆️

... and 2 files with indirect coverage changes

@anolis-bot
Copy link
Collaborator

@zyfjeff , the code has been updated, so a new test job has been submitted. Please wait in patience. The test job url: https://tone.openanolis.cn/ws/nrh4nnio/test_result/90733

TarReader::BufReaderInfoSeekable(b) => b.seek(pos),
_ => Err(enosys!("seek() not supported!")),
TarReader::File(f) => {
debug_assert!(seekable);
Copy link
Collaborator

@imeoer imeoer Aug 29, 2023

Choose a reason for hiding this comment

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

We do not recommend using debug_assert!, as this may cause inconsistent binary behavior between debug and release builds (although this would not happen here).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed, use assert!

…t reader supports seek

Signed-off-by: zyfjeff <zyfjeff@linux.alibaba.com>
@anolis-bot
Copy link
Collaborator

@zyfjeff , the code has been updated, so a new test job has been submitted. Please wait in patience. The test job url: https://tone.openanolis.cn/ws/nrh4nnio/test_result/90741

@zyfjeff
Copy link
Contributor Author

zyfjeff commented Aug 29, 2023

retest

@anolis-bot
Copy link
Collaborator

@zyfjeff , the code has been updated, so a new test job has been submitted. Please wait in patience. The test job url: https://tone.openanolis.cn/ws/nrh4nnio/test_result/90757

@anolis-bot
Copy link
Collaborator

@zyfjeff , the code has been updated, so a new test job has been submitted. Please wait in patience. The test job url: https://tone.openanolis.cn/ws/nrh4nnio/test_result/90760

…t reader supports seek

Signed-off-by: zyfjeff <zyfjeff@linux.alibaba.com>
@imeoer imeoer merged commit 631db29 into dragonflyoss:master Aug 29, 2023
24 checks passed
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.

None yet

3 participants