Skip to content

Commit

Permalink
Merge pull request #30 from ubq-testing/development
Browse files Browse the repository at this point in the history
fix(config): add descriptions to JSON schema properties
  • Loading branch information
gentlementlegen authored Nov 29, 2024
2 parents 0004a4b + 18f3254 commit 4298993
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 7 deletions.
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

0 comments on commit 4298993

Please sign in to comment.