Update detsys-ts (#75)

This commit is contained in:
Graham Christensen 2024-04-12 15:31:59 -04:00 committed by GitHub
parent 5d2215c1e1
commit 5c49fa4feb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 44 additions and 20 deletions

52
dist/index.js generated vendored
View file

@ -90087,7 +90087,7 @@ function firstString() {
var external_path_ = __nccwpck_require__(1017); var external_path_ = __nccwpck_require__(1017);
;// CONCATENATED MODULE: external "node:crypto" ;// CONCATENATED MODULE: external "node:crypto"
const external_node_crypto_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:crypto"); const external_node_crypto_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:crypto");
;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@54997e25f6d1eb824204fb17993e738e6e3c6e0c_zusoj7ejanbgahoiv2adotbxii/node_modules/detsys-ts/dist/correlation.js ;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@3a315cdffd83d4b229d4fb16548d22a3756baf28_lprtsns3vmnabnzqpk64lag6gi/node_modules/detsys-ts/dist/correlation.js
function identify(projectName) { function identify(projectName) {
@ -90108,20 +90108,33 @@ function identify(projectName) {
"GITHUB_REPOSITORY_ID", "GITHUB_REPOSITORY_ID",
"GITHUB_WORKFLOW", "GITHUB_WORKFLOW",
]), ]),
run: hashEnvironmentVariables("GHWR", [ job: hashEnvironmentVariables("GHWJ", [
"GITHUB_SERVER_URL", "GITHUB_SERVER_URL",
"GITHUB_REPOSITORY_OWNER", "GITHUB_REPOSITORY_OWNER",
"GITHUB_REPOSITORY_OWNER_ID", "GITHUB_REPOSITORY_OWNER_ID",
"GITHUB_REPOSITORY", "GITHUB_REPOSITORY",
"GITHUB_REPOSITORY_ID", "GITHUB_REPOSITORY_ID",
"GITHUB_WORKFLOW",
"GITHUB_JOB",
]),
run: hashEnvironmentVariables("GHWJR", [
"GITHUB_SERVER_URL",
"GITHUB_REPOSITORY_OWNER",
"GITHUB_REPOSITORY_OWNER_ID",
"GITHUB_REPOSITORY",
"GITHUB_REPOSITORY_ID",
"GITHUB_WORKFLOW",
"GITHUB_JOB",
"GITHUB_RUN_ID", "GITHUB_RUN_ID",
]), ]),
run_differentiator: hashEnvironmentVariables("GHWA", [ run_differentiator: hashEnvironmentVariables("GHWJA", [
"GITHUB_SERVER_URL", "GITHUB_SERVER_URL",
"GITHUB_REPOSITORY_OWNER", "GITHUB_REPOSITORY_OWNER",
"GITHUB_REPOSITORY_OWNER_ID", "GITHUB_REPOSITORY_OWNER_ID",
"GITHUB_REPOSITORY", "GITHUB_REPOSITORY",
"GITHUB_REPOSITORY_ID", "GITHUB_REPOSITORY_ID",
"GITHUB_WORKFLOW",
"GITHUB_JOB",
"GITHUB_RUN_ID", "GITHUB_RUN_ID",
"GITHUB_RUN_NUMBER", "GITHUB_RUN_NUMBER",
"GITHUB_RUN_ATTEMPT", "GITHUB_RUN_ATTEMPT",
@ -90156,9 +90169,9 @@ function hashEnvironmentVariables(prefix, variables) {
return `${prefix}-${hash.digest("hex")}`; return `${prefix}-${hash.digest("hex")}`;
} }
;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@54997e25f6d1eb824204fb17993e738e6e3c6e0c_zusoj7ejanbgahoiv2adotbxii/node_modules/detsys-ts/dist/package.json ;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@3a315cdffd83d4b229d4fb16548d22a3756baf28_lprtsns3vmnabnzqpk64lag6gi/node_modules/detsys-ts/dist/package.json
const package_namespaceObject = {"i8":"1.0.0"}; const package_namespaceObject = {"i8":"1.0.0"};
;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@54997e25f6d1eb824204fb17993e738e6e3c6e0c_zusoj7ejanbgahoiv2adotbxii/node_modules/detsys-ts/dist/platform.js ;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@3a315cdffd83d4b229d4fb16548d22a3756baf28_lprtsns3vmnabnzqpk64lag6gi/node_modules/detsys-ts/dist/platform.js
function getArchOs() { function getArchOs() {
const envArch = process.env.RUNNER_ARCH; const envArch = process.env.RUNNER_ARCH;
@ -90188,7 +90201,7 @@ function getNixPlatform(archOs) {
} }
} }
;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@54997e25f6d1eb824204fb17993e738e6e3c6e0c_zusoj7ejanbgahoiv2adotbxii/node_modules/detsys-ts/dist/sourcedef.js ;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@3a315cdffd83d4b229d4fb16548d22a3756baf28_lprtsns3vmnabnzqpk64lag6gi/node_modules/detsys-ts/dist/sourcedef.js
function constructSourceParameters(legacyPrefix) { function constructSourceParameters(legacyPrefix) {
const noisilyGetInput = (suffix) => { const noisilyGetInput = (suffix) => {
@ -97199,7 +97212,7 @@ const validate = uuid_dist/* validate */.Gu;
const stringify = uuid_dist/* stringify */.Pz; const stringify = uuid_dist/* stringify */.Pz;
const parse = uuid_dist/* parse */.Qc; const parse = uuid_dist/* parse */.Qc;
;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@54997e25f6d1eb824204fb17993e738e6e3c6e0c_zusoj7ejanbgahoiv2adotbxii/node_modules/detsys-ts/dist/main.js ;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@3a315cdffd83d4b229d4fb16548d22a3756baf28_lprtsns3vmnabnzqpk64lag6gi/node_modules/detsys-ts/dist/main.js
// eslint-disable-next-line import/extensions // eslint-disable-next-line import/extensions
@ -97217,6 +97230,11 @@ const parse = uuid_dist/* parse */.Qc;
const DEFAULT_IDS_HOST = "https://install.determinate.systems"; const DEFAULT_IDS_HOST = "https://install.determinate.systems";
const IDS_HOST = process.env["IDS_HOST"] ?? DEFAULT_IDS_HOST; const IDS_HOST = process.env["IDS_HOST"] ?? DEFAULT_IDS_HOST;
const EVENT_EXCEPTION = "exception";
const EVENT_ARTIFACT_CACHE_HIT = "artifact_cache_hit";
const EVENT_ARTIFACT_CACHE_MISS = "artifact_cache_miss";
const FACT_ENDED_WITH_EXCEPTION = "ended_with_exception";
const FACT_FINAL_EXCEPTION = "final_exception";
class IdsToolbox { class IdsToolbox {
constructor(actionOptions) { constructor(actionOptions) {
this.actionOptions = makeOptionsConfident(actionOptions); this.actionOptions = makeOptionsConfident(actionOptions);
@ -97302,22 +97320,28 @@ class IdsToolbox {
} }
async executeAsync() { async executeAsync() {
try { try {
process.env.DETSYS_CORRELATION = JSON.stringify(this.getCorrelationHashes());
if (this.executionPhase === "main" && this.hookMain) { if (this.executionPhase === "main" && this.hookMain) {
await this.hookMain(); await this.hookMain();
} }
else if (this.executionPhase === "post" && this.hookPost) { else if (this.executionPhase === "post" && this.hookPost) {
await this.hookPost(); await this.hookPost();
} }
this.addFact("ended_with_exception", false); this.addFact(FACT_ENDED_WITH_EXCEPTION, false);
} }
catch (error) { catch (error) {
this.addFact("ended_with_exception", true); this.addFact(FACT_ENDED_WITH_EXCEPTION, true);
const reportable = error instanceof Error || typeof error == "string" const reportable = error instanceof Error || typeof error == "string"
? error.toString() ? error.toString()
: JSON.stringify(error); : JSON.stringify(error);
this.addFact("final_exception", reportable); this.addFact(FACT_FINAL_EXCEPTION, reportable);
if (this.executionPhase === "post") {
core.warning(reportable);
}
else {
core.setFailed(reportable); core.setFailed(reportable);
this.recordEvent("exception"); }
this.recordEvent(EVENT_EXCEPTION);
} }
finally { finally {
await this.complete(); await this.complete();
@ -97429,10 +97453,10 @@ class IdsToolbox {
process.env.GITHUB_WORKSPACE_BACKUP = process.env.GITHUB_WORKSPACE; process.env.GITHUB_WORKSPACE_BACKUP = process.env.GITHUB_WORKSPACE;
delete process.env.GITHUB_WORKSPACE; delete process.env.GITHUB_WORKSPACE;
if (await cache.restoreCache([this.actionOptions.name], this.cacheKey(version), [], undefined, true)) { if (await cache.restoreCache([this.actionOptions.name], this.cacheKey(version), [], undefined, true)) {
this.recordEvent("artifact_cache_hit"); this.recordEvent(EVENT_ARTIFACT_CACHE_HIT);
return `${tempDir}/${this.actionOptions.name}`; return `${tempDir}/${this.actionOptions.name}`;
} }
this.recordEvent("artifact_cache_miss"); this.recordEvent(EVENT_ARTIFACT_CACHE_MISS);
return undefined; return undefined;
} }
finally { finally {
@ -97452,7 +97476,7 @@ class IdsToolbox {
process.env.GITHUB_WORKSPACE_BACKUP = process.env.GITHUB_WORKSPACE; process.env.GITHUB_WORKSPACE_BACKUP = process.env.GITHUB_WORKSPACE;
delete process.env.GITHUB_WORKSPACE; delete process.env.GITHUB_WORKSPACE;
await cache.saveCache([this.actionOptions.name], this.cacheKey(version), undefined, true); await cache.saveCache([this.actionOptions.name], this.cacheKey(version), undefined, true);
this.recordEvent("artifact_cache_hit"); this.recordEvent(EVENT_ARTIFACT_CACHE_HIT);
} }
finally { finally {
process.env.GITHUB_WORKSPACE = process.env.GITHUB_WORKSPACE_BACKUP; process.env.GITHUB_WORKSPACE = process.env.GITHUB_WORKSPACE_BACKUP;

View file

@ -28,7 +28,7 @@
"@actions/exec": "^1.1.1", "@actions/exec": "^1.1.1",
"@actions/github": "^5.1.1", "@actions/github": "^5.1.1",
"@actions/tool-cache": "^2.0.1", "@actions/tool-cache": "^2.0.1",
"detsys-ts": "github:DeterminateSystems/detsys-ts#instrument-execution", "detsys-ts": "github:DeterminateSystems/detsys-ts",
"fetch-retry": "^5.0.6", "fetch-retry": "^5.0.6",
"string-argv": "^0.3.2" "string-argv": "^0.3.2"
}, },

View file

@ -18,8 +18,8 @@ dependencies:
specifier: ^2.0.1 specifier: ^2.0.1
version: 2.0.1 version: 2.0.1
detsys-ts: detsys-ts:
specifier: github:DeterminateSystems/detsys-ts#instrument-execution specifier: github:DeterminateSystems/detsys-ts
version: github.com/DeterminateSystems/detsys-ts/54997e25f6d1eb824204fb17993e738e6e3c6e0c version: github.com/DeterminateSystems/detsys-ts/3a315cdffd83d4b229d4fb16548d22a3756baf28
fetch-retry: fetch-retry:
specifier: ^5.0.6 specifier: ^5.0.6
version: 5.0.6 version: 5.0.6
@ -5462,10 +5462,10 @@ packages:
engines: { node: ">=10" } engines: { node: ">=10" }
dev: true dev: true
github.com/DeterminateSystems/detsys-ts/54997e25f6d1eb824204fb17993e738e6e3c6e0c: github.com/DeterminateSystems/detsys-ts/3a315cdffd83d4b229d4fb16548d22a3756baf28:
resolution: resolution:
{ {
tarball: https://codeload.github.com/DeterminateSystems/detsys-ts/tar.gz/54997e25f6d1eb824204fb17993e738e6e3c6e0c, tarball: https://codeload.github.com/DeterminateSystems/detsys-ts/tar.gz/3a315cdffd83d4b229d4fb16548d22a3756baf28,
} }
name: detsys-ts name: detsys-ts
version: 1.0.0 version: 1.0.0