Skip to content

Commit

Permalink
chore(deps): remove cryo (#5179)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefreak committed Oct 4, 2023
1 parent 213dc1b commit 3117964
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 16 deletions.
3 changes: 1 addition & 2 deletions core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"cli-truncate": "^2.1.0",
"cpy": "^8.1.2",
"cross-spawn": "^7.0.3",
"cryo": "0.0.6",
"crypto-random-string": "^3.3.1",
"date-fns": "^2.29.3",
"dedent": "^0.7.0",
Expand Down Expand Up @@ -247,8 +246,8 @@
"md5": "^2.3.0",
"mocha": "^10.2.0",
"nock": "^12.0.3",
"nodemon": "^2.0.15",
"node-fetch": "^2.7.0",
"nodemon": "^2.0.15",
"nyc": "^15.1.0",
"p-event": "^4.2.0",
"peggy": "^3.0.2",
Expand Down
4 changes: 3 additions & 1 deletion core/src/plugins/kubernetes/run-results.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ export const k8sGetRunResult: RunActionHandler<"getResult", any> = async (params
}

export function getRunResultKey(ctx: PluginContext, action: Action) {
const key = `${ctx.projectName}--${action.type}.${action.name}--${action.versionString()}`
// change the result format version if the result format changes breaking backwards-compatibility e.g. serialization format
const resultFormatVersion = 1
const key = `${ctx.projectName}--${action.type}.${action.name}--${action.versionString()}--${resultFormatVersion}`
const hash = hasha(key, { algorithm: "sha1" })
return `run-result--${hash.slice(0, 32)}`
}
Expand Down
4 changes: 3 additions & 1 deletion core/src/plugins/kubernetes/test-results.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ export const k8sGetTestResult: TestActionHandler<"getResult", any> = async (para
}

export function getTestResultKey(ctx: PluginContext, action: StoreTestResultParams["action"]) {
const key = `${ctx.projectName}--${action.name}--${action.versionString()}`
// change the result format version if the result format changes breaking backwards-compatibility e.g. serialization format
const resultFormatVersion = 1
const key = `${ctx.projectName}--${action.name}--${action.versionString()}--${resultFormatVersion}`
const hash = hasha(key, { algorithm: "sha1" })
return `test-result--${hash.slice(0, 32)}`
}
Expand Down
5 changes: 2 additions & 3 deletions core/src/util/serialization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*/

import { mapValues } from "lodash"
import Cryo from "cryo"
import { writeFile } from "fs-extra"
import { DumpOptions, dump } from "js-yaml"
import highlight from "cli-highlight"
Expand Down Expand Up @@ -50,11 +49,11 @@ export async function dumpYamlMulti(yamlPath: string, objects: object[]) {
}

export function serializeObject(o: any): string {
return Buffer.from(Cryo.stringify(o)).toString("base64")
return Buffer.from(JSON.stringify(o)).toString("base64")
}

export function deserializeObject(s: string) {
return Cryo.parse(Buffer.from(s, "base64"))
return JSON.parse(Buffer.from(s, "base64").toString())
}

export function serializeValues(o: { [key: string]: any }): { [key: string]: string } {
Expand Down
9 changes: 0 additions & 9 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 3117964

Please sign in to comment.