1
0
Fork 0

@actions/artifact 0.3.1 update (#420)

* Updates to 0.3.1 package update
pull/425/head
Konrad Pabjan 2020-04-20 22:58:53 +02:00 committed by GitHub
parent a28977e977
commit bb1053a8a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 84 additions and 96 deletions

View File

@ -7,6 +7,7 @@ You can use this package to interact with the actions artifacts.
- [Download a Single Artifact](#Download-a-Single-Artifact)
- [Download All Artifacts](#Download-all-Artifacts)
- [Additional Documentation](#Additional-Documentation)
- [Contributions](#Contributions)
Relative paths and absolute paths are both allowed. Relative paths are rooted against the current working directory.

View File

@ -19,3 +19,8 @@
- Exponential backoff when retryable status codes are encountered
- Clearer error message if storage quota has been reached
- Improved logging and output during artifact download
### 0.3.1
- Fix to ensure temporary gzip files get correctly deleted during artifact upload
- Remove spaces as a forbidden character during upload

View File

@ -57,7 +57,6 @@ describe('Utils', () => {
'my|artifact',
'my*artifact',
'my?artifact',
'my artifact',
''
]
for (const invalidName of invalidNames) {
@ -87,7 +86,6 @@ describe('Utils', () => {
'some/invalid|artifact/path',
'some/invalid*artifact/path',
'some/invalid?artifact/path',
'some/invalid artifact/path',
''
]
for (const invalidName of invalidNames) {

View File

@ -17,7 +17,6 @@ When uploading an artifact, the inputted `name` parameter along with the files s
- |
- \*
- ?
- empty space
In addition to the aforementioned characters, the inputted `name` also cannot include the following
- \

View File

@ -4,7 +4,7 @@ Warning: Implementation details may change at any time without notice. This is m
## Upload/Compression flow
![image](https://user-images.githubusercontent.com/16109154/77190819-38685d80-6ada-11ea-8281-4703ff8cc025.png)
![image](https://user-images.githubusercontent.com/16109154/79765587-19522b00-8327-11ea-9679-410bb10e1b13.png)
## Retry Logic when downloading an individual file

View File

@ -1,6 +1,6 @@
{
"name": "@actions/artifact",
"version": "0.3.0",
"version": "0.3.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@actions/artifact",
"version": "0.3.0",
"version": "0.3.1",
"preview": true,
"description": "Actions artifact lib",
"keywords": [

View File

@ -248,23 +248,22 @@ export class UploadHttpClient {
}
} else {
// the file that is being uploaded is greater than 64k in size, a temporary file gets created on disk using the
// npm tmp-promise package and this file gets used during compression for the GZip file that gets created
return tmp
.file()
.then(async tmpFile => {
// npm tmp-promise package and this file gets used to create a GZipped file
const tempFile = await tmp.file()
// create a GZip file of the original file being uploaded, the original file should not be modified in any way
uploadFileSize = await createGZipFileOnDisk(
parameters.file,
tmpFile.path
tempFile.path
)
let uploadFilePath = tmpFile.path
let uploadFilePath = tempFile.path
// compression did not help with size reduction, use the original file for upload and delete the temp GZip file
if (totalFileSize < uploadFileSize) {
uploadFileSize = totalFileSize
uploadFilePath = parameters.file
isGzip = false
tmpFile.cleanup()
}
let abortFileUpload = false
@ -314,25 +313,20 @@ export class UploadHttpClient {
// successfully uploaded so the server may report a different size for what was uploaded
isUploadSuccessful = false
failedChunkSizes += chunkSize
core.warning(
`Aborting upload for ${parameters.file} due to failure`
)
core.warning(`Aborting upload for ${parameters.file} due to failure`)
abortFileUpload = true
}
}
})
.then(
async (): Promise<UploadFileResult> => {
// only after the file upload is complete and the temporary file is deleted, return the UploadResult
return new Promise(resolve => {
resolve({
// Delete the temporary file that was created as part of the upload. If the temp file does not get manually deleted by
// calling cleanup, it gets removed when the node process exits. For more info see: https://www.npmjs.com/package/tmp-promise#about
await tempFile.cleanup()
return {
isSuccess: isUploadSuccessful,
successfulUploadSize: uploadFileSize - failedChunkSizes,
totalSize: totalFileSize
})
})
}
)
}
}

View File

@ -245,16 +245,7 @@ Header Information: ${JSON.stringify(response.message.headers, undefined, 2)}
*
* FilePaths can include characters such as \ and / which are not permitted in the artifact name alone
*/
const invalidArtifactFilePathCharacters = [
'"',
':',
'<',
'>',
'|',
'*',
'?',
' '
]
const invalidArtifactFilePathCharacters = ['"', ':', '<', '>', '|', '*', '?']
const invalidArtifactNameCharacters = [
...invalidArtifactFilePathCharacters,
'\\',