fix(artifact): avoid zero-byte warning for empty raw-file uploads#2339
Open
mibragimov wants to merge 1 commit intoactions:mainfrom
Open
fix(artifact): avoid zero-byte warning for empty raw-file uploads#2339mibragimov wants to merge 1 commit intoactions:mainfrom
mibragimov wants to merge 1 commit intoactions:mainfrom
Conversation
When uploadArtifact is called with skipArchive=true on an empty file, blob upload progress remains at 0 bytes by design. The generic zero-byte warning in uploadToBlobStorage incorrectly reports this as a potential upload problem, even though the upload is valid. Add an internal upload option to suppress the zero-byte warning for this specific expected case. uploadArtifact now detects empty raw files and passes suppressZeroByteWarning=true only for skipArchive empty-file uploads. Also add a regression test to verify that empty raw-file uploads do not emit the warning. Fixes actions#2333
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Suppress the zero-byte upload warning when uploading a valid empty file with
skipArchive: true.Root Cause
uploadToBlobStorage()warns wheneveruploadByteCount === 0.For raw-file uploads (
skipArchive: true), uploading an empty file is a valid case, but progress remains 0 bytes and triggers the generic warning:No data was uploaded to blob storage. Reported upload byte count is 0.This warning is misleading because the upload succeeds and an empty file is expected to have zero bytes.
Fix
BlobUploadOptionsargument touploadToBlobStoragewithsuppressZeroByteWarning.uploadArtifact, detect empty raw-file uploads (skipArchive: trueand file size is 0) and passsuppressZeroByteWarning: true.Testing
upload-artifact.test.ts:should not warn when uploading an empty file with skipArchive enablednpm run lintnpx eslint packages/artifact/src/internal/upload/blob-upload.ts packages/artifact/src/internal/upload/upload-artifact.ts packages/artifact/__tests__/upload-artifact.test.tsnpx jest packages/artifact/__tests__/upload-artifact.test.ts --runInBandCloses #2333