Skip to content

Commit

Permalink
fix: simplify tmt context schema
Browse files Browse the repository at this point in the history
  • Loading branch information
jamacku authored and zmiklank committed Mar 26, 2024
1 parent 452a31c commit 9840dac
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 25 deletions.
4 changes: 1 addition & 3 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/schema/input.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions dist/schema/input.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/schema/input.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 10 additions & 13 deletions src/schema/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,16 @@ export const tmtArtifactsSchema = z

// https://testing-farm.gitlab.io/api/#operation/requestsPost
// https://tmt.readthedocs.io/en/stable/spec/context.html#dimension
export const tmtContextSchema = z
.object({
distro: z.string().min(1).optional(),
variant: z.string().min(1).optional(),
arch: z.string().min(1).optional(),
component: z.string().min(1).optional(),
collection: z.string().min(1).optional(),
module: z.string().min(1).optional(),
initiator: z.string().min(1).optional(),
trigger: z.string().min(1).optional(),
})
.optional()
.or(z.object({}).transform(() => undefined));
export const tmtContextSchema = z.object({
distro: z.string().min(1).optional(),
variant: z.string().min(1).optional(),
arch: z.string().min(1).optional(),
component: z.string().min(1).optional(),
collection: z.string().min(1).optional(),
module: z.string().min(1).optional(),
initiator: z.string().min(1).optional(),
trigger: z.string().min(1).optional(),
});

export const envSettingsSchema = z
.object({
Expand Down

0 comments on commit 9840dac

Please sign in to comment.