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

Reset processedCount when downloading all artifacts #889

Merged
merged 1 commit into from
Nov 29, 2021

Conversation

campersau
Copy link
Contributor

@campersau campersau commented Aug 21, 2021

Currently the totalNumberOfFilesToProcess was reset for each artifact but not the processedCount which lead to percentage values higher than 100% when downloading all artifacts. Also resetting the processedCount to 0 fixes that and scopes the counts to a single artifact.

Fixes actions/download-artifact#95

Here is another output with > 100% percent in log output https://github.com/campersau/CefSharp/runs/3389459433?check_suite_focus=true#step:2:3. There are two artifacts with 4 files each:

No artifact name specified, downloading all artifacts
Creating an extra directory for each artifact that is being downloaded
Total number of files that will be downloaded: 4
Total file count: 4 ---- Processed file #3 (75.0%)
Total number of files that will be downloaded: 4
Total file count: 4 ---- Processed file #6 (150.0%) <!--- Total file count 4 but file 6!
There were 2 artifacts downloaded
Artifact netcore was downloaded to D:\a\CefSharp\CefSharp\netcore
Artifact netframework was downloaded to D:\a\CefSharp\CefSharp\netframework
Artifact download has finished successfully

@campersau campersau requested a review from a team August 21, 2021 15:27
@brcrista
Copy link
Contributor

@konradpabjan could you take a look when you get a chance since you have context on this code?

@brcrista
Copy link
Contributor

Also looks like we need to do another npm audit fix PR: https://github.com/actions/toolkit/pull/889/checks?check_run_id=3400902928

Copy link
Contributor

@konradpabjan konradpabjan left a comment

Choose a reason for hiding this comment

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

Looks good!

(the failing audit test are unrelated to these changes so we're good).

I'll work on pushing out a new version of the @actions/artifact package with these changes

@konradpabjan konradpabjan merged commit e19e426 into actions:main Nov 29, 2021
@TWiStErRob
Copy link

TWiStErRob commented Nov 29, 2021

No tests? 😮

@konradpabjan
Copy link
Contributor

konradpabjan commented Nov 30, 2021

@TWiStErRob

The changes here are relatively simple so it doesn't hurt though I'm running some extra tests locally to confirm behavior. There are a lot of tests for other parts of the upload/download process but the status reporter is something that is currently lacking https://github.com/actions/toolkit/tree/main/packages/artifact/__tests__

@campersau campersau deleted the patch-1 branch November 30, 2021 05:25
at-wat pushed a commit to at-wat/actions-toolkit that referenced this pull request Aug 31, 2023
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.

Strange percentages and file counts when downloading artifacts
4 participants