Skip to content

Commit

Permalink
"update dependencies and changelog"
Browse files Browse the repository at this point in the history
  • Loading branch information
Swatinem committed May 13, 2023
1 parent 7c7e41a commit 865fd1f
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 34 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Changelog

## 2.2.2
## 2.3.0

- Add `cache-all-crates` option, which is enables caching of creates installed by workflows.
- Add `cache-all-crates` option, which enables caching of crates installed by workflows.
- Add installed packages to cache key, so changes to workflows that install rust tools are detected and cached properly.
- Fix cache restore failures due to upstream bug.
- Fix `EISDIR` error due to globed directories.
Expand Down
56 changes: 52 additions & 4 deletions dist/restore/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14634,16 +14634,45 @@ function setStateError(inputs) {
throw error;
};
}
function appendReadableErrorMessage(currentMessage, innerMessage) {
let message = currentMessage;
if (message.slice(-1) !== ".") {
message = message + ".";
}
return message + " " + innerMessage;
}
function simplifyError(err) {
let message = err.message;
let code = err.code;
let curErr = err;
while (curErr.innererror) {
curErr = curErr.innererror;
code = curErr.code;
message = appendReadableErrorMessage(message, curErr.message);
}
return {
code,
message,
};
}
function processOperationStatus(result) {
const { state, stateProxy, status, isDone, processResult, response, setErrorAsResult } = result;
const { state, stateProxy, status, isDone, processResult, getError, response, setErrorAsResult } = result;
switch (status) {
case "succeeded": {
stateProxy.setSucceeded(state);
break;
}
case "failed": {
stateProxy.setError(state, new Error(`The long-running operation has failed`));
const err = getError === null || getError === void 0 ? void 0 : getError(response);
let postfix = "";
if (err) {
const { code, message } = simplifyError(err);
postfix = `. ${code}. ${message}`;
}
const errStr = `The long-running operation has failed${postfix}`;
stateProxy.setError(state, new Error(errStr));
stateProxy.setFailed(state);
logger.warning(errStr);
break;
}
case "canceled": {
Expand Down Expand Up @@ -14706,7 +14735,7 @@ async function pollOperationHelper(inputs) {
}
/** Polls the long-running operation. */
async function pollOperation(inputs) {
const { poll, state, stateProxy, options, getOperationStatus, getResourceLocation, getOperationLocation, isOperationError, withOperationLocation, getPollingInterval, processResult, updateState, setDelay, isDone, setErrorAsResult, } = inputs;
const { poll, state, stateProxy, options, getOperationStatus, getResourceLocation, getOperationLocation, isOperationError, withOperationLocation, getPollingInterval, processResult, getError, updateState, setDelay, isDone, setErrorAsResult, } = inputs;
const { operationLocation } = state.config;
if (operationLocation !== undefined) {
const { response, status } = await pollOperationHelper({
Expand All @@ -14726,6 +14755,7 @@ async function pollOperation(inputs) {
stateProxy,
isDone,
processResult,
getError,
setErrorAsResult,
});
if (!terminalStates.includes(status)) {
Expand Down Expand Up @@ -14879,6 +14909,18 @@ function parseRetryAfter({ rawResponse }) {
}
return undefined;
}
function getErrorFromResponse(response) {
const error = response.flatResponse.error;
if (!error) {
logger.warning(`The long-running operation failed but there is no error property in the response's body`);
return;
}
if (!error.code || !error.message) {
logger.warning(`The long-running operation failed but the error property in the response's body doesn't contain code or message`);
return;
}
return error;
}
function calculatePollingIntervalFromDate(retryAfterDate) {
const timeNow = Math.floor(new Date().getTime());
const retryAfterTime = retryAfterDate.getTime();
Expand Down Expand Up @@ -14986,6 +15028,7 @@ async function pollHttpOperation(inputs) {
processResult: processResult
? ({ flatResponse }, inputState) => processResult(flatResponse, inputState)
: ({ flatResponse }) => flatResponse,
getError: getErrorFromResponse,
updateState,
getPollingInterval: parseRetryAfter,
getOperationLocation,
Expand Down Expand Up @@ -15027,7 +15070,7 @@ const createStateProxy$1 = () => ({
* Returns a poller factory.
*/
function buildCreatePoller(inputs) {
const { getOperationLocation, getStatusFromInitialResponse, getStatusFromPollResponse, isOperationError, getResourceLocation, getPollingInterval, resolveOnUnsuccessful, } = inputs;
const { getOperationLocation, getStatusFromInitialResponse, getStatusFromPollResponse, isOperationError, getResourceLocation, getPollingInterval, getError, resolveOnUnsuccessful, } = inputs;
return async ({ init, poll }, options) => {
const { processResult, updateState, withOperationLocation: withOperationLocationCallback, intervalInMs = POLL_INTERVAL_IN_MS, restoreFrom, } = options || {};
const stateProxy = createStateProxy$1();
Expand Down Expand Up @@ -15132,6 +15175,7 @@ function buildCreatePoller(inputs) {
getOperationStatus: getStatusFromPollResponse,
getResourceLocation,
processResult,
getError,
updateState,
options: pollOptions,
setDelay: (pollIntervalInMs) => {
Expand Down Expand Up @@ -15170,6 +15214,7 @@ async function createHttpPoller(lro, options) {
getOperationLocation,
getResourceLocation,
getPollingInterval: parseRetryAfter,
getError: getErrorFromResponse,
resolveOnUnsuccessful,
})({
init: async () => {
Expand Down Expand Up @@ -16255,6 +16300,9 @@ function objectHasProperty(thing, property) {

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
/*
* NOTE: When moving this file, please update "react-native" section in package.json.
*/
/**
* Generated Universally Unique Identifier
*
Expand Down
56 changes: 52 additions & 4 deletions dist/save/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14634,16 +14634,45 @@ function setStateError(inputs) {
throw error;
};
}
function appendReadableErrorMessage(currentMessage, innerMessage) {
let message = currentMessage;
if (message.slice(-1) !== ".") {
message = message + ".";
}
return message + " " + innerMessage;
}
function simplifyError(err) {
let message = err.message;
let code = err.code;
let curErr = err;
while (curErr.innererror) {
curErr = curErr.innererror;
code = curErr.code;
message = appendReadableErrorMessage(message, curErr.message);
}
return {
code,
message,
};
}
function processOperationStatus(result) {
const { state, stateProxy, status, isDone, processResult, response, setErrorAsResult } = result;
const { state, stateProxy, status, isDone, processResult, getError, response, setErrorAsResult } = result;
switch (status) {
case "succeeded": {
stateProxy.setSucceeded(state);
break;
}
case "failed": {
stateProxy.setError(state, new Error(`The long-running operation has failed`));
const err = getError === null || getError === void 0 ? void 0 : getError(response);
let postfix = "";
if (err) {
const { code, message } = simplifyError(err);
postfix = `. ${code}. ${message}`;
}
const errStr = `The long-running operation has failed${postfix}`;
stateProxy.setError(state, new Error(errStr));
stateProxy.setFailed(state);
logger.warning(errStr);
break;
}
case "canceled": {
Expand Down Expand Up @@ -14706,7 +14735,7 @@ async function pollOperationHelper(inputs) {
}
/** Polls the long-running operation. */
async function pollOperation(inputs) {
const { poll, state, stateProxy, options, getOperationStatus, getResourceLocation, getOperationLocation, isOperationError, withOperationLocation, getPollingInterval, processResult, updateState, setDelay, isDone, setErrorAsResult, } = inputs;
const { poll, state, stateProxy, options, getOperationStatus, getResourceLocation, getOperationLocation, isOperationError, withOperationLocation, getPollingInterval, processResult, getError, updateState, setDelay, isDone, setErrorAsResult, } = inputs;
const { operationLocation } = state.config;
if (operationLocation !== undefined) {
const { response, status } = await pollOperationHelper({
Expand All @@ -14726,6 +14755,7 @@ async function pollOperation(inputs) {
stateProxy,
isDone,
processResult,
getError,
setErrorAsResult,
});
if (!terminalStates.includes(status)) {
Expand Down Expand Up @@ -14879,6 +14909,18 @@ function parseRetryAfter({ rawResponse }) {
}
return undefined;
}
function getErrorFromResponse(response) {
const error = response.flatResponse.error;
if (!error) {
logger.warning(`The long-running operation failed but there is no error property in the response's body`);
return;
}
if (!error.code || !error.message) {
logger.warning(`The long-running operation failed but the error property in the response's body doesn't contain code or message`);
return;
}
return error;
}
function calculatePollingIntervalFromDate(retryAfterDate) {
const timeNow = Math.floor(new Date().getTime());
const retryAfterTime = retryAfterDate.getTime();
Expand Down Expand Up @@ -14986,6 +15028,7 @@ async function pollHttpOperation(inputs) {
processResult: processResult
? ({ flatResponse }, inputState) => processResult(flatResponse, inputState)
: ({ flatResponse }) => flatResponse,
getError: getErrorFromResponse,
updateState,
getPollingInterval: parseRetryAfter,
getOperationLocation,
Expand Down Expand Up @@ -15027,7 +15070,7 @@ const createStateProxy$1 = () => ({
* Returns a poller factory.
*/
function buildCreatePoller(inputs) {
const { getOperationLocation, getStatusFromInitialResponse, getStatusFromPollResponse, isOperationError, getResourceLocation, getPollingInterval, resolveOnUnsuccessful, } = inputs;
const { getOperationLocation, getStatusFromInitialResponse, getStatusFromPollResponse, isOperationError, getResourceLocation, getPollingInterval, getError, resolveOnUnsuccessful, } = inputs;
return async ({ init, poll }, options) => {
const { processResult, updateState, withOperationLocation: withOperationLocationCallback, intervalInMs = POLL_INTERVAL_IN_MS, restoreFrom, } = options || {};
const stateProxy = createStateProxy$1();
Expand Down Expand Up @@ -15132,6 +15175,7 @@ function buildCreatePoller(inputs) {
getOperationStatus: getStatusFromPollResponse,
getResourceLocation,
processResult,
getError,
updateState,
options: pollOptions,
setDelay: (pollIntervalInMs) => {
Expand Down Expand Up @@ -15170,6 +15214,7 @@ async function createHttpPoller(lro, options) {
getOperationLocation,
getResourceLocation,
getPollingInterval: parseRetryAfter,
getError: getErrorFromResponse,
resolveOnUnsuccessful,
})({
init: async () => {
Expand Down Expand Up @@ -16255,6 +16300,9 @@ function objectHasProperty(thing, property) {

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
/*
* NOTE: When moving this file, please update "react-native" section in package.json.
*/
/**
* Generated Universally Unique Identifier
*
Expand Down
48 changes: 24 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 865fd1f

Please sign in to comment.