Skip to content

Reset processedCount when downloading all artifacts#889

Merged
konradpabjan merged 1 commit intoactions:mainfrom
campersau:patch-1
Nov 29, 2021
Merged

Reset processedCount when downloading all artifacts#889
konradpabjan merged 1 commit intoactions:mainfrom
campersau:patch-1

Conversation

@campersau
Copy link
Copy Markdown
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 brcrista requested a review from konradpabjan August 23, 2021 13:39
@brcrista
Copy link
Copy Markdown
Contributor

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

@brcrista
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown

TWiStErRob commented Nov 29, 2021

No tests? 😮

@konradpabjan
Copy link
Copy Markdown
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