Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(config): add descriptions to JSON schema properties #30

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@
"collaborator": {
"default": 1,
"minimum": 1,
"description": "The amount of validations needed to consider a pull-request by a collaborator to be deemed eligible for merge",
"type": "number"
},
"contributor": {
"default": 2,
"minimum": 1,
"description": "The amount of validations needed to consider a pull-request by a contributor to be deemed eligible for merge",
"type": "number"
}
}
Expand All @@ -28,6 +30,7 @@
"collaborator": {
"default": "3.5 days",
"description": "The timespan to wait before merging a collaborator's pull-request",
"examples": ["1 day", "3.5 days"],
"type": "string"
}
}
Expand All @@ -38,6 +41,8 @@
"properties": {
"monitor": {
"default": [],
"description": "Repositories to watch for updates, if empty all are watched and if just owner is provided all repositories from that owner are watched.",
"examples": ["owner/repo", "owner"],
"type": "array",
"items": {
"minLength": 1,
Expand All @@ -46,6 +51,8 @@
},
"ignore": {
"default": [],
"description": "Repositories to ignore updates from, if empty all repositories are watched and if just owner is provided all repositories from that owner are ignored",
"examples": ["owner/repo", "owner"],
"type": "array",
"items": {
"type": "string"
Expand All @@ -55,6 +62,11 @@
},
"allowedReviewerRoles": {
"default": ["COLLABORATOR", "MEMBER", "OWNER"],
"description": "When considering a user for a task: which roles should be considered as having review authority? All others are ignored.",
"examples": [
["COLLABORATOR", "MEMBER", "OWNER"],
["MEMBER", "OWNER"]
],
"type": "array",
"items": {
"type": "string"
Expand Down
28 changes: 22 additions & 6 deletions src/types/plugin-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ export const approvalsRequiredSchema = T.Object(
* The amount of validations needed to consider a pull-request by a collaborator to be deemed eligible for
* merge, defaults to 1.
*/
collaborator: T.Number({ default: 1, minimum: 1 }),
collaborator: T.Number({ default: 1, minimum: 1, description: "The amount of validations needed to consider a pull-request by a collaborator to be deemed eligible for merge" }),
/**
* The amount of validations needed to consider a pull-request by a contributor to be deemed eligible for merge,
* defaults to 2.
*/
contributor: T.Number({ default: 2, minimum: 1 }),
contributor: T.Number({ default: 2, minimum: 1, description: "The amount of validations needed to consider a pull-request by a contributor to be deemed eligible for merge" }),
},
{ default: {} }
);
Expand All @@ -21,7 +21,11 @@ export const mergeTimeoutSchema = T.Object(
/**
* The timespan to wait before merging a collaborator's pull-request, defaults to 3.5 days.
*/
collaborator: T.String({ default: "3.5 days", description: "The timespan to wait before merging a collaborator's pull-request" }),
collaborator: T.String({
default: "3.5 days",
description: "The timespan to wait before merging a collaborator's pull-request",
examples: ["1 day", "3.5 days"]
}),
},
{ default: {} }
);
Expand All @@ -31,16 +35,28 @@ export const reposSchema = T.Object(
/**
* Repositories to watch for updates
*/
monitor: T.Array(T.String({ minLength: 1 }), { default: [] }),
monitor: T.Array(T.String({ minLength: 1 }), {
default: [],
description: "Repositories to watch for updates, if empty all are watched and if just owner is provided all repositories from that owner are watched.",
examples: ["owner/repo", "owner"]
}),
/**
* Repositories to ignore updates from
*/
ignore: T.Array(T.String(), { default: [] }),
ignore: T.Array(T.String(), {
default: [],
description: "Repositories to ignore updates from, if empty all repositories are watched and if just owner is provided all repositories from that owner are ignored",
examples: ["owner/repo", "owner"]
}),
},
{ default: {} }
);

const allowedReviewerRoles = T.Array(T.String(), { default: ["COLLABORATOR", "MEMBER", "OWNER"] });
const allowedReviewerRoles = T.Array(T.String(), {
default: ["COLLABORATOR", "MEMBER", "OWNER"],
description: "When considering a user for a task: which roles should be considered as having review authority? All others are ignored.",
examples: [["COLLABORATOR", "MEMBER", "OWNER"], ["MEMBER", "OWNER"]]
});

export const pluginSettingsSchema = T.Object({
approvalsRequired: T.Optional(approvalsRequiredSchema),
Expand Down