-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add reviewers blocks to generators.yml (#3952)
- Loading branch information
1 parent
dc2352d
commit 980b5b5
Showing
8 changed files
with
158 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
packages/cli/configuration/src/generators-yml/schemas/GeneratorGroupSchema.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
import { z } from "zod"; | ||
import { GeneratorInvocationSchema } from "./GeneratorInvocationSchema"; | ||
import { OutputMetadataSchema } from "./OutputMetadataSchema"; | ||
import { ReviewersSchema, REVIEWERS_KEY } from "./ReviewersSchema"; | ||
|
||
export const GeneratorGroupSchema = z.strictObject({ | ||
audiences: z.optional(z.array(z.string())), | ||
generators: z.array(GeneratorInvocationSchema), | ||
metadata: z.optional(OutputMetadataSchema) | ||
metadata: z.optional(OutputMetadataSchema), | ||
[REVIEWERS_KEY]: z.optional(ReviewersSchema) | ||
}); | ||
|
||
export type GeneratorGroupSchema = z.infer<typeof GeneratorGroupSchema>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
packages/cli/configuration/src/generators-yml/schemas/GithubPullRequestSchema.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
import { z } from "zod"; | ||
import { GithubLicenseSchema } from "./GithubLicenseSchema"; | ||
import { ReviewersSchema, REVIEWERS_KEY } from "./ReviewersSchema"; | ||
|
||
export const GithubPullRequestSchema = z.strictObject({ | ||
repository: z.string(), | ||
branch: z.optional(z.string()), | ||
license: z.optional(GithubLicenseSchema), | ||
mode: z.literal("pull-request") | ||
mode: z.literal("pull-request"), | ||
[REVIEWERS_KEY]: z.optional(ReviewersSchema) | ||
}); | ||
|
||
export type GithubPullRequestSchema = z.infer<typeof GithubPullRequestSchema>; |
16 changes: 16 additions & 0 deletions
16
packages/cli/configuration/src/generators-yml/schemas/ReviewersSchema.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { z } from "zod"; | ||
|
||
export const REVIEWERS_KEY = "reviewers"; | ||
|
||
// Overkill object right now, but at some point we might | ||
// need to specify orgs, or other things | ||
const ReviewerSchema = z.strictObject({ | ||
name: z.string() | ||
}); | ||
|
||
export const ReviewersSchema = z.strictObject({ | ||
teams: z.optional(z.array(ReviewerSchema)), | ||
users: z.optional(z.array(ReviewerSchema)) | ||
}); | ||
|
||
export type ReviewersSchema = z.infer<typeof ReviewersSchema>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters