Skip to content

Commit 92d4bab

Browse files
committed
internal/ci: place input parameters inside an #in struct
Otherwise, typos like #additionalCacheDirs go unnoticed as they don't cause any typo checking errors. At least this way, we can get typo checking within the #in struct. Signed-off-by: Daniel Martí <[email protected]> Change-Id: I608ad3b7a95519d2c5f05d368f5d9d6a4a9f6484 Reviewed-on: https://cue.gerrithub.io/c/cue-lang/cue/+/1219412 Reviewed-by: Paul Jolly <[email protected]> Unity-Result: CUE porcuepine <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
1 parent fb631bd commit 92d4bab

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

internal/ci/base/github.cue

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,10 @@ curlGitHubAPI: {
171171
//
172172
// Note that `${NSC_CACHE_PATH}` (`/cache`) is always mounted as a cache volume.
173173
setupCaches: {
174-
#additionalCaches: [...string] // with.cache
175-
176-
#additionalCachePaths: [...string] // with.path
174+
#in: {
175+
additionalCaches: [...string] // with.cache
176+
additionalCachePaths: [...string] // with.path
177+
}
177178

178179
[
179180
githubactions.#Step & {
@@ -185,10 +186,10 @@ setupCaches: {
185186
with: {
186187
let cacheModes = list.Concat([[
187188
"go",
188-
], #additionalCaches])
189+
], #in.additionalCaches])
189190
let cachePaths = list.Concat([[
190191
// nothing here for now.
191-
], #additionalCachePaths])
192+
], #in.additionalCachePaths])
192193

193194
if len(cacheModes) > 0 {
194195
cache: strings.Join(cacheModes, "\n")
@@ -220,10 +221,10 @@ goChecks: githubactions.#Step & {
220221
}
221222

222223
staticcheck: githubactions.#Step & {
223-
#modfile: string | *"" // an optional -modfile flag to not use the main go.mod
224+
#in: modfile: string | *"" // an optional -modfile flag to not use the main go.mod
224225
let gotool = [
225-
if #modfile != "" {
226-
"go tool -modfile=\(#modfile)"
226+
if #in.modfile != "" {
227+
"go tool -modfile=\(#in.modfile)"
227228
},
228229
"go tool",
229230
][0]

internal/ci/github/trybot.cue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ workflows: trybot: _repo.bashWorkflow & {
157157
},
158158
// Note that we don't want tooling dependencies in the go.mod file,
159159
// given how many downstreams rely on the cue module having few dependencies.
160-
_repo.staticcheck & {#modfile: "internal/tools.mod"},
160+
_repo.staticcheck & {#in: modfile: "internal/tools.mod"},
161161
]
162162

163163
_checkTags: githubactions.#Step & {

0 commit comments

Comments
 (0)