-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
@actions/artifact package updates #408
Conversation
@@ -296,3 +304,11 @@ export async function createDirectoriesForArtifact( | |||
}) | |||
} | |||
} | |||
|
|||
export async function createEmptyFilesForArtifact( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I followed the guidance here on how to create an empty file in node.
// ensure they are first created by using the createDirectoriesForArtifact method | ||
const directoryStructure = [root, directoryToCreate] | ||
await utils.createDirectoriesForArtifact(directoryStructure) | ||
await expect(fs.promises.access(root)).resolves.toEqual(undefined) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For asynchronously checking if files exist, I used this for guidance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's wrong with fs.existsSync
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fs.existsSync
is perfectly fine however I'm trying to use async/promises wherever possible. In general any sync operation will block the event loop until the operation is complete so asyncification is usually a good thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Left a couple of comments but they're not blocking
// ensure they are first created by using the createDirectoriesForArtifact method | ||
const directoryStructure = [root, directoryToCreate] | ||
await utils.createDirectoriesForArtifact(directoryStructure) | ||
await expect(fs.promises.access(root)).resolves.toEqual(undefined) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's wrong with fs.existsSync
?
* Clear error message when storage quota has been hit * Improved download of empty files * Extra info to RELEASES.md * PR Feedback
Overview
RELEASES.md
with changelog infopackage.json
andpackage-lock.json
403
might be returned when trying to create a new container for an artifact. There is now a clear error message that lets the user know they can't upload any more artifacts because of storage. For more info, see Try out v2-preview upload-artifact#62 (comment)upload.test.ts
to test a403
response code along with an extra test inutil.test.ts
v1
action ofdownload-artifact
has some extra logic when dealing with empty files. You can find it here. The updates in the PR largely aim to replicate this behavior so there are no extra HTTP calls made when downloading empty files.download-specification
has been updated with a newemptyFilesToCreate
array that keeps track of empty files that should be createdutil.ts
has been updated with a new method that creates empty filesdownload-specification
correctly picks up empty files and that empty files actually get createdTesting