mirror of
https://github.com/actions/cache.git
synced 2024-11-21 17:31:27 +01:00
New build
This commit is contained in:
parent
575160481d
commit
c2131abcd8
2 changed files with 84 additions and 536 deletions
310
dist/restore/index.js
vendored
310
dist/restore/index.js
vendored
|
@ -1199,6 +1199,11 @@ function assertDefined(name, value) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
exports.assertDefined = assertDefined;
|
exports.assertDefined = assertDefined;
|
||||||
|
function isGhes() {
|
||||||
|
const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
|
||||||
|
return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';
|
||||||
|
}
|
||||||
|
exports.isGhes = isGhes;
|
||||||
//# sourceMappingURL=cacheUtils.js.map
|
//# sourceMappingURL=cacheUtils.js.map
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
@ -1405,36 +1410,7 @@ exports.default = _default;
|
||||||
/* 39 */,
|
/* 39 */,
|
||||||
/* 40 */,
|
/* 40 */,
|
||||||
/* 41 */,
|
/* 41 */,
|
||||||
/* 42 */
|
/* 42 */,
|
||||||
/***/ (function(__unusedmodule, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright The OpenTelemetry Authors
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.createTraceState = void 0;
|
|
||||||
var tracestate_impl_1 = __webpack_require__(756);
|
|
||||||
function createTraceState(rawTraceState) {
|
|
||||||
return new tracestate_impl_1.TraceStateImpl(rawTraceState);
|
|
||||||
}
|
|
||||||
exports.createTraceState = createTraceState;
|
|
||||||
//# sourceMappingURL=utils.js.map
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
/* 43 */,
|
/* 43 */,
|
||||||
/* 44 */,
|
/* 44 */,
|
||||||
/* 45 */,
|
/* 45 */,
|
||||||
|
@ -3299,18 +3275,18 @@ function downloadCache(archiveLocation, archivePath, options) {
|
||||||
exports.downloadCache = downloadCache;
|
exports.downloadCache = downloadCache;
|
||||||
// Reserve Cache
|
// Reserve Cache
|
||||||
function reserveCache(key, paths, options) {
|
function reserveCache(key, paths, options) {
|
||||||
var _a, _b;
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const httpClient = createHttpClient();
|
const httpClient = createHttpClient();
|
||||||
const version = getCacheVersion(paths, options === null || options === void 0 ? void 0 : options.compressionMethod);
|
const version = getCacheVersion(paths, options === null || options === void 0 ? void 0 : options.compressionMethod);
|
||||||
const reserveCacheRequest = {
|
const reserveCacheRequest = {
|
||||||
key,
|
key,
|
||||||
version
|
version,
|
||||||
|
cacheSize: options === null || options === void 0 ? void 0 : options.cacheSize
|
||||||
};
|
};
|
||||||
const response = yield requestUtils_1.retryTypedResponse('reserveCache', () => __awaiter(this, void 0, void 0, function* () {
|
const response = yield requestUtils_1.retryTypedResponse('reserveCache', () => __awaiter(this, void 0, void 0, function* () {
|
||||||
return httpClient.postJson(getCacheApiUrl('caches'), reserveCacheRequest);
|
return httpClient.postJson(getCacheApiUrl('caches'), reserveCacheRequest);
|
||||||
}));
|
}));
|
||||||
return (_b = (_a = response === null || response === void 0 ? void 0 : response.result) === null || _a === void 0 ? void 0 : _a.cacheId) !== null && _b !== void 0 ? _b : -1;
|
return response;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.reserveCache = reserveCache;
|
exports.reserveCache = reserveCache;
|
||||||
|
@ -4467,7 +4443,7 @@ var NoopTracer_1 = __webpack_require__(151);
|
||||||
var NoopTracerProvider = /** @class */ (function () {
|
var NoopTracerProvider = /** @class */ (function () {
|
||||||
function NoopTracerProvider() {
|
function NoopTracerProvider() {
|
||||||
}
|
}
|
||||||
NoopTracerProvider.prototype.getTracer = function (_name, _version, _options) {
|
NoopTracerProvider.prototype.getTracer = function (_name, _version) {
|
||||||
return new NoopTracer_1.NoopTracer();
|
return new NoopTracer_1.NoopTracer();
|
||||||
};
|
};
|
||||||
return NoopTracerProvider;
|
return NoopTracerProvider;
|
||||||
|
@ -36291,9 +36267,9 @@ var ProxyTracerProvider = /** @class */ (function () {
|
||||||
/**
|
/**
|
||||||
* Get a {@link ProxyTracer}
|
* Get a {@link ProxyTracer}
|
||||||
*/
|
*/
|
||||||
ProxyTracerProvider.prototype.getTracer = function (name, version, options) {
|
ProxyTracerProvider.prototype.getTracer = function (name, version) {
|
||||||
var _a;
|
var _a;
|
||||||
return ((_a = this.getDelegateTracer(name, version, options)) !== null && _a !== void 0 ? _a : new ProxyTracer_1.ProxyTracer(this, name, version, options));
|
return ((_a = this.getDelegateTracer(name, version)) !== null && _a !== void 0 ? _a : new ProxyTracer_1.ProxyTracer(this, name, version));
|
||||||
};
|
};
|
||||||
ProxyTracerProvider.prototype.getDelegate = function () {
|
ProxyTracerProvider.prototype.getDelegate = function () {
|
||||||
var _a;
|
var _a;
|
||||||
|
@ -36305,9 +36281,9 @@ var ProxyTracerProvider = /** @class */ (function () {
|
||||||
ProxyTracerProvider.prototype.setDelegate = function (delegate) {
|
ProxyTracerProvider.prototype.setDelegate = function (delegate) {
|
||||||
this._delegate = delegate;
|
this._delegate = delegate;
|
||||||
};
|
};
|
||||||
ProxyTracerProvider.prototype.getDelegateTracer = function (name, version, options) {
|
ProxyTracerProvider.prototype.getDelegateTracer = function (name, version) {
|
||||||
var _a;
|
var _a;
|
||||||
return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version, options);
|
return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version);
|
||||||
};
|
};
|
||||||
return ProxyTracerProvider;
|
return ProxyTracerProvider;
|
||||||
}());
|
}());
|
||||||
|
@ -36346,11 +36322,10 @@ var NOOP_TRACER = new NoopTracer_1.NoopTracer();
|
||||||
* Proxy tracer provided by the proxy tracer provider
|
* Proxy tracer provided by the proxy tracer provider
|
||||||
*/
|
*/
|
||||||
var ProxyTracer = /** @class */ (function () {
|
var ProxyTracer = /** @class */ (function () {
|
||||||
function ProxyTracer(_provider, name, version, options) {
|
function ProxyTracer(_provider, name, version) {
|
||||||
this._provider = _provider;
|
this._provider = _provider;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.version = version;
|
this.version = version;
|
||||||
this.options = options;
|
|
||||||
}
|
}
|
||||||
ProxyTracer.prototype.startSpan = function (name, options, context) {
|
ProxyTracer.prototype.startSpan = function (name, options, context) {
|
||||||
return this._getTracer().startSpan(name, options, context);
|
return this._getTracer().startSpan(name, options, context);
|
||||||
|
@ -36367,7 +36342,7 @@ var ProxyTracer = /** @class */ (function () {
|
||||||
if (this._delegate) {
|
if (this._delegate) {
|
||||||
return this._delegate;
|
return this._delegate;
|
||||||
}
|
}
|
||||||
var tracer = this._provider.getDelegateTracer(this.name, this.version, this.options);
|
var tracer = this._provider.getDelegateTracer(this.name, this.version);
|
||||||
if (!tracer) {
|
if (!tracer) {
|
||||||
return NOOP_TRACER;
|
return NOOP_TRACER;
|
||||||
}
|
}
|
||||||
|
@ -37367,13 +37342,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.diag = exports.propagation = exports.trace = exports.context = exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = exports.isValidSpanId = exports.isValidTraceId = exports.isSpanContextValid = exports.createTraceState = exports.baggageEntryMetadataFromString = void 0;
|
exports.diag = exports.propagation = exports.trace = exports.context = exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = exports.isValidSpanId = exports.isValidTraceId = exports.isSpanContextValid = exports.baggageEntryMetadataFromString = void 0;
|
||||||
__exportStar(__webpack_require__(880), exports);
|
__exportStar(__webpack_require__(880), exports);
|
||||||
var utils_1 = __webpack_require__(112);
|
var utils_1 = __webpack_require__(112);
|
||||||
Object.defineProperty(exports, "baggageEntryMetadataFromString", { enumerable: true, get: function () { return utils_1.baggageEntryMetadataFromString; } });
|
Object.defineProperty(exports, "baggageEntryMetadataFromString", { enumerable: true, get: function () { return utils_1.baggageEntryMetadataFromString; } });
|
||||||
__exportStar(__webpack_require__(452), exports);
|
__exportStar(__webpack_require__(452), exports);
|
||||||
__exportStar(__webpack_require__(158), exports);
|
__exportStar(__webpack_require__(158), exports);
|
||||||
__exportStar(__webpack_require__(907), exports);
|
|
||||||
__exportStar(__webpack_require__(893), exports);
|
__exportStar(__webpack_require__(893), exports);
|
||||||
__exportStar(__webpack_require__(881), exports);
|
__exportStar(__webpack_require__(881), exports);
|
||||||
__exportStar(__webpack_require__(906), exports);
|
__exportStar(__webpack_require__(906), exports);
|
||||||
|
@ -37389,11 +37363,8 @@ __exportStar(__webpack_require__(220), exports);
|
||||||
__exportStar(__webpack_require__(932), exports);
|
__exportStar(__webpack_require__(932), exports);
|
||||||
__exportStar(__webpack_require__(975), exports);
|
__exportStar(__webpack_require__(975), exports);
|
||||||
__exportStar(__webpack_require__(207), exports);
|
__exportStar(__webpack_require__(207), exports);
|
||||||
var utils_2 = __webpack_require__(42);
|
|
||||||
Object.defineProperty(exports, "createTraceState", { enumerable: true, get: function () { return utils_2.createTraceState; } });
|
|
||||||
__exportStar(__webpack_require__(694), exports);
|
__exportStar(__webpack_require__(694), exports);
|
||||||
__exportStar(__webpack_require__(695), exports);
|
__exportStar(__webpack_require__(695), exports);
|
||||||
__exportStar(__webpack_require__(743), exports);
|
|
||||||
var spancontext_utils_1 = __webpack_require__(629);
|
var spancontext_utils_1 = __webpack_require__(629);
|
||||||
Object.defineProperty(exports, "isSpanContextValid", { enumerable: true, get: function () { return spancontext_utils_1.isSpanContextValid; } });
|
Object.defineProperty(exports, "isSpanContextValid", { enumerable: true, get: function () { return spancontext_utils_1.isSpanContextValid; } });
|
||||||
Object.defineProperty(exports, "isValidTraceId", { enumerable: true, get: function () { return spancontext_utils_1.isValidTraceId; } });
|
Object.defineProperty(exports, "isValidTraceId", { enumerable: true, get: function () { return spancontext_utils_1.isValidTraceId; } });
|
||||||
|
@ -42129,58 +42100,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
/* 587 */,
|
/* 587 */,
|
||||||
/* 588 */,
|
/* 588 */,
|
||||||
/* 589 */,
|
/* 589 */,
|
||||||
/* 590 */
|
/* 590 */,
|
||||||
/***/ (function(__unusedmodule, exports) {
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright The OpenTelemetry Authors
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.validateValue = exports.validateKey = void 0;
|
|
||||||
var VALID_KEY_CHAR_RANGE = '[_0-9a-z-*/]';
|
|
||||||
var VALID_KEY = "[a-z]" + VALID_KEY_CHAR_RANGE + "{0,255}";
|
|
||||||
var VALID_VENDOR_KEY = "[a-z0-9]" + VALID_KEY_CHAR_RANGE + "{0,240}@[a-z]" + VALID_KEY_CHAR_RANGE + "{0,13}";
|
|
||||||
var VALID_KEY_REGEX = new RegExp("^(?:" + VALID_KEY + "|" + VALID_VENDOR_KEY + ")$");
|
|
||||||
var VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/;
|
|
||||||
var INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/;
|
|
||||||
/**
|
|
||||||
* Key is opaque string up to 256 characters printable. It MUST begin with a
|
|
||||||
* lowercase letter, and can only contain lowercase letters a-z, digits 0-9,
|
|
||||||
* underscores _, dashes -, asterisks *, and forward slashes /.
|
|
||||||
* For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the
|
|
||||||
* vendor name. Vendors SHOULD set the tenant ID at the beginning of the key.
|
|
||||||
* see https://www.w3.org/TR/trace-context/#key
|
|
||||||
*/
|
|
||||||
function validateKey(key) {
|
|
||||||
return VALID_KEY_REGEX.test(key);
|
|
||||||
}
|
|
||||||
exports.validateKey = validateKey;
|
|
||||||
/**
|
|
||||||
* Value is opaque string up to 256 characters printable ASCII RFC0020
|
|
||||||
* characters (i.e., the range 0x20 to 0x7E) except comma , and =.
|
|
||||||
*/
|
|
||||||
function validateValue(value) {
|
|
||||||
return (VALID_VALUE_BASE_REGEX.test(value) &&
|
|
||||||
!INVALID_VALUE_COMMA_EQUAL_REGEX.test(value));
|
|
||||||
}
|
|
||||||
exports.validateValue = validateValue;
|
|
||||||
//# sourceMappingURL=tracestate-validators.js.map
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
/* 591 */,
|
/* 591 */,
|
||||||
/* 592 */,
|
/* 592 */,
|
||||||
/* 593 */,
|
/* 593 */,
|
||||||
|
@ -46526,18 +46446,12 @@ exports.restoreCache = restoreCache;
|
||||||
* @returns number returns cacheId if the cache was saved successfully and throws an error if save fails
|
* @returns number returns cacheId if the cache was saved successfully and throws an error if save fails
|
||||||
*/
|
*/
|
||||||
function saveCache(paths, key, options) {
|
function saveCache(paths, key, options) {
|
||||||
|
var _a, _b, _c, _d, _e;
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
checkPaths(paths);
|
checkPaths(paths);
|
||||||
checkKey(key);
|
checkKey(key);
|
||||||
const compressionMethod = yield utils.getCompressionMethod();
|
const compressionMethod = yield utils.getCompressionMethod();
|
||||||
core.debug('Reserving Cache');
|
let cacheId = null;
|
||||||
const cacheId = yield cacheHttpClient.reserveCache(key, paths, {
|
|
||||||
compressionMethod
|
|
||||||
});
|
|
||||||
if (cacheId === -1) {
|
|
||||||
throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache.`);
|
|
||||||
}
|
|
||||||
core.debug(`Cache ID: ${cacheId}`);
|
|
||||||
const cachePaths = yield utils.resolvePaths(paths);
|
const cachePaths = yield utils.resolvePaths(paths);
|
||||||
core.debug('Cache Paths:');
|
core.debug('Cache Paths:');
|
||||||
core.debug(`${JSON.stringify(cachePaths)}`);
|
core.debug(`${JSON.stringify(cachePaths)}`);
|
||||||
|
@ -46552,9 +46466,24 @@ function saveCache(paths, key, options) {
|
||||||
const fileSizeLimit = 10 * 1024 * 1024 * 1024; // 10GB per repo limit
|
const fileSizeLimit = 10 * 1024 * 1024 * 1024; // 10GB per repo limit
|
||||||
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
|
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
|
||||||
core.debug(`File Size: ${archiveFileSize}`);
|
core.debug(`File Size: ${archiveFileSize}`);
|
||||||
if (archiveFileSize > fileSizeLimit) {
|
// For GHES, this check will take place in ReserveCache API with enterprise file size limit
|
||||||
|
if (archiveFileSize > fileSizeLimit && !utils.isGhes()) {
|
||||||
throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`);
|
throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`);
|
||||||
}
|
}
|
||||||
|
core.debug('Reserving Cache');
|
||||||
|
const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, {
|
||||||
|
compressionMethod,
|
||||||
|
cacheSize: archiveFileSize
|
||||||
|
});
|
||||||
|
if ((_a = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.result) === null || _a === void 0 ? void 0 : _a.cacheId) {
|
||||||
|
cacheId = (_b = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.result) === null || _b === void 0 ? void 0 : _b.cacheId;
|
||||||
|
}
|
||||||
|
else if ((reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.statusCode) === 400) {
|
||||||
|
throw new ReserveCacheError((_d = (_c = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _c === void 0 ? void 0 : _c.message) !== null && _d !== void 0 ? _d : `Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the data cap limit, not saving cache.`);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache. More details: ${(_e = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _e === void 0 ? void 0 : _e.message}`);
|
||||||
|
}
|
||||||
core.debug(`Saving Cache (ID: ${cacheId})`);
|
core.debug(`Saving Cache (ID: ${cacheId})`);
|
||||||
yield cacheHttpClient.saveCache(cacheId, archivePath, options);
|
yield cacheHttpClient.saveCache(cacheId, archivePath, options);
|
||||||
}
|
}
|
||||||
|
@ -47241,30 +47170,7 @@ exports.OidcClient = OidcClient;
|
||||||
//# sourceMappingURL=oidc-utils.js.map
|
//# sourceMappingURL=oidc-utils.js.map
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
/* 743 */
|
/* 743 */,
|
||||||
/***/ (function(__unusedmodule, exports) {
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright The OpenTelemetry Authors
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
//# sourceMappingURL=tracer_options.js.map
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
/* 744 */,
|
/* 744 */,
|
||||||
/* 745 */,
|
/* 745 */,
|
||||||
/* 746 */,
|
/* 746 */,
|
||||||
|
@ -47361,117 +47267,7 @@ function async(callback)
|
||||||
/* 753 */,
|
/* 753 */,
|
||||||
/* 754 */,
|
/* 754 */,
|
||||||
/* 755 */,
|
/* 755 */,
|
||||||
/* 756 */
|
/* 756 */,
|
||||||
/***/ (function(__unusedmodule, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright The OpenTelemetry Authors
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.TraceStateImpl = void 0;
|
|
||||||
var tracestate_validators_1 = __webpack_require__(590);
|
|
||||||
var MAX_TRACE_STATE_ITEMS = 32;
|
|
||||||
var MAX_TRACE_STATE_LEN = 512;
|
|
||||||
var LIST_MEMBERS_SEPARATOR = ',';
|
|
||||||
var LIST_MEMBER_KEY_VALUE_SPLITTER = '=';
|
|
||||||
/**
|
|
||||||
* TraceState must be a class and not a simple object type because of the spec
|
|
||||||
* requirement (https://www.w3.org/TR/trace-context/#tracestate-field).
|
|
||||||
*
|
|
||||||
* Here is the list of allowed mutations:
|
|
||||||
* - New key-value pair should be added into the beginning of the list
|
|
||||||
* - The value of any key can be updated. Modified keys MUST be moved to the
|
|
||||||
* beginning of the list.
|
|
||||||
*/
|
|
||||||
var TraceStateImpl = /** @class */ (function () {
|
|
||||||
function TraceStateImpl(rawTraceState) {
|
|
||||||
this._internalState = new Map();
|
|
||||||
if (rawTraceState)
|
|
||||||
this._parse(rawTraceState);
|
|
||||||
}
|
|
||||||
TraceStateImpl.prototype.set = function (key, value) {
|
|
||||||
// TODO: Benchmark the different approaches(map vs list) and
|
|
||||||
// use the faster one.
|
|
||||||
var traceState = this._clone();
|
|
||||||
if (traceState._internalState.has(key)) {
|
|
||||||
traceState._internalState.delete(key);
|
|
||||||
}
|
|
||||||
traceState._internalState.set(key, value);
|
|
||||||
return traceState;
|
|
||||||
};
|
|
||||||
TraceStateImpl.prototype.unset = function (key) {
|
|
||||||
var traceState = this._clone();
|
|
||||||
traceState._internalState.delete(key);
|
|
||||||
return traceState;
|
|
||||||
};
|
|
||||||
TraceStateImpl.prototype.get = function (key) {
|
|
||||||
return this._internalState.get(key);
|
|
||||||
};
|
|
||||||
TraceStateImpl.prototype.serialize = function () {
|
|
||||||
var _this = this;
|
|
||||||
return this._keys()
|
|
||||||
.reduce(function (agg, key) {
|
|
||||||
agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + _this.get(key));
|
|
||||||
return agg;
|
|
||||||
}, [])
|
|
||||||
.join(LIST_MEMBERS_SEPARATOR);
|
|
||||||
};
|
|
||||||
TraceStateImpl.prototype._parse = function (rawTraceState) {
|
|
||||||
if (rawTraceState.length > MAX_TRACE_STATE_LEN)
|
|
||||||
return;
|
|
||||||
this._internalState = rawTraceState
|
|
||||||
.split(LIST_MEMBERS_SEPARATOR)
|
|
||||||
.reverse() // Store in reverse so new keys (.set(...)) will be placed at the beginning
|
|
||||||
.reduce(function (agg, part) {
|
|
||||||
var listMember = part.trim(); // Optional Whitespace (OWS) handling
|
|
||||||
var i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER);
|
|
||||||
if (i !== -1) {
|
|
||||||
var key = listMember.slice(0, i);
|
|
||||||
var value = listMember.slice(i + 1, part.length);
|
|
||||||
if (tracestate_validators_1.validateKey(key) && tracestate_validators_1.validateValue(value)) {
|
|
||||||
agg.set(key, value);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// TODO: Consider to add warning log
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return agg;
|
|
||||||
}, new Map());
|
|
||||||
// Because of the reverse() requirement, trunc must be done after map is created
|
|
||||||
if (this._internalState.size > MAX_TRACE_STATE_ITEMS) {
|
|
||||||
this._internalState = new Map(Array.from(this._internalState.entries())
|
|
||||||
.reverse() // Use reverse same as original tracestate parse chain
|
|
||||||
.slice(0, MAX_TRACE_STATE_ITEMS));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
TraceStateImpl.prototype._keys = function () {
|
|
||||||
return Array.from(this._internalState.keys()).reverse();
|
|
||||||
};
|
|
||||||
TraceStateImpl.prototype._clone = function () {
|
|
||||||
var traceState = new TraceStateImpl();
|
|
||||||
traceState._internalState = new Map(this._internalState);
|
|
||||||
return traceState;
|
|
||||||
};
|
|
||||||
return TraceStateImpl;
|
|
||||||
}());
|
|
||||||
exports.TraceStateImpl = TraceStateImpl;
|
|
||||||
//# sourceMappingURL=tracestate-impl.js.map
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
/* 757 */,
|
/* 757 */,
|
||||||
/* 758 */,
|
/* 758 */,
|
||||||
/* 759 */,
|
/* 759 */,
|
||||||
|
@ -49654,7 +49450,7 @@ module.exports = v4;
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.VERSION = void 0;
|
exports.VERSION = void 0;
|
||||||
// this is autogenerated file, see scripts/version-update.js
|
// this is autogenerated file, see scripts/version-update.js
|
||||||
exports.VERSION = '1.1.0';
|
exports.VERSION = '1.0.4';
|
||||||
//# sourceMappingURL=version.js.map
|
//# sourceMappingURL=version.js.map
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
@ -51786,7 +51582,8 @@ function retryTypedResponse(name, method, maxAttempts = constants_1.DefaultRetry
|
||||||
return {
|
return {
|
||||||
statusCode: error.statusCode,
|
statusCode: error.statusCode,
|
||||||
result: null,
|
result: null,
|
||||||
headers: {}
|
headers: {},
|
||||||
|
error
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -51877,30 +51674,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
//# sourceMappingURL=attributes.js.map
|
//# sourceMappingURL=attributes.js.map
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
/* 907 */
|
/* 907 */,
|
||||||
/***/ (function(__unusedmodule, exports) {
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright The OpenTelemetry Authors
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
//# sourceMappingURL=Attributes.js.map
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
/* 908 */,
|
/* 908 */,
|
||||||
/* 909 */,
|
/* 909 */,
|
||||||
/* 910 */
|
/* 910 */
|
||||||
|
|
310
dist/save/index.js
vendored
310
dist/save/index.js
vendored
|
@ -1199,6 +1199,11 @@ function assertDefined(name, value) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
exports.assertDefined = assertDefined;
|
exports.assertDefined = assertDefined;
|
||||||
|
function isGhes() {
|
||||||
|
const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
|
||||||
|
return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';
|
||||||
|
}
|
||||||
|
exports.isGhes = isGhes;
|
||||||
//# sourceMappingURL=cacheUtils.js.map
|
//# sourceMappingURL=cacheUtils.js.map
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
@ -1405,36 +1410,7 @@ exports.default = _default;
|
||||||
/* 39 */,
|
/* 39 */,
|
||||||
/* 40 */,
|
/* 40 */,
|
||||||
/* 41 */,
|
/* 41 */,
|
||||||
/* 42 */
|
/* 42 */,
|
||||||
/***/ (function(__unusedmodule, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright The OpenTelemetry Authors
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.createTraceState = void 0;
|
|
||||||
var tracestate_impl_1 = __webpack_require__(756);
|
|
||||||
function createTraceState(rawTraceState) {
|
|
||||||
return new tracestate_impl_1.TraceStateImpl(rawTraceState);
|
|
||||||
}
|
|
||||||
exports.createTraceState = createTraceState;
|
|
||||||
//# sourceMappingURL=utils.js.map
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
/* 43 */,
|
/* 43 */,
|
||||||
/* 44 */,
|
/* 44 */,
|
||||||
/* 45 */,
|
/* 45 */,
|
||||||
|
@ -3299,18 +3275,18 @@ function downloadCache(archiveLocation, archivePath, options) {
|
||||||
exports.downloadCache = downloadCache;
|
exports.downloadCache = downloadCache;
|
||||||
// Reserve Cache
|
// Reserve Cache
|
||||||
function reserveCache(key, paths, options) {
|
function reserveCache(key, paths, options) {
|
||||||
var _a, _b;
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const httpClient = createHttpClient();
|
const httpClient = createHttpClient();
|
||||||
const version = getCacheVersion(paths, options === null || options === void 0 ? void 0 : options.compressionMethod);
|
const version = getCacheVersion(paths, options === null || options === void 0 ? void 0 : options.compressionMethod);
|
||||||
const reserveCacheRequest = {
|
const reserveCacheRequest = {
|
||||||
key,
|
key,
|
||||||
version
|
version,
|
||||||
|
cacheSize: options === null || options === void 0 ? void 0 : options.cacheSize
|
||||||
};
|
};
|
||||||
const response = yield requestUtils_1.retryTypedResponse('reserveCache', () => __awaiter(this, void 0, void 0, function* () {
|
const response = yield requestUtils_1.retryTypedResponse('reserveCache', () => __awaiter(this, void 0, void 0, function* () {
|
||||||
return httpClient.postJson(getCacheApiUrl('caches'), reserveCacheRequest);
|
return httpClient.postJson(getCacheApiUrl('caches'), reserveCacheRequest);
|
||||||
}));
|
}));
|
||||||
return (_b = (_a = response === null || response === void 0 ? void 0 : response.result) === null || _a === void 0 ? void 0 : _a.cacheId) !== null && _b !== void 0 ? _b : -1;
|
return response;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.reserveCache = reserveCache;
|
exports.reserveCache = reserveCache;
|
||||||
|
@ -4467,7 +4443,7 @@ var NoopTracer_1 = __webpack_require__(151);
|
||||||
var NoopTracerProvider = /** @class */ (function () {
|
var NoopTracerProvider = /** @class */ (function () {
|
||||||
function NoopTracerProvider() {
|
function NoopTracerProvider() {
|
||||||
}
|
}
|
||||||
NoopTracerProvider.prototype.getTracer = function (_name, _version, _options) {
|
NoopTracerProvider.prototype.getTracer = function (_name, _version) {
|
||||||
return new NoopTracer_1.NoopTracer();
|
return new NoopTracer_1.NoopTracer();
|
||||||
};
|
};
|
||||||
return NoopTracerProvider;
|
return NoopTracerProvider;
|
||||||
|
@ -36291,9 +36267,9 @@ var ProxyTracerProvider = /** @class */ (function () {
|
||||||
/**
|
/**
|
||||||
* Get a {@link ProxyTracer}
|
* Get a {@link ProxyTracer}
|
||||||
*/
|
*/
|
||||||
ProxyTracerProvider.prototype.getTracer = function (name, version, options) {
|
ProxyTracerProvider.prototype.getTracer = function (name, version) {
|
||||||
var _a;
|
var _a;
|
||||||
return ((_a = this.getDelegateTracer(name, version, options)) !== null && _a !== void 0 ? _a : new ProxyTracer_1.ProxyTracer(this, name, version, options));
|
return ((_a = this.getDelegateTracer(name, version)) !== null && _a !== void 0 ? _a : new ProxyTracer_1.ProxyTracer(this, name, version));
|
||||||
};
|
};
|
||||||
ProxyTracerProvider.prototype.getDelegate = function () {
|
ProxyTracerProvider.prototype.getDelegate = function () {
|
||||||
var _a;
|
var _a;
|
||||||
|
@ -36305,9 +36281,9 @@ var ProxyTracerProvider = /** @class */ (function () {
|
||||||
ProxyTracerProvider.prototype.setDelegate = function (delegate) {
|
ProxyTracerProvider.prototype.setDelegate = function (delegate) {
|
||||||
this._delegate = delegate;
|
this._delegate = delegate;
|
||||||
};
|
};
|
||||||
ProxyTracerProvider.prototype.getDelegateTracer = function (name, version, options) {
|
ProxyTracerProvider.prototype.getDelegateTracer = function (name, version) {
|
||||||
var _a;
|
var _a;
|
||||||
return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version, options);
|
return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version);
|
||||||
};
|
};
|
||||||
return ProxyTracerProvider;
|
return ProxyTracerProvider;
|
||||||
}());
|
}());
|
||||||
|
@ -36346,11 +36322,10 @@ var NOOP_TRACER = new NoopTracer_1.NoopTracer();
|
||||||
* Proxy tracer provided by the proxy tracer provider
|
* Proxy tracer provided by the proxy tracer provider
|
||||||
*/
|
*/
|
||||||
var ProxyTracer = /** @class */ (function () {
|
var ProxyTracer = /** @class */ (function () {
|
||||||
function ProxyTracer(_provider, name, version, options) {
|
function ProxyTracer(_provider, name, version) {
|
||||||
this._provider = _provider;
|
this._provider = _provider;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.version = version;
|
this.version = version;
|
||||||
this.options = options;
|
|
||||||
}
|
}
|
||||||
ProxyTracer.prototype.startSpan = function (name, options, context) {
|
ProxyTracer.prototype.startSpan = function (name, options, context) {
|
||||||
return this._getTracer().startSpan(name, options, context);
|
return this._getTracer().startSpan(name, options, context);
|
||||||
|
@ -36367,7 +36342,7 @@ var ProxyTracer = /** @class */ (function () {
|
||||||
if (this._delegate) {
|
if (this._delegate) {
|
||||||
return this._delegate;
|
return this._delegate;
|
||||||
}
|
}
|
||||||
var tracer = this._provider.getDelegateTracer(this.name, this.version, this.options);
|
var tracer = this._provider.getDelegateTracer(this.name, this.version);
|
||||||
if (!tracer) {
|
if (!tracer) {
|
||||||
return NOOP_TRACER;
|
return NOOP_TRACER;
|
||||||
}
|
}
|
||||||
|
@ -37367,13 +37342,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.diag = exports.propagation = exports.trace = exports.context = exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = exports.isValidSpanId = exports.isValidTraceId = exports.isSpanContextValid = exports.createTraceState = exports.baggageEntryMetadataFromString = void 0;
|
exports.diag = exports.propagation = exports.trace = exports.context = exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = exports.isValidSpanId = exports.isValidTraceId = exports.isSpanContextValid = exports.baggageEntryMetadataFromString = void 0;
|
||||||
__exportStar(__webpack_require__(880), exports);
|
__exportStar(__webpack_require__(880), exports);
|
||||||
var utils_1 = __webpack_require__(112);
|
var utils_1 = __webpack_require__(112);
|
||||||
Object.defineProperty(exports, "baggageEntryMetadataFromString", { enumerable: true, get: function () { return utils_1.baggageEntryMetadataFromString; } });
|
Object.defineProperty(exports, "baggageEntryMetadataFromString", { enumerable: true, get: function () { return utils_1.baggageEntryMetadataFromString; } });
|
||||||
__exportStar(__webpack_require__(452), exports);
|
__exportStar(__webpack_require__(452), exports);
|
||||||
__exportStar(__webpack_require__(158), exports);
|
__exportStar(__webpack_require__(158), exports);
|
||||||
__exportStar(__webpack_require__(907), exports);
|
|
||||||
__exportStar(__webpack_require__(893), exports);
|
__exportStar(__webpack_require__(893), exports);
|
||||||
__exportStar(__webpack_require__(881), exports);
|
__exportStar(__webpack_require__(881), exports);
|
||||||
__exportStar(__webpack_require__(906), exports);
|
__exportStar(__webpack_require__(906), exports);
|
||||||
|
@ -37389,11 +37363,8 @@ __exportStar(__webpack_require__(220), exports);
|
||||||
__exportStar(__webpack_require__(932), exports);
|
__exportStar(__webpack_require__(932), exports);
|
||||||
__exportStar(__webpack_require__(975), exports);
|
__exportStar(__webpack_require__(975), exports);
|
||||||
__exportStar(__webpack_require__(207), exports);
|
__exportStar(__webpack_require__(207), exports);
|
||||||
var utils_2 = __webpack_require__(42);
|
|
||||||
Object.defineProperty(exports, "createTraceState", { enumerable: true, get: function () { return utils_2.createTraceState; } });
|
|
||||||
__exportStar(__webpack_require__(694), exports);
|
__exportStar(__webpack_require__(694), exports);
|
||||||
__exportStar(__webpack_require__(695), exports);
|
__exportStar(__webpack_require__(695), exports);
|
||||||
__exportStar(__webpack_require__(743), exports);
|
|
||||||
var spancontext_utils_1 = __webpack_require__(629);
|
var spancontext_utils_1 = __webpack_require__(629);
|
||||||
Object.defineProperty(exports, "isSpanContextValid", { enumerable: true, get: function () { return spancontext_utils_1.isSpanContextValid; } });
|
Object.defineProperty(exports, "isSpanContextValid", { enumerable: true, get: function () { return spancontext_utils_1.isSpanContextValid; } });
|
||||||
Object.defineProperty(exports, "isValidTraceId", { enumerable: true, get: function () { return spancontext_utils_1.isValidTraceId; } });
|
Object.defineProperty(exports, "isValidTraceId", { enumerable: true, get: function () { return spancontext_utils_1.isValidTraceId; } });
|
||||||
|
@ -42129,58 +42100,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
/* 587 */,
|
/* 587 */,
|
||||||
/* 588 */,
|
/* 588 */,
|
||||||
/* 589 */,
|
/* 589 */,
|
||||||
/* 590 */
|
/* 590 */,
|
||||||
/***/ (function(__unusedmodule, exports) {
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright The OpenTelemetry Authors
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.validateValue = exports.validateKey = void 0;
|
|
||||||
var VALID_KEY_CHAR_RANGE = '[_0-9a-z-*/]';
|
|
||||||
var VALID_KEY = "[a-z]" + VALID_KEY_CHAR_RANGE + "{0,255}";
|
|
||||||
var VALID_VENDOR_KEY = "[a-z0-9]" + VALID_KEY_CHAR_RANGE + "{0,240}@[a-z]" + VALID_KEY_CHAR_RANGE + "{0,13}";
|
|
||||||
var VALID_KEY_REGEX = new RegExp("^(?:" + VALID_KEY + "|" + VALID_VENDOR_KEY + ")$");
|
|
||||||
var VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/;
|
|
||||||
var INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/;
|
|
||||||
/**
|
|
||||||
* Key is opaque string up to 256 characters printable. It MUST begin with a
|
|
||||||
* lowercase letter, and can only contain lowercase letters a-z, digits 0-9,
|
|
||||||
* underscores _, dashes -, asterisks *, and forward slashes /.
|
|
||||||
* For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the
|
|
||||||
* vendor name. Vendors SHOULD set the tenant ID at the beginning of the key.
|
|
||||||
* see https://www.w3.org/TR/trace-context/#key
|
|
||||||
*/
|
|
||||||
function validateKey(key) {
|
|
||||||
return VALID_KEY_REGEX.test(key);
|
|
||||||
}
|
|
||||||
exports.validateKey = validateKey;
|
|
||||||
/**
|
|
||||||
* Value is opaque string up to 256 characters printable ASCII RFC0020
|
|
||||||
* characters (i.e., the range 0x20 to 0x7E) except comma , and =.
|
|
||||||
*/
|
|
||||||
function validateValue(value) {
|
|
||||||
return (VALID_VALUE_BASE_REGEX.test(value) &&
|
|
||||||
!INVALID_VALUE_COMMA_EQUAL_REGEX.test(value));
|
|
||||||
}
|
|
||||||
exports.validateValue = validateValue;
|
|
||||||
//# sourceMappingURL=tracestate-validators.js.map
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
/* 591 */,
|
/* 591 */,
|
||||||
/* 592 */,
|
/* 592 */,
|
||||||
/* 593 */,
|
/* 593 */,
|
||||||
|
@ -46619,18 +46539,12 @@ exports.restoreCache = restoreCache;
|
||||||
* @returns number returns cacheId if the cache was saved successfully and throws an error if save fails
|
* @returns number returns cacheId if the cache was saved successfully and throws an error if save fails
|
||||||
*/
|
*/
|
||||||
function saveCache(paths, key, options) {
|
function saveCache(paths, key, options) {
|
||||||
|
var _a, _b, _c, _d, _e;
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
checkPaths(paths);
|
checkPaths(paths);
|
||||||
checkKey(key);
|
checkKey(key);
|
||||||
const compressionMethod = yield utils.getCompressionMethod();
|
const compressionMethod = yield utils.getCompressionMethod();
|
||||||
core.debug('Reserving Cache');
|
let cacheId = null;
|
||||||
const cacheId = yield cacheHttpClient.reserveCache(key, paths, {
|
|
||||||
compressionMethod
|
|
||||||
});
|
|
||||||
if (cacheId === -1) {
|
|
||||||
throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache.`);
|
|
||||||
}
|
|
||||||
core.debug(`Cache ID: ${cacheId}`);
|
|
||||||
const cachePaths = yield utils.resolvePaths(paths);
|
const cachePaths = yield utils.resolvePaths(paths);
|
||||||
core.debug('Cache Paths:');
|
core.debug('Cache Paths:');
|
||||||
core.debug(`${JSON.stringify(cachePaths)}`);
|
core.debug(`${JSON.stringify(cachePaths)}`);
|
||||||
|
@ -46645,9 +46559,24 @@ function saveCache(paths, key, options) {
|
||||||
const fileSizeLimit = 10 * 1024 * 1024 * 1024; // 10GB per repo limit
|
const fileSizeLimit = 10 * 1024 * 1024 * 1024; // 10GB per repo limit
|
||||||
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
|
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
|
||||||
core.debug(`File Size: ${archiveFileSize}`);
|
core.debug(`File Size: ${archiveFileSize}`);
|
||||||
if (archiveFileSize > fileSizeLimit) {
|
// For GHES, this check will take place in ReserveCache API with enterprise file size limit
|
||||||
|
if (archiveFileSize > fileSizeLimit && !utils.isGhes()) {
|
||||||
throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`);
|
throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`);
|
||||||
}
|
}
|
||||||
|
core.debug('Reserving Cache');
|
||||||
|
const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, {
|
||||||
|
compressionMethod,
|
||||||
|
cacheSize: archiveFileSize
|
||||||
|
});
|
||||||
|
if ((_a = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.result) === null || _a === void 0 ? void 0 : _a.cacheId) {
|
||||||
|
cacheId = (_b = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.result) === null || _b === void 0 ? void 0 : _b.cacheId;
|
||||||
|
}
|
||||||
|
else if ((reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.statusCode) === 400) {
|
||||||
|
throw new ReserveCacheError((_d = (_c = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _c === void 0 ? void 0 : _c.message) !== null && _d !== void 0 ? _d : `Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the data cap limit, not saving cache.`);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache. More details: ${(_e = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _e === void 0 ? void 0 : _e.message}`);
|
||||||
|
}
|
||||||
core.debug(`Saving Cache (ID: ${cacheId})`);
|
core.debug(`Saving Cache (ID: ${cacheId})`);
|
||||||
yield cacheHttpClient.saveCache(cacheId, archivePath, options);
|
yield cacheHttpClient.saveCache(cacheId, archivePath, options);
|
||||||
}
|
}
|
||||||
|
@ -47334,30 +47263,7 @@ exports.OidcClient = OidcClient;
|
||||||
//# sourceMappingURL=oidc-utils.js.map
|
//# sourceMappingURL=oidc-utils.js.map
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
/* 743 */
|
/* 743 */,
|
||||||
/***/ (function(__unusedmodule, exports) {
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright The OpenTelemetry Authors
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
//# sourceMappingURL=tracer_options.js.map
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
/* 744 */,
|
/* 744 */,
|
||||||
/* 745 */,
|
/* 745 */,
|
||||||
/* 746 */,
|
/* 746 */,
|
||||||
|
@ -47454,117 +47360,7 @@ function async(callback)
|
||||||
/* 753 */,
|
/* 753 */,
|
||||||
/* 754 */,
|
/* 754 */,
|
||||||
/* 755 */,
|
/* 755 */,
|
||||||
/* 756 */
|
/* 756 */,
|
||||||
/***/ (function(__unusedmodule, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright The OpenTelemetry Authors
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.TraceStateImpl = void 0;
|
|
||||||
var tracestate_validators_1 = __webpack_require__(590);
|
|
||||||
var MAX_TRACE_STATE_ITEMS = 32;
|
|
||||||
var MAX_TRACE_STATE_LEN = 512;
|
|
||||||
var LIST_MEMBERS_SEPARATOR = ',';
|
|
||||||
var LIST_MEMBER_KEY_VALUE_SPLITTER = '=';
|
|
||||||
/**
|
|
||||||
* TraceState must be a class and not a simple object type because of the spec
|
|
||||||
* requirement (https://www.w3.org/TR/trace-context/#tracestate-field).
|
|
||||||
*
|
|
||||||
* Here is the list of allowed mutations:
|
|
||||||
* - New key-value pair should be added into the beginning of the list
|
|
||||||
* - The value of any key can be updated. Modified keys MUST be moved to the
|
|
||||||
* beginning of the list.
|
|
||||||
*/
|
|
||||||
var TraceStateImpl = /** @class */ (function () {
|
|
||||||
function TraceStateImpl(rawTraceState) {
|
|
||||||
this._internalState = new Map();
|
|
||||||
if (rawTraceState)
|
|
||||||
this._parse(rawTraceState);
|
|
||||||
}
|
|
||||||
TraceStateImpl.prototype.set = function (key, value) {
|
|
||||||
// TODO: Benchmark the different approaches(map vs list) and
|
|
||||||
// use the faster one.
|
|
||||||
var traceState = this._clone();
|
|
||||||
if (traceState._internalState.has(key)) {
|
|
||||||
traceState._internalState.delete(key);
|
|
||||||
}
|
|
||||||
traceState._internalState.set(key, value);
|
|
||||||
return traceState;
|
|
||||||
};
|
|
||||||
TraceStateImpl.prototype.unset = function (key) {
|
|
||||||
var traceState = this._clone();
|
|
||||||
traceState._internalState.delete(key);
|
|
||||||
return traceState;
|
|
||||||
};
|
|
||||||
TraceStateImpl.prototype.get = function (key) {
|
|
||||||
return this._internalState.get(key);
|
|
||||||
};
|
|
||||||
TraceStateImpl.prototype.serialize = function () {
|
|
||||||
var _this = this;
|
|
||||||
return this._keys()
|
|
||||||
.reduce(function (agg, key) {
|
|
||||||
agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + _this.get(key));
|
|
||||||
return agg;
|
|
||||||
}, [])
|
|
||||||
.join(LIST_MEMBERS_SEPARATOR);
|
|
||||||
};
|
|
||||||
TraceStateImpl.prototype._parse = function (rawTraceState) {
|
|
||||||
if (rawTraceState.length > MAX_TRACE_STATE_LEN)
|
|
||||||
return;
|
|
||||||
this._internalState = rawTraceState
|
|
||||||
.split(LIST_MEMBERS_SEPARATOR)
|
|
||||||
.reverse() // Store in reverse so new keys (.set(...)) will be placed at the beginning
|
|
||||||
.reduce(function (agg, part) {
|
|
||||||
var listMember = part.trim(); // Optional Whitespace (OWS) handling
|
|
||||||
var i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER);
|
|
||||||
if (i !== -1) {
|
|
||||||
var key = listMember.slice(0, i);
|
|
||||||
var value = listMember.slice(i + 1, part.length);
|
|
||||||
if (tracestate_validators_1.validateKey(key) && tracestate_validators_1.validateValue(value)) {
|
|
||||||
agg.set(key, value);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// TODO: Consider to add warning log
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return agg;
|
|
||||||
}, new Map());
|
|
||||||
// Because of the reverse() requirement, trunc must be done after map is created
|
|
||||||
if (this._internalState.size > MAX_TRACE_STATE_ITEMS) {
|
|
||||||
this._internalState = new Map(Array.from(this._internalState.entries())
|
|
||||||
.reverse() // Use reverse same as original tracestate parse chain
|
|
||||||
.slice(0, MAX_TRACE_STATE_ITEMS));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
TraceStateImpl.prototype._keys = function () {
|
|
||||||
return Array.from(this._internalState.keys()).reverse();
|
|
||||||
};
|
|
||||||
TraceStateImpl.prototype._clone = function () {
|
|
||||||
var traceState = new TraceStateImpl();
|
|
||||||
traceState._internalState = new Map(this._internalState);
|
|
||||||
return traceState;
|
|
||||||
};
|
|
||||||
return TraceStateImpl;
|
|
||||||
}());
|
|
||||||
exports.TraceStateImpl = TraceStateImpl;
|
|
||||||
//# sourceMappingURL=tracestate-impl.js.map
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
/* 757 */,
|
/* 757 */,
|
||||||
/* 758 */,
|
/* 758 */,
|
||||||
/* 759 */,
|
/* 759 */,
|
||||||
|
@ -49657,7 +49453,7 @@ module.exports = v4;
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.VERSION = void 0;
|
exports.VERSION = void 0;
|
||||||
// this is autogenerated file, see scripts/version-update.js
|
// this is autogenerated file, see scripts/version-update.js
|
||||||
exports.VERSION = '1.1.0';
|
exports.VERSION = '1.0.4';
|
||||||
//# sourceMappingURL=version.js.map
|
//# sourceMappingURL=version.js.map
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
@ -51789,7 +51585,8 @@ function retryTypedResponse(name, method, maxAttempts = constants_1.DefaultRetry
|
||||||
return {
|
return {
|
||||||
statusCode: error.statusCode,
|
statusCode: error.statusCode,
|
||||||
result: null,
|
result: null,
|
||||||
headers: {}
|
headers: {},
|
||||||
|
error
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -51880,30 +51677,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
//# sourceMappingURL=attributes.js.map
|
//# sourceMappingURL=attributes.js.map
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
/* 907 */
|
/* 907 */,
|
||||||
/***/ (function(__unusedmodule, exports) {
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright The OpenTelemetry Authors
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
//# sourceMappingURL=Attributes.js.map
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
/* 908 */,
|
/* 908 */,
|
||||||
/* 909 */,
|
/* 909 */,
|
||||||
/* 910 */
|
/* 910 */
|
||||||
|
|
Loading…
Reference in a new issue