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

ID-1570 - Fix dice-where and update dce-id to use the latest version #113

Merged
merged 4 commits into from
Aug 27, 2024

Conversation

snackk
Copy link
Member

@snackk snackk commented Aug 9, 2024

Alternative to -> #112

WHAT

Fix dice-where and update dce-id to use the newest dice-where version.


We call .md5() twice on the same StreamWithMD5Decorator object. This causes the second invocation to return the incorrect hash.

  • First call is newly added to the LocalFileAcceptor and S3FileAcceptor classes

  • Second call is already existing in S3Source.produce()

This causes dice-where to download a file successfully, but not return the correct DownloadExecutionResult when it’s finished processing. The error is triggered in the ID test DiceWhereDownloaderScheduleJobTest .

WHY

Recently dice-where was updated to add extra md5 checks prevent faulty downloads. We need to update id to use the newest version.

Sadly the above change also introduced a bug for services using dice-where as a library. This also needs to be fixed so that we can use the updated version in id.

AC

  • Dice-where is fixed so it no longer calls md5() twice on the same object.

  • dce-id testDiceWhereDownloaderScheduleJobTest passes with the updated version of dice-where

  • Updated dce-id can be deployed and successfully pulls in files from dce-shared.

Fix context

  @Override
  public int read(byte[] b, int off, int len) throws IOException {
    return inputStream.read(b, off, len);
  }

Override was necessary to keep the digest updated as the InputStream is being ingested in batches rather than in one sitting.

Copy link

codecov bot commented Aug 20, 2024

Codecov Report

Attention: Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.

Project coverage is 58.78%. Comparing base (6703b9d) to head (e8f49a5).

Files Patch % Lines
...ownloader/destination/local/LocalFileAcceptor.java 0.00% 1 Missing ⚠️
...here/downloader/stream/StreamWithMD5Decorator.java 87.50% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #113      +/-   ##
============================================
+ Coverage     58.75%   58.78%   +0.03%     
- Complexity      370      371       +1     
============================================
  Files            97       97              
  Lines          1913     1917       +4     
  Branches        167      167              
============================================
+ Hits           1124     1127       +3     
- Misses          730      731       +1     
  Partials         59       59              

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

@snackk snackk changed the title ID-1570 - Alternative way; ID-1570 - Fix dice-where and update dce-id to use the latest version Aug 20, 2024
@snackk snackk merged commit 4c68df5 into master Aug 27, 2024
3 checks passed
@snackk snackk deleted the bufix/alternative-1570-impl branch August 27, 2024 13:43
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.

6 participants