From 46e6cb9b9500f91fdfe224cf3caa8f6ce8675081 Mon Sep 17 00:00:00 2001 From: Jonathan Matthews Date: Wed, 20 Nov 2024 17:21:43 +0000 Subject: [PATCH] preprocessor: don't attempt to format .data files This establishes .data as the filename extension for arbitrary data files that the preprocessor should neither attempt to format, nor worry about not being able to format. Preprocessor-No-Write-Cache: true Signed-off-by: Jonathan Matthews Change-Id: Icad31ddcf46ceda30069afab0765004e4ce42e05 Dispatch-Trailer: {"type":"trybot","CL":1204403,"patchset":2,"ref":"refs/changes/03/1204403/2","targetBranch":"master"} --- .../index.md | 22 +++++++++---------- .../index.md | 4 ++-- internal/cmd/preprocessor/cmd/txtar_node.go | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/hugo/content/en/docs/howto/inject-system-information-into-evaluation-using-tag-variable/index.md b/hugo/content/en/docs/howto/inject-system-information-into-evaluation-using-tag-variable/index.md index f2983b52b..ff55b3b8e 100644 --- a/hugo/content/en/docs/howto/inject-system-information-into-evaluation-using-tag-variable/index.md +++ b/hugo/content/en/docs/howto/inject-system-information-into-evaluation-using-tag-variable/index.md @@ -41,15 +41,15 @@ when invoking a supported `cue` command: ```text { title="TERMINAL" type="terminal" codeToCopy="Y3VlIGV4cG9ydCAtVCAtLW91dCBjdWUgfCBzb3J0" } $ cue export -T --out cue | sort -cpuArchitecture: "arm64" -currentHostname: "7c8be7f9b8ee" -currentTimeA: "2024-11-21T12:24:01.928819957Z" -currentTimeB: "2024-11-21T12:24:01.928819957Z" +cpuArchitecture: "amd64" +currentHostname: "fd46025f571f" +currentTimeA: "2024-07-24T12:16:36.998462958Z" +currentTimeB: "2024-07-24T12:16:36.998462958Z" currentUsername: "root" directory: "/home/runner" operatingSystem: "linux" -randomnessA: 48143939811130088532707076255718137665 -randomnessB: 48143939811130088532707076255718137665 +randomnessA: 191422226613386244533905883473376449771 +randomnessB: 191422226613386244533905883473376449771 ``` In the CUE source, notice that the `rand` and `now` tag variables were @@ -63,10 +63,10 @@ the `now` and `rand` variables are completely unstable, as demonstrated here by their values being different to the values shown above: ```text { title="TERMINAL" type="terminal" codeToCopy="Y3VlIGV2YWwgLVQgfCBncmVwIC1lIF5jdXJyZW50VGltZSAtZSBecmFuZG9t" } $ cue eval -T | grep -e ^currentTime -e ^random -randomnessA: 256474124597080097645628343043781257633 -randomnessB: 256474124597080097645628343043781257633 -currentTimeA: "2024-11-21T12:24:03.630382379Z" -currentTimeB: "2024-11-21T12:24:03.630382379Z" +randomnessA: 311890454198696002262433839322444861509 +randomnessB: 311890454198696002262433839322444861509 +currentTimeA: "2024-07-24T12:16:38.716151613Z" +currentTimeB: "2024-07-24T12:16:38.716151613Z" ``` ## Overridding system information @@ -87,7 +87,7 @@ information for fields associated with the tag: ```text { title="TERMINAL" type="terminal" codeToCopy="Y3VlIGV2YWwgLVR0IGY9MTIzMTIzMTIzMDAwIHwgZ3JlcCBecmFuZG9t" } $ cue eval -Tt f=123123123000 | grep ^random randomnessA: 123123123000 -randomnessB: 154463835233876152095912350456117094604 +randomnessB: 297085020426887323714942717980521585483 ``` ## Related content diff --git a/hugo/content/en/docs/howto/log-statistics-from-the-cue-evaluator/index.md b/hugo/content/en/docs/howto/log-statistics-from-the-cue-evaluator/index.md index 8ef394117..e2858bddf 100644 --- a/hugo/content/en/docs/howto/log-statistics-from-the-cue-evaluator/index.md +++ b/hugo/content/en/docs/howto/log-statistics-from-the-cue-evaluator/index.md @@ -35,8 +35,8 @@ CUE: { Retained: 0 } Go: { - AllocBytes: 4079824 - AllocObjects: 42098 + AllocBytes: 4015312 + AllocObjects: 42077 } ``` diff --git a/internal/cmd/preprocessor/cmd/txtar_node.go b/internal/cmd/preprocessor/cmd/txtar_node.go index dd9d471f2..fd0a2b0b3 100644 --- a/internal/cmd/preprocessor/cmd/txtar_node.go +++ b/internal/cmd/preprocessor/cmd/txtar_node.go @@ -312,7 +312,7 @@ func (t *txtarRunContext) formatFiles() error { case "proto": // TODO: add support for proto formatting, after working out how to make // this tooling generally available in the base docker image. - case "txt", "csv", "md", "java", "xml": + case "txt", "csv", "md", "java", "xml", "data": // do nothing, simply avoid logging default: t.logf("%v: skipping formatting of file %q; unknown extension %q", t, a.Basename, a.Ext)